Run the script to create tables and data

Assignment Help Business Economics
Reference no: EM131482659

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.

Reference no: EM131482659

Questions Cloud

What are the most effective strategies for managing quality : What are the most effective strategies for managing quality control on quantitative methods in program evaluation? Why are they the most effective?
Define the market equilibrium associated with service : Define the industry and the market equilibriumassociated with product or service. Predictthe effect of changes in supply and demand on the market equilibrium.
Directaccess and remote access benefits : Suppose you are employed by a medium-sized business that has to this point decided not to use remote access solutions.
Explain how this event affects spending saving mpc and apc : The Johnson family's income is $2000 per month. They typically spend $1800 on consumer goods and save the remaining $200. Mrs. Johnson just received a $200.
Run the script to create tables and data : Run the script to create tables and data. You should not receive errors. There may be a few warnings, but that is okay.
Create a semiannual production plan : Estimated number of worker requirements considering a standard work week, current inventory levels, receipts of new inventory during each month.
Identify the formal structure of an organization : How is the organization's structure and design a reflection of its environment, goals, and competencies?
How does understanding leadership as a vocation : How does understanding leadership as a vocation inform your understanding of the personal and moral commitments required of leaders?
How would an increase in investment spending affect economy : How would an increase in government spending for missile bases affect the economy in the short run (look at aggregate demand, aggregate supply, RGNP).

Reviews

Write a Review

Business Economics Questions & Answers

  Economics assignment

This document contains various important questions and their appropriate answers in the subject field of Economics.

  Demand and supply curves

Economics is the study of the principles governing the allocation of scarce means among competing ends when the objective of the allocation is to maximize the attainment of the ends.

  Long-run perfectly competitive equilibrium for the firm

Evaluate Government intervene and correct this situation?(a) Explain the concept of a concentration ratio. A rise in the price of magarine Explain the impact of external costs and external benefits on resource allocation long-run perfectly c..

  Supply and demand diagrams

Explain each of the following using supply and demand diagrams,  With the use of a graph, explain how these two programs affect cigarette consumption and the price of cigarettes.

  Case study: fisher-price toys

The case study of the Fisher-Price Toys, Inc., a popular case in basic economics and management from the prestigious Harvard Business School.

  Draw the production possibility curve

Draw the production possibility curve and a. Define consumer surplus and producer surplus.

  Tax revenue

The Australian government administers two programs that affect the market for cigarettes

  Maximize total welfare

How many tickets to sell to maximize total welfare.

  Difference between the cv and the ev

The change in consumer surplus (?CS) is not "theoretically" justifiable like the CV and EV but it continues to be the most widely used measure of consumer welfare change. Explain how this can be reconciled

  Depict von neumann-morgenstern utility index u in a diagram

Depict the von Neumann-Morgenstern utility index u in a diagram

  What is the market solution

What is the market solution (market price and quantity) and What is the total surplus of the society under the market solution

  Calculate gross national product and net national product

Calculate gross national product and net national product

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd