subject

Write and execute a single query that will isplay 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 .You should have 12 rows and 12 columns in your result. In this lab, you will be working with the follwing tables in SQL Server. To create and populate these tables in SQL Server, run the queries that are listed below these tables. CUSTOMERCIDCNameAgeResid_CityBirthP lace1BLACK40ERIETAMPA2GREEN25CARYER IE3JONES30HEMETTAMPA4MARTIN35HEMETT AMPA5SIMON22ERIEERIE6VERNON60CARYCA RY7WILSON25DENVERAUSTINIn the CUSTOMER table, CName is the primary key. RENTALSRtnCIDMakeDate_OutPickupDate _returnedReturn_city11FORD10-Oct-20 10CARY12-Oct-2010CARY21GM01-Nov-200 9TAMPA05-Nov-2009CARY31FORD01-Jan-2 009ERIE10-Jan-2009ERIE42NISSAN07-No v-2010TAMPA53FORD01-Oct-2010CARY31- Oct-2010ERIE63GM01-Aug-2009ERIE05-A ug-2009ERIE74FORD01-Aug-2010CARY12- Aug-2010ERIE85GM01-Sep-2010ERIEIn the table RENTALS, Rtn is the primary key and represents the rental number. CID is a foreign key in the RENTALS table and refers to the CID in CUSTOMER; Pickup is the city where the car was picked up; and Date_Out is the date in which the car was rented out. Return_city is the city where the car was returned. Date_returne is the date in which the vehicle was returned. If the car has not yet been returned, Date_returned and Return_city are null. RENTCOSTMAKECOSTFORD30GM40NISSAN30T OYOTA20VOLVO50The RENTCOST table stores the rates pe day of each vehicle. The primary key of this table is MAKE, and it is a foreign key in the RENTALS table. create database AutoRentalsgouse AutoRentalsgocreate table Customer(CID integer, CName varchar(20),Age integer, Resid_City varchar(20),BirthPlace varchar(20),Constraint PK_Customer Primary Key (CID))insert Customerselect 1, 'Black', 40, 'Erie', 'Tampa'insert Customerselect 2, 'Green', 25, 'Cary', 'Erie'insert Customerselect 3, 'Jones', 30, 'Hemet', 'Tampa'insert Customerselect 4, 'Martin', 35, 'Hemet', 'Tampa'insert Customerselect 5, 'Simon', 22, 'Erie', 'Erie'insert Customerselect 6, 'Vernon', 60, 'Cary', 'Cary'insert Customerselect 7, 'Wilson', 25, 'Denver', 'Austin'create table Rentcost(Make varchar(20),Cost float, constraint PK_Rentcost Primary Key (Make))insert Rentcostselect 'Ford', 30insert Rentcostselect 'GM', 40insert Rentcostselect 'Nissan', 30insert Rentcostselect 'Toyota', 20insert Rentcostselect 'Volvo', 50Create table Rentals(Rtn integer, CID integer, Make varchar(20),Date_Out smalldatetime, Pickup varchar(20),Date_returned smalldatetime, Return_city varchar(20),Constraint PK_Rentals Primary Key (Rtn),Constraint FK_CustomerRentals Foreign Key (CID) References Customer, Constraint FK_RentCostRentals Foreign Key (Make) References Rentcost)insert Rentalsselect 1, 1, 'Ford', '10/10/2010', 'Cary', '10/12/2010', 'Cary'insert Rentalsselect 2, 1, 'GM', '11/1/2009', 'Tampa', '11/5/2009', 'Cary'insert Rentalsselect 3, 1, 'Ford', '1/1/2009', 'Erie', '1/10/2009', 'Erie'insert Rentalsselect 4, 2, 'Nissan', '11/7/2010', 'Tampa', null, nullinsert Rentalsselect 5, 3, 'Ford', '10/1/2010', 'Cary', '10/31/2010', 'Erie'insert Rentalsselect 6, 3, 'GM', '8/1/2009', 'Erie', '8/5/2009', 'Erie'insert Rentalsselect 7, 4, 'Ford', '8/1/2010', 'Cary', '8/12/2010', 'Erie'insert Rentalsselect 8, 5, 'GM', '9/1/2010', 'Erie', null, null

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
What does the level 1 topic in a word outline become in powerpoint? a. first-level bullet item b. slide title c. third-level bullet item d. second-level bullet item
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
You know the right answer?
Write and execute a single query that will isplay all of the information in the Customer, Rentals, a...
Questions
question
Mathematics, 27.02.2021 21:10
question
Mathematics, 27.02.2021 21:10
question
Mathematics, 27.02.2021 21:10
question
Mathematics, 27.02.2021 21:10
question
Mathematics, 27.02.2021 21:10
question
Mathematics, 27.02.2021 21:10
Questions on the website: 13722363