Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Exercise Need Help to get answers 1-->List AVGcost, MINcost, MAXcost, and CNTcost for all repairs. Use AVG(), MAX(), MIN(), COUNT(*). 2-->List AVGcost, MINcost, MAXcost,

SQL Exercise Need Help to get answers

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

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

3-->List LastRepair for a repair that was supplied by SuplierID 1518. LastRepair is the last slRepair.RepairDate of a repair for a supplier

4-->List FirstRepair for a repair that was supplied by SupplierID 1504. FirstRepair is the first slRepair.RepairDate of a repair for a supplier

5-->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-->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-->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.

8-->How many distinct captians have piloted a trip? List CaptainCnt for all distinct values of slTrip.CaptainID.

Hint -->SELECT COUNT(DISTINCT attribute) AS Alias

9-->How many suppliers have supplied items for repairs? List SuppCnt for all distinct values of slRepair.SupplierID.

Hint-SELECT COUNT(DISTINCT attribute) AS Alias

image text in transcribed

sIMaintenance sIRepair Column Nme Data Type MaintenancelD int Column N.. Data Type RepairlD int RepairDate datetime RepairCost float Description varchan(500) SupplierlD int ShiplD Column Nae Data Type slGasPurchase slShip slPax Column N... Data Type Column Ne Data Type PadD Column Name Data Type PurchaseDte datetime MgYear int int PaxLastName varchar200 Gellons Model int slTrip Column Name Data Type slLaunch TriplD slSupplier Column Name Data Type LaunchlD Column Name Data Type CensusD Column Name ata Type SupplierID int int varchan 100) PaND int TripEngineEnd float aterTemp int slWayPoint sIFloatPlan Column Name Data Type WayPointD nt WayPoint vachar(250) Column Name Data Type FloatPlanlD TriplD WayPointID

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Discuss Ms. Lincolns level of commitment to occupational safety.

Answered: 1 week ago