I've got 2 questions, I cannot seem to find a solution for. The assignment I'm trying to do says:
View the following pattern to answer the questions:
Student (RegisterNr, Name, Semester)
Lecture (LectureNr, Title, PersNr)
Professor (PersNr, Name)
listening (RegisterNr, LectureNr)
Express the following queries in SQL:
- Write a list of participants (RegisterNr) from Students who are listening to a lecture of Professor "J.Smith". The issued table should have the headline "Participants"
So far I'm stuck somewhere around this:
CREATE TABLE Participants (
RegisterNr INTEGER,
SELECT RegisterNr,
FROM listening, Lecture,
WHERE
Though, I guess even what I have there is already not that right.
- Solve with a subquery:
Which students (Name, RegisterNr) in the third semester are not attending a lecture from the professor with the PersNr 987?
Here I have absolutely no clue, since I don't remember how to write negative conditions like "does not listen to" anymore.
Can someone help me out please?
Comments
Post a Comment