Anzeige

Using the relations below- write relational algebra queries for the fo.docx

slyndon
4. Feb 2023
Using the relations below- write relational algebra queries for the fo.docx
Using the relations below- write relational algebra queries for the fo.docx
Nächste SlideShare
relations- Courses(cnum-title-credits)- Professors(pid-pname-dept)- Te.docxrelations- Courses(cnum-title-credits)- Professors(pid-pname-dept)- Te.docx
Wird geladen in ... 3
1 von 2
Anzeige

Más contenido relacionado

Similar a Using the relations below- write relational algebra queries for the fo.docx(20)

Más de slyndon(20)

Anzeige

Using the relations below- write relational algebra queries for the fo.docx

  1. Using the relations below, write relational algebra queries for the following. relations: Courses(cnum,title,credits), Professors(pid,pname,dept), Teaches(pid,cnum,semester) (a) Find the names and departments of professors who taught at least one course in Fall2011. (b) Find the titles of courses taught by the professors of Computer Science department. (c) Find the course numbers that were taught in Fall2011 but not in Spring2012. (d) Find the departments that have at least two professors. Solution create table courses cnum INT PRIMARY KEY, title VARCHAR(20) NOT NULL UNQUINE, credits INT NOT NULL create table professors pid INT PRIMARY KEY, pname VARCHAR(20) NOT NULL, dept VARCHAR(10) NOT NULL create table Teaches pid INT, cnum INT,
  2. semster VARCHAR(9), FOREIGNKEY(cnum) REFERENCE course (cnum) FOREIGNKEY (pid) REFERENCE professor (pid) COURSES: PROFESSORS: TEACHES: a) name,dept( dept="CS" (professorsteachescourses) b) title ( dept="CS" (professorscourses) c) T1 cnum ( semesterspring2012 (coursesteaches) T2 cnum ( semester=fall2011 (coursesteaches) T1-T2 d) (R1.professors) (R2.professors) R1.deptR1.dept=R2.pnameR1.pnameR2.pname(R1XR2) cnum title credits 11 database 3 21 java 3 31 CSI 2 41 network 2
Anzeige