relational algebra

relational algebra - WHERE l.cid=c.cid and l.year=2001...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Study Problems on Relational Algebra Understand each of the following SQL query, and then translate it into relational algebra. Database schema: Courses (name, cid) Staff (sid, firstname, lastname) Lecturing (sid, cid, year) (1). SELECT FROM courses c, staff s, lecturing l WHERE l.sid=s.sid AND l.cid=c.cid AND (l.year=1999 OR l.year=2000) AND s.lastname='Jung'; (2). SELECT FROM lecturing l, courses c
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: WHERE l.cid=c.cid and l.year=2001 EXCEPT SELECT FROM lecturing l, courses c WHERE l.cid=c.cid AND (l.year=2000 OR l.year=1999); (3). SELECT FROM lecturing l1, lecturing l2, courses c WHERE l1.cid=l2.cid AND l1.cid=c.cid AND l1.sid=l2.sid AND l1.year=1999 AND l2.year=2000; (4). SELECT s.lastname FROM staff s WHERE s.sid NOT IN (SELECT l.sid FROM lecturing l);...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online