Consider the following database schema, defined in SQL.
Drop table courseSelection;
Drop table course;
Drop table student;
Drop table teacher;
CREATE TABLE Teacher(teacherId int,
teacherName varchar(20),
PRIMARY KEY (teacherId));
CREATE TABLE student(studentId int,
studentName varchar(10),
gender char(1),
age int,
birthDate date,
teacherId int,
PRIMARY KEY(studentId),
FOREIGN KEY (teacherId) REFERENCES Teacher(teacherId));
CREATE TABLE course (courseId int,
courseName varchar(30),
teacherId int,
PRIMARY KEY (courseId),
FOREIGN KEY (teacherId) REFERENCES Teacher(teacherId));
CREATE TABLE courseSelection (courseSelectionId int,
studentId int,
courseId int,
PRIMARY KEY(courseSelectionId),
FOREIGN KEY (studentId) REFERENCES Student(studentId),
FOREIGN KEY (courseId) REFERENCES Course(courseId));
Based on the database schema described above, express the following natural language queries in SQL.
1. Find all courses (courseId,courseName, teacherName) that ‘Michael Smith’ has selected. 12%
2. Find the course (courseId,courseName) teached by ‘Mike’ and ‘Michael Smith’ selected. 12%
3. Find all courses (courseId,courseName) that ‘Michael Smith’ has not selected . 12%