1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivanshal [37]
3 years ago
3

Write and execute a single query that will isplay all of the information in the Customer, Rentals, and Rentcost tables in a sing

le 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_CityBirthPlace1BLACK40ERIETAMPA2GREEN25CARYERIE3JONES30HEMETTAMPA4MARTIN35HEMETTAMPA5SIMON22ERIEERIE6VERNON60CARYCARY7WILSON25DENVERAUSTINIn the CUSTOMER table, CName is the primary key.RENTALSRtnCIDMakeDate_OutPickupDate_returnedReturn_city11FORD10-Oct-2010CARY12-Oct-2010CARY21GM01-Nov-2009TAMPA05-Nov-2009CARY31FORD01-Jan-2009ERIE10-Jan-2009ERIE42NISSAN07-Nov-2010TAMPA53FORD01-Oct-2010CARY31-Oct-2010ERIE63GM01-Aug-2009ERIE05-Aug-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.RENTCOSTMAKECOSTFORD30GM40NISSAN30TOYOTA20VOLVO50The 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
Computers and Technology
1 answer:
qwelly [4]3 years ago
4 0

Answer:

SELECT DISTINCT Customer.CID , Customer.CName , Customer.Age , Customer.Resid_City , Customer.BirthPlace , Rentals.Rtn, Rentals.data_out. Rentals.pickup, Rentals.data_returned, Rental.return_city, RentCost.make, RentCost.cost

   FROM Customer

   JOIN Rentals ON Customer.CID = Rentals.CID

   JOIN RentCost ON Rentals.make = RentCost.make.

   ORDER BY Customer.CID AND RentCost.make

Explanation:

The returned output is a 12-field table, in ascending order of the customer's id and the make of the car rented.

You might be interested in
Alice is an investor who has created a device controlled by an app that will water plants automatically. Alice has no experience
oksian1 [2.3K]

Answer:

3rd one

Explanation:

took test

5 0
3 years ago
Task 2
adelina 88 [10]

The program is an illustration of file manipulations

<h3>What are file manipulations?</h3>

File manipulations are program statements that are used to write & append to file, and also read from the file

<h3>The actual program in Python</h3>

Assume the file name is top10.txt, the program in Python where comments are used to explain each line is as follows:

#This opens the file

a_file = open("top10.txt")

#This reads the file contents

file_contents = a_file.read()

#This prints the contents

print(file_contents)

Read more about file manipulations at:

brainly.com/question/15683939

3 0
2 years ago
I WILL MARK BRAINLEST
mezya [45]

Answer: I think its the last one, there is often more than one right choice :)

5 0
3 years ago
What effect can camera tilt create? Do you think this is effective? Why or why not?
Naily [24]
<span>Camera tilt can help you capture more of your subject in vertical terms, this can be effective when you do portraits, but sometimes ineffective when doing landscape.

Hope this helps!</span>
7 0
3 years ago
Read 2 more answers
1) These are operators that add and subtract one from their operands.
adoni [48]

Answer:

1) B (++ and --)

2) A (1 2 3 4 5)

Explanation:

In the first question, the operators ++ and -- are used in almost all programming languages for adding  and subtracting  1 respectively from an operand.

In the second question using a while statement the numbers 1-5 is printed out because the variable n=1 is increased by 1 after each iteration.

7 0
3 years ago
Other questions:
  • âwhen the footer is the last element in a page body, the _____ pseudo-element is used to add a placeholder element after the foo
    8·2 answers
  • The internet is a worldwide assembly of computer
    11·1 answer
  • Podcast ____ software uses rss to allow you to subscribe to your favorite podcasts from one central application.
    12·2 answers
  • How to transfer photos from iphone to iphone?
    14·2 answers
  • Pick the JavaScript code for the following pseudocode. If age &gt;= 65 Then discountRate = 0.10 End If Group of answer choices
    12·1 answer
  • When do we use SAVE and SAVE AS in saving artwork in adobe illustrator?<br> PLEASE HELP ASAP
    11·1 answer
  • Why is time zone an important factor affecting when communicating
    14·1 answer
  • I need help with this question!
    11·1 answer
  • Business Rules constraints falls into two categories:
    7·1 answer
  • Is Aerospace Engineering a more enjoyable major than Computer Engineering?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!