Assignment SQL
Assignment SQL
A sample table is given from a database. Study it carefully and answer the
questions given.
2. Write a SQL statement to display flight number, date and departure time
for all the flights.
Select Flight_info From flight, date, depart
_________________________________________________________
_________________________________________________________
_________________________________________________________
CEMPAKA INTERNATIONAL SCHOOL, DAMANSARA HEIGHTS
Computer Science Assignment – SQL
3. Write a SQL statement to display the information of the flights which are
heading to London.
Select * From Flight_info where dest=“LON”
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
7. Write a SQL statement to display the information of the flights which are
flying for less than 2000 miles.
_________________________________________________________
Select * From Flight_info Where miles<2000
_________________________________________________________
_________________________________________________________
CEMPAKA INTERNATIONAL SCHOOL, DAMANSARA HEIGHTS
Computer Science Assignment – SQL
8. Display the origin and destination city of the flights departing at 7:10am.
_________________________________________________________
Select orig, dest From Flight_info Where depart = “7:10”
_________________________________________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
10. Display all the information of the flights where boarded column value is
more than 100.
_________________________________________________________
Select * From Flight_info Where boarded>100
_________________________________________________________
_________________________________________________________