Prepare sql queries to find the customers

Assignment Help PL-SQL Programming
Reference no: EM13712133

Write the given queries in SQL (no top, rank, limit, or windows allowed)

Customer (cid, name, address)

Car (vin, make, color, number-doors, daily-price)

Reservation (cid, vin, date, location, number-days)

Customer contains the customer id (the key), name and address of each customer who rents a car. Car contains information about vehicles: the vin (key), the make, color, number of doors (either 2 or 4), and the daily price to rent the car.

Reservations registers each reservation, who reserved the car, which car was reserved, the location where the car was rented, the date the reservation starts, and the number of days it lasts.

Each customer may make several reservations and each car can be reserved several times.

Note that we assume no two reservations of the same car or by the same customer on the same day. Suppose date has both month and year, as in March 2009.

Write the given queries in SQL (no top, rank, limit, or windows allowed)

Part 1- List the names of customers who have reserved a green car during September 2013.

Part 2- Give the number of reservations each month during all of 2010.

Part 3- Find the number of reservations involving Ford cars in a location other than Detroit.

Part 4- Find out customers who made more than 12 reservations in 2010.

Part 5- List the longest reservations (the ones with the most number-days) in the whole database.

Part 6- List the reservations with duration (number-days) larger than the average duration.

Part 7- List the car makes that have the most days in total reservations in 2010.

Part 8- Find the customer's who have reserved only 4-door cars.

Prepare SQL queries to find the customers who have reserved only 4-door cars.

Reference no: EM13712133

Questions Cloud

Is the spring free exerted on mass : is the spring free exerted on mass 1 while it rotates greater than, less than, or equal to the force exerted by the spring on a stationary mass 1 with the spring stretched the same amount (to the radius marker).
Write recursive and iterative versions of functions : Write recursive and iterative versions of functions that compute the sum of components of an array.
Plot two different voltage vs. time graphs : Plot two different Voltage vs. time graphs depicting input voltages that would cause DC to flow through in a circuit. Plot two different Voltage vs. time graphs depicting input voltages that would cause AC to flow through in a circuit
Write an iterative version and a recursive version : Write a main program that illustrates the work of your functions. E.g., if a[ ]={1,2,3,3,4,5} then 3 occurs 2 times and 7 occurs 0 times.
Prepare sql queries to find the customers : Prepare SQL queries to find the customers who have reserved only 4-door cars.
Calculate the acceleration of the bucket : Calculate the acceleration of the bucket. Calculate how fast the bucket is moving after it has fallen 2.50 m assuming it has not reached the edge of the building.
Write a program to find minimum and maximum values : Write a program to find minimum and maximum values for third-degree polynomials of the form:
Determine order of operations for seq search algorithm : Determine the order of operations for this Seq Search algorithm. Best case and worse case and why - Find the order of operations for this Search algorithm. Prepare a proper algorithm for this problem and how to complete it.
What is the y-component of the electric field : What is the x-component of the electric field at the point. What is the y-component of the electric field at the point. What is the total magnitude of the electric field at the point.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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