CEMPAKA INTERNATIONAL SCHOOL, DAMANSARA HEIGHTS
Computer Science Assignment – SQL
A sample table is given from a database. Study it carefully and answer the
questions given.
Table name –> Flight_info
1. Write a SQL statement to display all the information of all flights.
Select * From Flight_info
___________________________________________________________
___________________________________________________________
___________________________________________________________
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”
_________________________________________________________
_________________________________________________________
_________________________________________________________
4. Write a SQL statement to display all the information of flight number
202.
Select * From Flight_info where flight = 202
_________________________________________________________
_________________________________________________________
_________________________________________________________
5. Write a SQL statement to display flight number, departure time, origin
and destination which has capacity more than 200 passengers.
_________________________________________________________
Select flight, depart, orig, dest From Flight_info Where capacity>200
_________________________________________________________
_________________________________________________________
6. Write a SQL statement to display flight number, departure time, origin
and destination of the flights on 01Mar08.
Select flight, depart, orig, dest From Flight_info Where date = “01Mar08”
_________________________________________________________
_________________________________________________________
_________________________________________________________
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”
_________________________________________________________
_________________________________________________________
9. Display all the information of the flights arriving at France.
_________________________________________________________
Select * From Flight_info Where dest=“FRA”
_________________________________________________________
_________________________________________________________
10. Display all the information of the flights where boarded column value is
more than 100.
_________________________________________________________
Select * From Flight_info Where boarded>100
_________________________________________________________
_________________________________________________________