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 02:00
The word ‘play’ comes with many different interpretations and a variety of definitions. discuss some of the various meanings tied to the word play. why is the concept of play thought to be an important addition to the workplace? do some (brief) research online and give an example of how play in the workplace is being done right.
Answers: 2
question
Computers and Technology, 22.06.2019 03:40
Hello my name is mihai and i need your : )i have to do a python project in computer science and i’m really busy with my mocks this period of time besides this i’m not good at coding so could someone pls pls pls sort me out ? i actually beg ; ))
Answers: 1
question
Computers and Technology, 22.06.2019 10:50
Using least squares fitting, you are to fit the data sets to the following models and solve for the parameters ai , where i is the index of the parameter. the input/output data for the systems are linked in the bblearn site. for each of the systems use matlab to plot the supplied data vs. the model fit on one plot. include your code in the solutions. (a) linear fit "lineardata.mat" y=a1x^3 + a2x^2 + a3x + a4 (b) plant fit "plantdata.mat g(s) = a1/(s + a2)
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
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, 12.02.2021 01:10
question
Mathematics, 12.02.2021 01:10
Questions on the website: 13722360