Computer Science Homework Help

CSIS 325 SQL Queries Lab Report

 

Follow all instructions in the attached document, “Lab 6 SQL Queries – Instructions”. Fill out all answers in the Lab 6 SQL Queries – Instructions document.

1. Write and
execute a query that will return the name and age of all customers.

2. Write and execute a query that will display the name and resid_city of all customers that were born in Tampa.

3. Write and execute a query that will show the customer id and name of customers between the ages of 25 (inclusive) and 40 (inclusive).Order your results by Cname in descending order.Display the CName column with the heading “Customer Name” ß note the capitalizing and the space between words.(Note that you will need to use a column alias for this using the keyword “AS.”

4. Write and execute a query that will list any customers whose names begin with the letter “G”.

5. Write and execute a query that will display a unique list of all the automobile Makes that have ever been rented.Order your results by Make.

6. Write and execute a query that will display all of the customers who have ever rented an automobile. Include the customer name, make, pickup location in your results. Order your list in ascending order by pickup.

7. Write and execute a query that will return the names of customers who rented a Ford or GM.

You should have 4 rows in your result set.

8. Write and execute a query that will display the customer names, ages, makes, and daily cost of each automobile that they rented. Order your results by cost

9. Write and execute a query that will return the unique list of birth places of everyone who has ever rented a Ford.

10. Write a query that will return the Names and ages of customers who have rented any automobile during 2009. Make sure that each customer is listed only once in your output.

11. Write and
execute a query that will determine the total number of days that Black rented
a GM on November 1, 2009.

12. Write and
execute a query that will determine the total cost of the automobile rented by
Black on November 1, 2009.

13. Write and execute a query that will determine the Total cost of all the automobiles that have ever been rented.

14.Write and execute a query that will determine the average number of days that automobiles are rented. Show your result broken out by makes. Do not include an automobile if it has not yet been returned.

15.Write and execute a query that will determine the average age of customers broken out by the city in which they reside. Note: Make sure that the average age is not truncated to an integer.

16.Write and execute a query that will show a list of customers who reside in the same city in which they were born.

17. Using a left outer join, write and execute a query that will display a unique list of the makes of automobiles that have never been rented.

18.Using a Type I query, display a unique list of the makes of automobiles that have never been rented.

19. Using a right outer join, write and execute a query that will display a unique list of customers who have never rented an automobile.

20.Using a Type II query, display a unique list of customers who have never rented an automobile.

21.Write and execute a query that will display a list of the customers who picked up their rental from the same city in which they reside.

22.Write a query that will display a list of customers who have not returned their rentals.

23.Using a Type I query, show all of the names and ages of customers who have rented an automobile and returned it to Erie.Sort your results in ascending order by customer name.

24.Using a Type II query, show all of the customers who rented an automobile and picked it up in Cary

25. Write and execute a single query that will display all of the information in the Customer, Rentals, and Rentcost tables in a single resultset.Be sure to display each field only once in your output.Order your results in ascending order by Customer.CID and Rentcost.Make.