Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Exercise Need help to get the answer 1-->List slPax.PaxID, slPax.PaxFirstName, and slPax.PaxLastName for passengers who do not have a lastname. Order the list by

SQL Exercise Need help to get the answer

1-->List slPax.PaxID, slPax.PaxFirstName, and slPax.PaxLastName for passengers who do not have a lastname. Order the list by slPax.PaxID in ascending order.

2-->List slMaintenance.MaintenanceID, slMaintenance.MaintenanceCost, slMaintenance.Description for maintenance items that do not have a cost. Order the list by slMaintenance.MaintenanceID in ascending order.

3-->List slMaintenance.MaintenanceID, slMaintenance.MaintenanceCost, slMaintenance.Description for all maintenance items. Replace NULL values in MaintenanceCost with 0. Order the list by slMaintenance.MaintenanceID in ascending order.

4-->List slGearPurchase.GearPurchaseID, slGearPurchase.PurchaseAmount, slGearPurchase.Description for gear purchases that do not have a description. Order the list by slGearPurchase.GearPurchaseID in ascending order.

5-->List slGearPurchase.GearPurchaseID, slGearPurchase.PurchaseAmount, slGearPurchase.Description for all gear purchases. Replace NULL values in Description with NA (Not Applicable). Order the list by slGearPurchase.GearPurchaseID in ascending order.

6-->For repairs having supplierID 1501 OR 1517 OR 1518, list slRepair.RepairDate, slRepair.RepairCost, slRepair.SupplierID. Write this query using IN(). Order the list first by SupplierID in ascending order and then by repair cost in descending order.

7-->List slPax.PaxID, slPax.PaxFirstName, and slPax.PaxLastName for passengers with lastname Clark OR Sharma OR Patel. Write this query using IN(). Order the list by PaxID in ascending order.

8-->List slSupplier.SupplierID and slSupplier.SupplierName for suppliers whose SupplierID is unequal to 1502 AND 1506 AND 1510 AND 1512 AND 1518. Order the list by slSupplier.SupplierID in ascending order.

9-->List slTrip.TripID, slTrip.LaunchID, and slTrip.WaterTemp for trips where the (Launch ID is not equal to 2 AND 3 AND 7 AND 8 AND 12) and the (WaterTemp is greater than 70). Write the query using NOT IN(). Order the list first by slTrip.LaunchID in ascending order and then by slTrip.WaterTemp in descending order

10-->Assume we want to analyze a pattern in gear purchases. Part of the pattern analysis is listing all purchases with purchase amounts that are a multiple of 10 where the amount is rounded to the nearest dollar amount. List slGearPurchase.GearPurchaseID, slGearPurchase.PurchaseAmount, AmountRounded, and slGearPurchase.Description where the rounded purchase amount is a multiple of 10. The attribute AmountRounded is produced using the ROUND() function. Write the WHERE clause using ROUND() IN() for rounded amounts that are equal to 10,20,30,...100. Order the list by slGearPurhcase.PurchaseAmount in ascending order.

SCHEMA-->

image text in transcribed

lMaintenance Column Name sIRepair slGearPurchase Column Name Data Type Column N...Data Type Data Type 17 RepairlD int MaintenanceDate datetime MaintenanceCost float Description SupplierlD ShiplD RepairDate datetime RepairCost float Description varchar(500) SupplielD int ShipD int sIShip slPax PurchaseDst deetime PurchaseAmount float slGasPurchase Column N... Data Type ShiplD int MfgYear int Make varchar(100) Modelvarchar 100) Column Name Data Type GasPurchaseID int Column Name Data Type 7 PaxdDint archar(500) PaxFirstName varchar(200) PaxLastName archar(200) SupplielD nt ShiplD PurchaseDate datetime Gallons float ShiplD Column Name TriplD TripStart TripEnd Data Type slLaunch sICensus slSupplier Column Name Data Type LaunchiD int Launchvaha(100) Column Name Data Type CensudlDi Column Name Data Type SupplierlD int TripEngineStart float TripEngineEnd float CaptainiDint sWayPoint Column Name Data Type WayPointD WayPoint varcharl250) sIFloatPlan Column Na Data Type nt FloatPlaniD int TriplD WayPointID int WayPointOrder int

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