Description
-
INSTRUCTIONS
-
-
This lab is graded. Each question carries 2 marks. Maximum marks: 10
-
-
-
Download and install MySQL. If it is not possible to install MySQL on your laptop, install SQLite.
-
-
-
The data to be used are given to you.
-
-
QUESTIONS
Consider the following tables:
Student(snum: integer, sname: string, major: string, level:
string, age: integer)
Class(name: string, meets_at: time, room: string, fid: integer)
Enrolled(snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
The meaning of these tables is straightforward; for example, Enrolled has one record per student-class pair such that the student is enrolled in the class.
.
Write a program in any language you are familiar with that answers the following questions. You can write separate pro-grams or have the same program answer all the questions. For the questions below, you may be asked to replace the values “18”, “Database Systems” or “20” by other values.
-
Find the names and ages of all students.
-
Find all students whose age is above 18. (List their serial numbers, names, major, level and age).
-
Find the serial numbers of all students who have enrolled for “Database Systems”.
-
Find the names of all students who have enrolled for “Data-base Systems”.
-
Find the names of all faculty members who belong to the department “20”.