Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Quiestion 3 Customer. Emplayce contact = projedt Page 6 of 1 7 Consider the following three relations used in a moving truck rental database. (

Quiestion 3
Customer. Emplayce
contact = projedt
Page 6 of 17
Consider the following three relations used in a moving truck rental database.
(14 marks)
Marge
RENTAL_AGENT (name, age, salary)
CUSTOMER (name, pickup_city, dropoff_city, truck_size)
CONTRACT (number, cust_name, agent_name, amount_paid, truck_number)
Write SQL statements to answers the following questions.
a. Display the name of the oldest rental agent.
b. Display the names and ages of the agents who have rented trucks for customer "Chris
Auto" in descending order of age (use a subquery).
c. Display the ages of agents who have rented trucks for customer "Chris Auto" from
"Edmonton" (do not use a subquery)._empopels
d. Compute the number of different customers who have a rental contract. ?-
e. Display the names and salaries of all rental agents who did not rent trucks for customer
"Chris Auto", in ascending order of salary.
f. Compute the number of contracts for each agent. Consider only those contracts where the
amount paid exceeds $1000.
g. Display the names and salaries of all agents who have at least 10 rental contracts for truck
size "20 CU".
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions