Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You work for a DVD rental company. Your manager has asked you to pull some data on the company, its inventory, and customers. You will

image text in transcribed
image text in transcribed
You work for a DVD rental company. Your manager has asked you to pull some data on the company, its inventory, and customers. You will complete this by developing and running SQL queries. Initialize Your Database: 1. Download RentalCompany.sql from Doc Sharing. Run the script to create tables and data. You should not receive errors. There may be a few warnings, but that is okay To verify you created all tables, run the following SQL: a. b. SELECT TABLE NAME, TABLE ROWS, TABLE TYPE, CREATE TIME FROM information_schemo. tables WHERE table_schema 'rentalcompany' AND TABLE TYPE- BASE TABLE Your results should look like the table below. This will help verify that you properly created the schema/database and tables. 200 BASE TABLE 603 BASE TABLE category16 BASE TABLE 600 BASE TABLE 109 BASE TABLE actor address city country customerl599 BASE TABLE 1000 BASE TABLE film film actor5462 BASE TABLE film category 1000 BASE TABLE film text1000 BASE TABLE inventory4581 BASE TABLE language6BASE TABLE payment16086 BASE TABLE 16005 BASE TABLE 2BASE TABLE BASE TABLE rental staff Directions: 1. Show me all the films that have the word epic in their description. Only display the following columns: film id, title, description, release year. Sort them descending by film id and descending by release year. Show me the different rental durations within the film table. Your SQL should eliminate any duplicate entries and only show me the distinct rental durations. Show me all columns from the payment table where the amount is greater than or equal to 11.99.Sort the results by customer id ascending Show me all the actors from the actor table. Show only one column that you name full name; this is a concatenation of the last nome and first name with a comma in between, order by last name descending. 2. 3. 4. 5. I want to know how much more I could have made if I increased the amount charged on the payment table by 10%. Show me payment id, rental id, amount, and 10% of the amount for each record on the payment table. Your new column should be titled new amount 6. Show me all the films that have a rental duration in 2,6, or 7. You must demonstrate the use of the in keyword or points will be deducted Show me all columns from the customers whose last name begin with Ba sorted by last name in ascending order. You must demonstrate the use of the like keyword or points will be deducted 7. Show me only the first name and last name of all the customers whose last name begin with C and are only 3 letters long. You must use a pattern string as a filter or points will be deducted 8. 9. Show me all the customers whose first name does not start with a A, sorted by first name ascending You work for a DVD rental company. Your manager has asked you to pull some data on the company, its inventory, and customers. You will complete this by developing and running SQL queries. Initialize Your Database: 1. Download RentalCompany.sql from Doc Sharing. Run the script to create tables and data. You should not receive errors. There may be a few warnings, but that is okay To verify you created all tables, run the following SQL: a. b. SELECT TABLE NAME, TABLE ROWS, TABLE TYPE, CREATE TIME FROM information_schemo. tables WHERE table_schema 'rentalcompany' AND TABLE TYPE- BASE TABLE Your results should look like the table below. This will help verify that you properly created the schema/database and tables. 200 BASE TABLE 603 BASE TABLE category16 BASE TABLE 600 BASE TABLE 109 BASE TABLE actor address city country customerl599 BASE TABLE 1000 BASE TABLE film film actor5462 BASE TABLE film category 1000 BASE TABLE film text1000 BASE TABLE inventory4581 BASE TABLE language6BASE TABLE payment16086 BASE TABLE 16005 BASE TABLE 2BASE TABLE BASE TABLE rental staff Directions: 1. Show me all the films that have the word epic in their description. Only display the following columns: film id, title, description, release year. Sort them descending by film id and descending by release year. Show me the different rental durations within the film table. Your SQL should eliminate any duplicate entries and only show me the distinct rental durations. Show me all columns from the payment table where the amount is greater than or equal to 11.99.Sort the results by customer id ascending Show me all the actors from the actor table. Show only one column that you name full name; this is a concatenation of the last nome and first name with a comma in between, order by last name descending. 2. 3. 4. 5. I want to know how much more I could have made if I increased the amount charged on the payment table by 10%. Show me payment id, rental id, amount, and 10% of the amount for each record on the payment table. Your new column should be titled new amount 6. Show me all the films that have a rental duration in 2,6, or 7. You must demonstrate the use of the in keyword or points will be deducted Show me all columns from the customers whose last name begin with Ba sorted by last name in ascending order. You must demonstrate the use of the like keyword or points will be deducted 7. Show me only the first name and last name of all the customers whose last name begin with C and are only 3 letters long. You must use a pattern string as a filter or points will be deducted 8. 9. Show me all the customers whose first name does not start with a A, sorted by first name ascending

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

What is the use of bootstrap program?

Answered: 1 week ago

Question

What is a process and process table?

Answered: 1 week ago

Question

What is Industrial Economics and Theory of Firm?

Answered: 1 week ago

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago