Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Assignment: SQL

Getting Data out of the Database

For this assignment, you will be working with the same movie rental database as the in-class exercise (MovieDB). The schema is also the same, so you should use the one provided for the in-class exercise as a guide.

You will construct a single SQL queryusing MySQL Workbench that provides the answer to each of the questions below. You should also provide the answer to the question. Some of the questions can be answered by querying one table; others will require joining multiple tables to get the answer.

Also pay attention to what it says to Display. This is how your results should appear. For example:

Display: name and special features

Means that your SQL query should return only two columns of data: name and special features

(Note that this always isn't a field name, sometimes it is the result of a SUM(), COUNT(), or AVG()!)

Guidelines

• You must submit your answers electronically in a single Word document. You can copy and paste the SQL query and the results from SQL Workbench.

• You must include your name at the top of the document.

• Your answers should be emailed, as an attachment, from your Temple email account to the following OWLbox folder:upload.Assignm.eg5wopfhak@u.box.com

• Please include your last name in the file name.

• The email must be sent by the start of class the day the assignment is due.

If you do not follow these instructions, your assignment will be counted late.

Evaluation

Your submission will be graded using two factors:

• A correctly formed SQL query that answers the specific question asked (no extra rows or columns).

• Providing the correct answer to the question (the answer the query provides).

Questions

1. What are the title and special features for films rated PG-13 and longer than 180 minutes?

Display: name and special features

2. What are the three most popular firstnames among the actors in the database?

Display: first name and the how many times that name appears in the database

3. What is the average rental cost (rate) for eachmovie rating (i.e., G, PG, R, NC-17)?

Display: rating and average rental rate

4. How many R movies mention ‘drama' in their description?

(Hint: use WHERE...LIKE with a wildcard. Remember, %dog% will match any value containing "dog," %dog will any value ending in "dog," and dog% will match any value beginning in "dog.")

Display: number of movies

5. Which store (identified by store_id) has the most movies in their inventory?

(Hint: List all stores. The list is short!)

Display: store_id, how many movies

6. Who were the stars of the movie "Operation Operation"?

Display: first name and last name

7. Which actors with a last name beginning with the letter "J" have starred in movies in theFrench language?

(Two hints: (1) Be sure to reference the language name "French" in your query and (2) Don't forget previous hints!)

Display: first name and last name

8. Which are the languages of the movies that Patricia Johnson has rented and how many has she rented in each of those languages?

(Hint: Assume no ties, just limit your results to the first three rows.)

Display: language name and how many movie rentals

9. What is the shortestR-rated movie in French and how long is it?

(Two hints: (1) Use a subselect statement with the MIN() function to return only the shortest movie and (2) be sure to reference the language name "French" in your query.)

Display: movie title and movie length

10. What was the shortest movie starring PenelopeGuiness and how long is it?

(Hint: Use a subselect statement with the MIN() function to return only the shortestmovie.)

Display: movie title and movie length.

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91624242
  • Price:- $65

Guranteed 36 Hours Delivery, In Price:- $65

Have any Question?


Related Questions in DBMS

Sqlwrite a select statement that returns one column from

SQL Write a SELECT statement that returns one column from the Vendor table named Full Name. Create this column from the VendorContactFName and VendorContactLName columns. Format it as follows: last name, comma, first nam ...

Assignmenta restaurant is designing a database to keep

Assignment A restaurant is designing a database to keep track of customer services. A customer is defined as a customer ID, name, address and a telephone number. Customers are served by employees. Each employee is define ...

We can represent a data set as a collection of object nodes

We can represent a data set as a collection of object nodes and a collection of attribute nodes, where there is a link between each object and each attribute, and where the weight of that link is the value of the object ...

Sql transactions exercisesconsider table itemnameprice

SQL Transactions Exercises Consider table Item(name,price) where name is a key, and the following two concurrent transactions. T1: Begin Transaction; Update Item Set price = 2*price Where name = 'pencil'; Insert Into Ite ...

Question 1 what isdata-manipulation language dml there are

Question: 1. What isData-Manipulation Language (DML)? There are four types of access in DML, explain each one. 2. Assume we have a Library Database consists of the following relations: author(author_id, first_name, last_ ...

Suppose that we have a table of house prices and a table of

Suppose that we have a table of house prices and a table of zip codes: • hprices(hid (PK),address,bedrooms,price,zipcode) • zipcodes(zipcode (PK),state) Write a SQL query that finds the average, maximum, and minimum pric ...

You are responsible for keeping track of meal expenses for

You are responsible for keeping track of meal expenses for ten employees while at a business lunch to which your employer has invited you to attend. Write an algorithm that inputs the lunch costs for each the ten employe ...

Answer the following question explain the difference

Answer the following Question : Explain the difference between a database management system (DBMS) and a database. Are Microsoft Access, SQL Server, and Oracle examples of databases or database management systems (DBMS)?

Question sql injection is in the top 10 owasp and common

Question : SQL Injection is in the top 10 OWASP and Common Weakness Enumeration. Using MySQL and PHP, show your own very short and simple application that is vulnerable to this attack. Provide another version that mitiga ...

In sql developercreate a table userpermissions provide

IN SQL DEVELOPER Create a table UserPermissions (provide create and insert statements code) Document UserName Policy SYSTEM Menu JDOW W2 USAM Permissions SYSTEM W2 JDOW Form 1040 USAM Policy JDOW W2 SYSTEM Write a PL/SQL ...

  • 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