SQL TS Final
SQL TS Final
Exercise 1: (5pts)
Observe the given Table TEACHER and give the output of question (i) and (ii)
Exercice2: (15pts)
Giving the following tables concerning a grading system in a university:
Questions:
Formulate in SQL the following queries:
a) Create the tables Student,Course and Class indicating the primary key, the foreign key(s) and
the constraints.
b) Add the column "NumberOfCredits" to the table “Course”, the NumberOfCredits is between 3
and 9 credits.
c) Add a new student with the following information: (1000, Joe Smith, 15/8/2000, 70/123456, A+,
Saida, 12), knowing that 12 is the class number for the class “TS2 Info” in faculty “Business”
which is not inserted yet in the database.
d) Modify the phone number to 03/112233 for the student having the number 1005.
e) Remove all records from the table “Examination”.
f) Display, in alphabetic order, a list of students (number, name) who belong to the faculty
“Engineering”.
g) Display the professor full name having the highest number of examinations.
h) Display a list of students (name, phone) who have an age less than 18 years and have a grade
greater than 15 for the course “Data Base” during the year 2014.
Good luck☺