0% found this document useful (0 votes)
15 views5 pages

SQL Complete Test On Dvdrental

The document contains a series of SQL queries aimed at retrieving various data from a database, including actor information, payment details, customer records, film lengths, and rental statistics. It covers specific conditions such as filtering by names, amounts, and lengths, as well as aggregating data for averages and counts. The queries also explore relationships between different tables, like actors and films, and customer and payment information.

Uploaded by

curiosityever82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

SQL Complete Test On Dvdrental

The document contains a series of SQL queries aimed at retrieving various data from a database, including actor information, payment details, customer records, film lengths, and rental statistics. It covers specific conditions such as filtering by names, amounts, and lengths, as well as aggregating data for averages and counts. The queries also explore relationships between different tables, like actors and films, and customer and payment information.

Uploaded by

curiosityever82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

--Get a list of actors with the first name Julia.

--Retrieve First name, Last Name, Actor ID from actor where


last name is 'Wahlberg'

--Get a list of actors with the first name Chris, Cameron, or


Cuba.

--Retrieve all information from payment where amount are


2.99, 6.99, or 4.99

--Retrieve all informatio from customer where First Name is


Jamie and Last name is Rice

--Retrieve all information from customer where first Name is


Linda or last name is Brown

--Retrieve all information where last name is not Green

--Select amount and payment_date from payment where the


amount paid was less than $1

--Create list of films (title, description and length) where film


is longer than 130 mins
--Retrieve all info from film (max 10 records) where length is
in ascending order

--Retrieve all first name as GIVEN NAME from customer table

--Retrieve all info from film (max 10 records) where length is


in descending order

--What are the addresses of each store

--Retrieve all information from address where address2 is null

--Fetch all information of 10 customer where first name starts


with S

--Fetch all information from payment table where staff ID is 1


and amount is between 4.99 and 5.99

--Fetch all information from the customer table where First


Name Between 'A' and 'D'

--Retrieve all information from Film when length is 150 min


and replacement cost is more than 25
--Retrieve all information from film where length is greater
than 183 and rating is either NC-17 or

--Retrieve payment id, customer id, rental id and add 10


dollars to the amount as updated_amount from payment table

--Retrieve the unique district, city_id from address where


city_id is greater Than 570

--Retrieve district, city_id, address_id and phone from address


where city_id is greater Than 570 and ascending by district

--What are the different rental durations that the store allows?

--Retrieve avg length of a film

--Retrieve maximum length of a film

--Retrieve minimum length of a film

--Retrieve 2nd maximum length of film

--Retrieve 3rd maximum length of film


--What are the IDs of the last 3 customers to return a rental?

--How many films are rated NC-17?

--How many are rated PG or PG-13?

--How many different customers have entries in the rental


table?

--How many customers we have in DVD Rental database?

--What is the average time that people have rentals before


returning? Hint: the output you’ll get may include a number of
hours > 24. You can use the function justify_interval on the
result to get output that looks more like you might expect.

--Select the 10 actors who have the longest names (first and
last name combined).

--Which film (id) has the most actors?

--Which actor (id) is in most films?

--Get First name and Last Name together as Full Name of


customers
--Retrieve length and number of same length of movies using
Group By

--Are there any customers with the same last name?

--Retrieve amount and number of same amount in payment


using Group By when amount is more than 6.99

--What is the average rental rate of films? Can you round the
result to 2 decimal places?

--Does the average replacement cost of a film differ by rating?

You might also like