Question: AGGREGATE FUNCTIONS : EXAMPLE How many maintenance items have NULL values for slMaintenance.MaintenanceCost? List NullCnt for all maintenance items where NullCnt is the number of

AGGREGATE FUNCTIONS :

EXAMPLE

How many maintenance items have NULL values for slMaintenance.MaintenanceCost? List NullCnt for all maintenance items where NullCnt is the number of rows having NULL for slMaintenance.MaintenanceCost.

ANSWER : SELECT COUNT (*) AS NULLCNT FROM slMaintenance WHERE slMaintenance.MaintenanceCost is NULL

NEED HELP WITH 1-8

1) Schema : CostStats

List AVGcost, MINcost, MAXcost, and CNTcost for all repairs. Use AVG(), MAX(), MIN(), COUNT(*).

2) Schema : Stats1518 List AVGcost, MINcost, MAXcost, and CNTcost for repairs for SupplierID 1518. Use AVG(), MAX(), MIN(), COUNT(*).

3) Schema : Last1518 List LastRepair for a repair that was supplied by SuplierID 1518. LastRepair is the last slRepair.RepairDate of a repair for a supplier.

4) Schema : First1504 List FirstRepair for a repair that was supplied by SupplierID 1504. FirstRepair is the first slRepair.RepairDate of a repair for a supplier.

5) Schema : TripCnt75 List TripCnt for all trips where slTrip.WaterTemp is greater than 75 and the trip launched from slTrip.LaunchID 2 or 7 or 8.

6) Schema : MaxCold List MaxTripHour for all trips where slTrip.WaterTemp is less than 65 and the trip launched from slTrip.LaunchID 2. MaxTripHour is the maximum of slTrip.TripHour which is the duration of the trip in hours.

7) Schema : CaptainCnt How many distinct captians have piloted a trip? List CaptainCnt for all distinct values of slTrip.CaptainID.

8) Schema : SuppRepCnt How many suppliers have supplied items for repairs? List SuppCnt for all distinct values of slRepair.SupplierID.

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 Databases Questions!