Create Time: 3rd Nov 2023
Title: "[[RDBMS-Assignment-1]]"
status: DONE
Author:
- AllenYGY
tags:
- DBM
- Assignment
created: 2023-11-03T00:59
updated: 2024-06-11T01:15
1.Find the major number of the student Eva:
SELECT major
FROM student
WHERE sname='Eva';
2.Find the name of the professors (instructors’ position) who are from the Computer Science department:
SELECT iname
FROM instructor
WHERE department='Computer Science';
3.Find the name of the professors (instructors’ position) who are from the Computer Science department:
SELECT cname
FROM course
WHERE credit=1;
4.Find the name of the students who have received an A in a course in semester 2023 Spring:
SELECT sname
FROM student, enroll
WHERE enroll.grade = 'A'
AND enroll.semester = '2023 Spring'
AND student.sID = enroll.sID;
5.Find the name of the courses which are instructed by Dave (instructor’s name):
SELECT cname
FROM course,instructor,teach
WHERE instructor.iname = 'Dave'
AND instructor.iID = teach.iID
AND teach.cID = course.cID;
6.Find the name of the instructors who have taught Frank (student’s name) in semester 2022 Fall:
SELECT iname
FROM instructor,student,teach,enroll
WHERE student.sname = 'Frank'
AND student.sID = enroll.sID
AND enroll.cID = teach.cID
AND teach.semester = '2022 Fall'
AND teach.iID = instructor.iID