05 Mar
05Mar

The DVD-Rental Database comprises of sixteen tables which contain customer details, film details, actor details, etc.

With the help of structured query language, particularly PostgreSQL several business questions were answered.

Below are the business questions, query language that solved each question, and the result per query.

(1) A customer, Nancy Thomas forgot his wallet at our store! We need his email address to track him down so as to inform him.

Result:

(2) A customer needs to know the description of the movie, "Outlaw Hanky." Return a result that shows the description of the movie

Result:

(3) A customer is late on their movie return, we've mailed them a letter to their address at "259 Ipoh Drive." We should also call them. Return the customer's phone number

Result:

(4) What are the IDs of the first 10 customers who created a payment?

Result:

(5) What are the titles of the 5 shortest (in length of runtime) movies?

Result:

(6)   How many movies are with less than or equals to 50minutes in runtime?

Result:

(7) How many payments were greater than $5?

Result

(8) How many unique districts are our customers from?

Result:

(9) How many films have a rating R and a replacement cost between $5 and $15?

Result:

(10) How many payments did each staff handled and who handled the most number of pay?

Result:

(11) What's the average replacement cost per MPAA rating?

Result:

(12) ID of Top 5 customers by total spend

Result:

(13) Return customer_ids that  have had 40 or more transactions with us

Result:

(14) What are the emails of customers who live California

Result:

(15) List of films where Nick Wahlberg is an actor

Result:

(16) How many payments occur on a Monday?

Result:

(17) Produce a list of members who joined after September 2012

Result:

(18) A list of total number of slots booked per facility in September 2012

Result:

(19) How many times did David Farrell book a facility

Result:

(20) Member with the most booked slot

Result:

(21) The most booked facility

Result:

(22) List that shows membership status. Return Premium for members who has booked more than 300 slots since inception, while standard for other members.

Result:

Tools: PostgreSQL



Comments
* The email will not be published on the website.
I BUILT MY SITE FOR FREE USING