Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What are the SQL queries for the following using this schema? Customer( CUSTID , CUSTNAME, ANNUALREVENUE, CUSTTYPE) Truck( TRUCK_NO , DRIVERNAME, SUPERVISOR) CITY( CITYID ,

What are the SQL queries for the following using this schema?

Customer(CUSTID, CUSTNAME, ANNUALREVENUE, CUSTTYPE)

Truck(TRUCK_NO, DRIVERNAME, SUPERVISOR)

CITY(CITYID, CITYNAME, POPULATION)

PACKAGE(SHIPMENT_NO, CUSTID, WEIGHT, TRUCK_NO, CITYID, SHIPDATE)

How many customers of each type have sent packages to each city? Your query should show the city name, the type of customer, and the number of that type of customer for each city shipped to. If cities have not received shipments, they should be in the list as well. Provide SQL and number of rows.

Which driver delivered the package that weighs the least? Your query should show the driver name (or names if tied) and the weight of the package. Provide SQL and name of the driver(s).

Which drivers have delivered more than the average number of packages carried by all drivers (who have carried packages, do not include drivers who have carried no packages)? Your query should show the driver name and the number of packages (over the average) that they have carried. Provide SQL and number of rows.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions