Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Answer in true or false1 in the circular flow model firms

Answer in true or False : 1) In the circular flow model, firms sell the services of factors of production to households 2) If GDP included the value of leisure time, the value of US GDP would most likely increase. 3) GDP ...

Why did prior to 1945 nearly all neoclassical economists

Why did prior to 1945 nearly all neoclassical economists agreed that democracy and capitalism were natural enemies?

The contents of a certain medication bottle show a normal

The contents of a certain medication bottle show a normal distribution with a mean of 250 ml. and standard deviation of 5 ml. What is the probability that the mean of the contents in a simple random sample of 4 such bott ...

A suppose that for a given year national saving in a

a. Suppose that, for a given year, national saving in a country (an open economy) equals 100, private consumption equals 50, and government consumption equals 20. What is the level of output in this country in this year? ...

Suppose a consumer is trying to make a choice over the

Suppose a consumer is trying to make a choice over the consumption of two goods: x and y. Px = 3, Py = 4 and the income is equal to 50. Assume that the government distributes some stamps that are good to buy 5 units of g ...

Suppose you do not know the population mean fee charged to

Suppose you do not know the population mean fee charged to H&R Block customers last year. Instead, suppose you take a sample of size n=40 and find a sample mean of 175. Assume that the distribution for fees is normally d ...

A worker earns 15 per hour at a plant and is told that only

A worker earns $15 per hour at a plant and is told that only 2.5% of all workers make a higher wage. If the wage is assumed to be normally distributed and the standard deviation of wage rates is $5 per hour, the average ...

Inc 409661 2796 pop INC = 40966.1 + 2.796 POP'            sample size = 400

INC = 40966.1 + 2.796 POP'            sample size = 400  (se)    (545.8)   (.2796);                  R 2  = .2468 1. Where INC is the income in millions of dollars and POP the population in millions of people. Provide an ...

Sals market receives a box of jen amp barrys fast fresh

Sal's Market receives a box of Jen & Barry's Fast Fresh Salad BagsTM. Each box contains 16 Caesar salad bags, 20 tossed salad bags, and 12 shredded cabbage bags. Suppose that each type salad bag has an equal chance of be ...

Carlies indifference curves have the equation xb

Charlie's indifference curves have the equation xB = constant/xA, where larger constants denote better indifference curves. Charlie strictly prefers the bundle (6, 16) to a. the bundle (16, 6). b. the bundle (7, 15). c. ...

  • 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