Ask Business Economics Expert

Scenario:

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 (NOTE: If you already did this in Project 1, you do not need to do this step again):

1. Download RentalCompany.sql from Doc Sharing.

a. Run the script to create tables and data. You should not receive errors. There may be a few warnings, but that is okay.

b. To verify you created all tables, run the following SQL:

SELECT TABLE_NAME, TABLE_ROWS, TABLE_TYPE, CREATE_TIME FROM 'information_schema'.'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.

actor

200

BASE TABLE

address

603

BASE TABLE

category

16

BASE TABLE

city

600

BASE TABLE

country

109

BASE TABLE

customer

599

BASE TABLE

film

1000

BASE TABLE

film_actor

5462

BASE TABLE

film_category

1000

BASE TABLE

film_text

1000

BASE TABLE

inventory

4581

BASE TABLE

language

6

BASE TABLE

payment

16086

BASE TABLE

rental

16005

BASE TABLE

staff

2

BASE TABLE

store

2

BASE TABLE

Directions:

1. Create a query to demonstrate use of the EXISTS keyword. List all the actors (ID, First Name, Last Name) from the actors table whose actor ID exists in the film_actor table. Only list those that have a film ID greater than 400. You must construct your statement like it was demonstrated to you in the tutorial for Chapter 18.

2. Create a query to demonstrate the use of NOT IN. List all columns from the category table where the name equals Comedy and name is not in Drama or Action.

3. Create a query to demonstrate the use of NOT IN and AND. List all columns from the category table where the name is not in Comedy or Action and category ID is 3 or 2.

4. Create a query to demonstrate the use of a CASE expression. List the film ID and title from the film table. Include a third column named RatingText. RatingText should display Parental Guidance Suggested when the rating on the table is PG, General Audiences when G, and Restricted when R. Otherwise, RatingText should display Nomatch if it does not match any of this criteria. Only show the rows where the film ID is greater than 950.

5. Create a query to demonstrate the use of a CASE expression in a WHERE clause. List all customers who are Inactive. Inactive is signified by a 0 in the active column of the customer table.

Business Economics, Economics

  • Category:- Business Economics
  • Reference No.:- M92291395
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Business Economics

Standards drive instruction therefore how do standards

Standards "drive instruction," therefore, how do standards influence curriculum planning?

Explain how the application of the pdca cycle can support a

Explain how the application of the PDCA cycle can support a competitive strategy of low cost leadership.

Ford motors expects a new hybrid-engine project to produce

Ford Motors expects a new? Hybrid-engine project to produce incremental cash flows of $ 95 million each year and expects these to grow at 4?% each year. The upfront project costs are? $900 million and? Ford's weighted av ...

A five-year bond with a yield of 11 continuously compounded

A five-year bond with a yield of 11% (continuously compounded) pays an 8% coupon at the end of each year. a) What is the bond's price? b) What is the bond's duration? c) Use the duration to calculate the effect on the bo ...

Image manufacturing is an electronics manufacturer and

IMAGE Manufacturing is an electronics manufacturer and retailer. Its main products are Ultrabook computers, PCs and calculators. The current price of the Ultrabook is $ 600, the PC is $700 and the calculator is $30. This ...

According to kulish what is about the design of the euro

According to Kulish, what is about the design of the euro currency that lessens its appeal compared to prior national currencies?

How has the value of the euro changed compared to other

How has the value of the Euro changed, compared to other countries, over the past 10 years (since the Great Recession began)?

In lecture we discussed why the production possibilities

In lecture we discussed why the production possibilities frontier (the boundary of the production possibilities set) is bowed 'outwards'. When might the production possibilities set be bowed 'inwards'? Give an example of ...

In 2013 gallup conducted a poll and found a 95 confidence

In 2013, Gallup conducted a poll and found a 95% confidence interval of the proportion of Americans who believe it is the government's responsibility for health care. Give the statistical interpretation. I do not underst ...

The standard deviation of the number of video game as

The standard deviation of the number of video game A's outcomes is 0.5479, while the standard deviation of the number of video game B's outcomes is 0.2498. Which game would you be likely to choose if you wanted players t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As