O'Reilly logo

SQL in 24 Hours, Sams Teach Yourself, Sixth Edition by Ron Plew, Arie D. Jones, Ryan Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix D. Bonus Exercises

The exercises in this appendix are bonus exercises that are specific to SQL Server. This appendix provides an explanation or question and then provides sample Microsoft SQL Server-based SQL code to execute. Remember that the SQL code can vary from implementation to implementation; therefore, some of these statements need to be adjusted depending on the system you work on. Study the question, code, and results carefully to improve your knowledge of SQL.

1. Determine the aircraft that is used the most.

SELECT TOP 1 A.AIRCRAFTTYPE, COUNT(*) AS TIMESUSED FROM AIRCRAFT A INNER JOIN AIRCRAFTFLEET AF ON A.AIRCRAFTCODE = AF.AIRCRAFTCODE INNER JOIN FLIGHTS F ON AF.AIRCRAFTFLEETID = F.AIRCRAFTFLEETID ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required