0% found this document useful (0 votes)
4 views3 pages

Assignment SQL

The document is a Computer Science assignment from Cempaka International School focusing on SQL queries related to a sample table named Flight_info. It contains ten questions that require writing SQL statements to retrieve various flight-related data based on specific criteria. The queries involve displaying all flight information, filtering by destination, date, capacity, and other attributes.

Uploaded by

zivenlooi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Assignment SQL

The document is a Computer Science assignment from Cempaka International School focusing on SQL queries related to a sample table named Flight_info. It contains ten questions that require writing SQL statements to retrieve various flight-related data based on specific criteria. The queries involve displaying all flight information, filtering by destination, date, capacity, and other attributes.

Uploaded by

zivenlooi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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

_________________________________________________________

_________________________________________________________

You might also like