Question: SQL QUERY HELP PLEASE These queries use the Lorenzo Shipping Company database as shown in the figure below. Lorenzo Shipping Company is an over-the-road shipping

SQL QUERY HELP PLEASE

These queries use the Lorenzo Shipping Company database as shown in the figure below. Lorenzo Shipping Company is an over-the-road shipping company that moves heavy freight from city to city. Typical weights of a load are in the hundreds or thousands of pounds. The structure of the database is simple in order to facilitate understanding and writing of solution queries. Be sure that you understand the database structure before attempting to write the SQL queries.

The database consists of five tables: Customer, Shipment, Truck, Drive, and City. The key symbol indicates which attribute is the key field for the table. The relationship lines indicate foreign keys. Each customer can have many shipments, and each shipment is for a single customer. Each shipment is delivered by a single truck, but a truck will have many shipments. Each shipment is delivered by a single driver, but a driver can deliver many shipments. Each shipmant is to a particular city, but a city will have many shipments.

For each information request below, formulate a single SQL query to produce the required information. In each case, you should display only the columns requested. Be sure that your queries do not produce duplicate records unless otherwise directed.

How many different customer types are there in the database? Label the column Number_Types.

For each city what is the maximum weight of a shipment sent to that city? Use city_ID to identify each city. Label the maximum weight column as Max_Weight. (Hint: Use a group by.)

SQL QUERY HELP PLEASE These queries use the

Customer Truck Shipment ship_id cust_id truck_id cust name custid make model year annual revenue cust_type address weight truck id driver_id city_id ship_date Driver city On state zip driver_id first_name last_name address phone City city_id city_name city state state zip_code population phone area

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!