me CHAR(20), meets atTIME, room CHAR(10), fid INTEGER, PRIMARY KEY (name), FOREIGN KEY (fid) REFERENCES Faculty) CREATE TABLE Enrolled ( snum INTEGER, cname CHAR(20), PRIMARY KEY (snum, cname), FOREIGN KEY (snum) REFERENCES Student), FOREIGN KEY (cname) REFERENCES Class) 1. Find the names of all juniors (Level = JR) who
Given the following
CREATE TABLE Student ( snum INTEGER, sname CHAR(20), major CHAR(20),
level CHAR(20), age INTEGER, PRIMARY KEY (snum))
CREATE TABLE Faculty ( fid INTEGER, fname CHAR(20), deptid INTEGER,
PRIMARY KEY (fnum))
CREATE TABLE Class ( name CHAR(20), meets atTIME, room CHAR(10), fid INTEGER, PRIMARY KEY (name), FOREIGN KEY (fid) REFERENCES Faculty)
CREATE TABLE Enrolled ( snum INTEGER, cname CHAR(20), PRIMARY KEY (snum, cname), FOREIGN KEY (snum) REFERENCES Student), FOREIGN KEY (cname) REFERENCES Class)
1. Find the names of all juniors (Level = JR) who are either enrolled or not in a class taught by ‘Ivana Teach’.
2. Find the names of faculty members that either teach to class ‘database systems’ or not.
Write these queries in SQL join Clauses
Trending now
This is a popular solution!
Step by step
Solved in 2 steps