SlideShare ist ein Scribd-Unternehmen logo
1 von 2
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,
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

Weitere ähnliche Inhalte

Ähnlich wie Relational algebra queries on course, professor, teaches relations

intro-slides.pdf very important for computer science students
intro-slides.pdf very important for computer science studentsintro-slides.pdf very important for computer science students
intro-slides.pdf very important for computer science studentssairevanth504
 
mongoDB Project: Relational databases & Document-Oriented databases
mongoDB Project: Relational databases & Document-Oriented databasesmongoDB Project: Relational databases & Document-Oriented databases
mongoDB Project: Relational databases & Document-Oriented databasesStratos Gounidellis
 
Cis 328 Extraordinary Success/newtonhelp.com
Cis 328 Extraordinary Success/newtonhelp.com  Cis 328 Extraordinary Success/newtonhelp.com
Cis 328 Extraordinary Success/newtonhelp.com amaranthbeg145
 
MongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databasesMongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databasesLamprini Koutsokera
 
CIS 328 Focus Dreams/newtonhelp.com
CIS 328 Focus Dreams/newtonhelp.comCIS 328 Focus Dreams/newtonhelp.com
CIS 328 Focus Dreams/newtonhelp.combellflower84
 
CIS 328 Life of the Mind/newtonhelp.com   
CIS 328 Life of the Mind/newtonhelp.com   CIS 328 Life of the Mind/newtonhelp.com   
CIS 328 Life of the Mind/newtonhelp.com   bellflower2
 
CIS 328 Imagine Your Future/newtonhelp.com   
CIS 328 Imagine Your Future/newtonhelp.com   CIS 328 Imagine Your Future/newtonhelp.com   
CIS 328 Imagine Your Future/newtonhelp.com   bellflower44
 
Cis 328 Success Begins / snaptutorial.com
Cis 328 Success Begins / snaptutorial.comCis 328 Success Begins / snaptutorial.com
Cis 328 Success Begins / snaptutorial.comRobinson069
 
Cis 328Believe Possibilities / snaptutorial.com
Cis 328Believe Possibilities / snaptutorial.comCis 328Believe Possibilities / snaptutorial.com
Cis 328Believe Possibilities / snaptutorial.comStokesCope11
 
Cis 328 Effective Communication - snaptutorial.com
Cis 328  Effective Communication - snaptutorial.comCis 328  Effective Communication - snaptutorial.com
Cis 328 Effective Communication - snaptutorial.comHarrisGeorg11
 
Cis 328 Education Specialist -snaptutorial.com
Cis 328   Education Specialist -snaptutorial.comCis 328   Education Specialist -snaptutorial.com
Cis 328 Education Specialist -snaptutorial.comDavisMurphyC36
 
cis 328 Education Organization - snaptutorial.com
cis 328  Education Organization - snaptutorial.comcis 328  Education Organization - snaptutorial.com
cis 328 Education Organization - snaptutorial.comdonaldzs180
 
Cis 328 Enhance teaching-snaptutorial.com
Cis 328 Enhance teaching-snaptutorial.comCis 328 Enhance teaching-snaptutorial.com
Cis 328 Enhance teaching-snaptutorial.comrobertleew8
 
Cis 328 Exceptional Education / snaptutorial.com
Cis 328   Exceptional Education / snaptutorial.comCis 328   Exceptional Education / snaptutorial.com
Cis 328 Exceptional Education / snaptutorial.comBaileya45
 
Finite Geometric Series dlp
Finite Geometric Series dlpFinite Geometric Series dlp
Finite Geometric Series dlpRichard Paulino
 
R Programming language model test paper
R Programming language model test paperR Programming language model test paper
R Programming language model test paperLuckshay Batra
 
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21chinthala Vijaya Kumar
 

Ähnlich wie Relational algebra queries on course, professor, teaches relations (20)

intro-slides.pdf very important for computer science students
intro-slides.pdf very important for computer science studentsintro-slides.pdf very important for computer science students
intro-slides.pdf very important for computer science students
 
mongoDB Project: Relational databases & Document-Oriented databases
mongoDB Project: Relational databases & Document-Oriented databasesmongoDB Project: Relational databases & Document-Oriented databases
mongoDB Project: Relational databases & Document-Oriented databases
 
Assignment2
Assignment2Assignment2
Assignment2
 
Cis 328 Extraordinary Success/newtonhelp.com
Cis 328 Extraordinary Success/newtonhelp.com  Cis 328 Extraordinary Success/newtonhelp.com
Cis 328 Extraordinary Success/newtonhelp.com
 
MongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databasesMongoDB Project: Relational databases to Document-Oriented databases
MongoDB Project: Relational databases to Document-Oriented databases
 
CIS 328 Focus Dreams/newtonhelp.com
CIS 328 Focus Dreams/newtonhelp.comCIS 328 Focus Dreams/newtonhelp.com
CIS 328 Focus Dreams/newtonhelp.com
 
CIS 328 Life of the Mind/newtonhelp.com   
CIS 328 Life of the Mind/newtonhelp.com   CIS 328 Life of the Mind/newtonhelp.com   
CIS 328 Life of the Mind/newtonhelp.com   
 
CIS 328 Imagine Your Future/newtonhelp.com   
CIS 328 Imagine Your Future/newtonhelp.com   CIS 328 Imagine Your Future/newtonhelp.com   
CIS 328 Imagine Your Future/newtonhelp.com   
 
Cis 328 Success Begins / snaptutorial.com
Cis 328 Success Begins / snaptutorial.comCis 328 Success Begins / snaptutorial.com
Cis 328 Success Begins / snaptutorial.com
 
Cis 328Believe Possibilities / snaptutorial.com
Cis 328Believe Possibilities / snaptutorial.comCis 328Believe Possibilities / snaptutorial.com
Cis 328Believe Possibilities / snaptutorial.com
 
Cis 328 Effective Communication - snaptutorial.com
Cis 328  Effective Communication - snaptutorial.comCis 328  Effective Communication - snaptutorial.com
Cis 328 Effective Communication - snaptutorial.com
 
Cis 328 Education Specialist -snaptutorial.com
Cis 328   Education Specialist -snaptutorial.comCis 328   Education Specialist -snaptutorial.com
Cis 328 Education Specialist -snaptutorial.com
 
cis 328 Education Organization - snaptutorial.com
cis 328  Education Organization - snaptutorial.comcis 328  Education Organization - snaptutorial.com
cis 328 Education Organization - snaptutorial.com
 
Cis 328 Enhance teaching-snaptutorial.com
Cis 328 Enhance teaching-snaptutorial.comCis 328 Enhance teaching-snaptutorial.com
Cis 328 Enhance teaching-snaptutorial.com
 
Cis 328 Exceptional Education / snaptutorial.com
Cis 328   Exceptional Education / snaptutorial.comCis 328   Exceptional Education / snaptutorial.com
Cis 328 Exceptional Education / snaptutorial.com
 
Finite Geometric Series dlp
Finite Geometric Series dlpFinite Geometric Series dlp
Finite Geometric Series dlp
 
R Programming language model test paper
R Programming language model test paperR Programming language model test paper
R Programming language model test paper
 
Gate-Cs 1995
Gate-Cs 1995Gate-Cs 1995
Gate-Cs 1995
 
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
 
3D Represent.docx
3D Represent.docx3D Represent.docx
3D Represent.docx
 

Mehr von slyndon

Use the Referraces to acce inportant val In the following net ionic eq.docx
Use the Referraces to acce inportant val In the following net ionic eq.docxUse the Referraces to acce inportant val In the following net ionic eq.docx
Use the Referraces to acce inportant val In the following net ionic eq.docxslyndon
 
Use the References to access importantv It is often possible to change.docx
Use the References to access importantv It is often possible to change.docxUse the References to access importantv It is often possible to change.docx
Use the References to access importantv It is often possible to change.docxslyndon
 
Use the following financial statements for Lake of Egypt Marina- Inc-.docx
Use the following financial statements for Lake of Egypt Marina- Inc-.docxUse the following financial statements for Lake of Egypt Marina- Inc-.docx
Use the following financial statements for Lake of Egypt Marina- Inc-.docxslyndon
 
Use SQL to Create a table with at least 4 attributes one of which is t.docx
Use SQL to Create a table with at least 4 attributes one of which is t.docxUse SQL to Create a table with at least 4 attributes one of which is t.docx
Use SQL to Create a table with at least 4 attributes one of which is t.docxslyndon
 
Using your own words and one complete sentence per term- define the fo.docx
Using your own words and one complete sentence per term- define the fo.docxUsing your own words and one complete sentence per term- define the fo.docx
Using your own words and one complete sentence per term- define the fo.docxslyndon
 
Using the method of 1-2 reactions balance the skeleton equation- I2 +.docx
Using the method of 1-2 reactions balance the skeleton equation- I2 +.docxUsing the method of 1-2 reactions balance the skeleton equation- I2 +.docx
Using the method of 1-2 reactions balance the skeleton equation- I2 +.docxslyndon
 
Using the descriptions of the attributes given in the ERD below- provi.docx
Using the descriptions of the attributes given in the ERD below- provi.docxUsing the descriptions of the attributes given in the ERD below- provi.docx
Using the descriptions of the attributes given in the ERD below- provi.docxslyndon
 
Using the following definition for a Binary Tree Node - complete the f.docx
Using the following definition for a Binary Tree Node - complete the f.docxUsing the following definition for a Binary Tree Node - complete the f.docx
Using the following definition for a Binary Tree Node - complete the f.docxslyndon
 
using the concepts of bonding and polarity explaining the importance o.docx
using the concepts of bonding and polarity explaining the importance o.docxusing the concepts of bonding and polarity explaining the importance o.docx
using the concepts of bonding and polarity explaining the importance o.docxslyndon
 
Using the competing values framework as a point of reference- how woul.docx
Using the competing values framework as a point of reference- how woul.docxUsing the competing values framework as a point of reference- how woul.docx
Using the competing values framework as a point of reference- how woul.docxslyndon
 
Using jsfiddle-net In Javascript we are going to create a doubly Linke.docx
Using jsfiddle-net In Javascript we are going to create a doubly Linke.docxUsing jsfiddle-net In Javascript we are going to create a doubly Linke.docx
Using jsfiddle-net In Javascript we are going to create a doubly Linke.docxslyndon
 
Using Haskell- I need- -- - Produce a list where sequences of repeated.docx
Using Haskell- I need- -- - Produce a list where sequences of repeated.docxUsing Haskell- I need- -- - Produce a list where sequences of repeated.docx
Using Haskell- I need- -- - Produce a list where sequences of repeated.docxslyndon
 
Using Java- Windows on the desktop are just one of many objects used i.docx
Using Java- Windows on the desktop are just one of many objects used i.docxUsing Java- Windows on the desktop are just one of many objects used i.docx
Using Java- Windows on the desktop are just one of many objects used i.docxslyndon
 
Using examples describe five major reasons for segregation of duties w.docx
Using examples describe five major reasons for segregation of duties w.docxUsing examples describe five major reasons for segregation of duties w.docx
Using examples describe five major reasons for segregation of duties w.docxslyndon
 
Using Java- Evaluate the expression- Be sure to list a value of approp.docx
Using Java- Evaluate the expression- Be sure to list a value of approp.docxUsing Java- Evaluate the expression- Be sure to list a value of approp.docx
Using Java- Evaluate the expression- Be sure to list a value of approp.docxslyndon
 
Using Java- code a dynamic Linear Quotient Hashing data structure that.docx
Using Java- code a dynamic Linear Quotient Hashing data structure that.docxUsing Java- code a dynamic Linear Quotient Hashing data structure that.docx
Using Java- code a dynamic Linear Quotient Hashing data structure that.docxslyndon
 
using C++ to Write a program to demonstrate an array of 10 elements an.docx
using C++ to Write a program to demonstrate an array of 10 elements an.docxusing C++ to Write a program to demonstrate an array of 10 elements an.docx
using C++ to Write a program to demonstrate an array of 10 elements an.docxslyndon
 
Using complete sentences- briefly answer the following- A) Accurately.docx
Using complete sentences- briefly answer the following- A) Accurately.docxUsing complete sentences- briefly answer the following- A) Accurately.docx
Using complete sentences- briefly answer the following- A) Accurately.docxslyndon
 
Using a practical example- what are the benefits and potential problem.docx
Using a practical example- what are the benefits and potential problem.docxUsing a practical example- what are the benefits and potential problem.docx
Using a practical example- what are the benefits and potential problem.docxslyndon
 
User Interface Engneering A company is designing a kiosk that can disp.docx
User Interface Engneering A company is designing a kiosk that can disp.docxUser Interface Engneering A company is designing a kiosk that can disp.docx
User Interface Engneering A company is designing a kiosk that can disp.docxslyndon
 

Mehr von slyndon (20)

Use the Referraces to acce inportant val In the following net ionic eq.docx
Use the Referraces to acce inportant val In the following net ionic eq.docxUse the Referraces to acce inportant val In the following net ionic eq.docx
Use the Referraces to acce inportant val In the following net ionic eq.docx
 
Use the References to access importantv It is often possible to change.docx
Use the References to access importantv It is often possible to change.docxUse the References to access importantv It is often possible to change.docx
Use the References to access importantv It is often possible to change.docx
 
Use the following financial statements for Lake of Egypt Marina- Inc-.docx
Use the following financial statements for Lake of Egypt Marina- Inc-.docxUse the following financial statements for Lake of Egypt Marina- Inc-.docx
Use the following financial statements for Lake of Egypt Marina- Inc-.docx
 
Use SQL to Create a table with at least 4 attributes one of which is t.docx
Use SQL to Create a table with at least 4 attributes one of which is t.docxUse SQL to Create a table with at least 4 attributes one of which is t.docx
Use SQL to Create a table with at least 4 attributes one of which is t.docx
 
Using your own words and one complete sentence per term- define the fo.docx
Using your own words and one complete sentence per term- define the fo.docxUsing your own words and one complete sentence per term- define the fo.docx
Using your own words and one complete sentence per term- define the fo.docx
 
Using the method of 1-2 reactions balance the skeleton equation- I2 +.docx
Using the method of 1-2 reactions balance the skeleton equation- I2 +.docxUsing the method of 1-2 reactions balance the skeleton equation- I2 +.docx
Using the method of 1-2 reactions balance the skeleton equation- I2 +.docx
 
Using the descriptions of the attributes given in the ERD below- provi.docx
Using the descriptions of the attributes given in the ERD below- provi.docxUsing the descriptions of the attributes given in the ERD below- provi.docx
Using the descriptions of the attributes given in the ERD below- provi.docx
 
Using the following definition for a Binary Tree Node - complete the f.docx
Using the following definition for a Binary Tree Node - complete the f.docxUsing the following definition for a Binary Tree Node - complete the f.docx
Using the following definition for a Binary Tree Node - complete the f.docx
 
using the concepts of bonding and polarity explaining the importance o.docx
using the concepts of bonding and polarity explaining the importance o.docxusing the concepts of bonding and polarity explaining the importance o.docx
using the concepts of bonding and polarity explaining the importance o.docx
 
Using the competing values framework as a point of reference- how woul.docx
Using the competing values framework as a point of reference- how woul.docxUsing the competing values framework as a point of reference- how woul.docx
Using the competing values framework as a point of reference- how woul.docx
 
Using jsfiddle-net In Javascript we are going to create a doubly Linke.docx
Using jsfiddle-net In Javascript we are going to create a doubly Linke.docxUsing jsfiddle-net In Javascript we are going to create a doubly Linke.docx
Using jsfiddle-net In Javascript we are going to create a doubly Linke.docx
 
Using Haskell- I need- -- - Produce a list where sequences of repeated.docx
Using Haskell- I need- -- - Produce a list where sequences of repeated.docxUsing Haskell- I need- -- - Produce a list where sequences of repeated.docx
Using Haskell- I need- -- - Produce a list where sequences of repeated.docx
 
Using Java- Windows on the desktop are just one of many objects used i.docx
Using Java- Windows on the desktop are just one of many objects used i.docxUsing Java- Windows on the desktop are just one of many objects used i.docx
Using Java- Windows on the desktop are just one of many objects used i.docx
 
Using examples describe five major reasons for segregation of duties w.docx
Using examples describe five major reasons for segregation of duties w.docxUsing examples describe five major reasons for segregation of duties w.docx
Using examples describe five major reasons for segregation of duties w.docx
 
Using Java- Evaluate the expression- Be sure to list a value of approp.docx
Using Java- Evaluate the expression- Be sure to list a value of approp.docxUsing Java- Evaluate the expression- Be sure to list a value of approp.docx
Using Java- Evaluate the expression- Be sure to list a value of approp.docx
 
Using Java- code a dynamic Linear Quotient Hashing data structure that.docx
Using Java- code a dynamic Linear Quotient Hashing data structure that.docxUsing Java- code a dynamic Linear Quotient Hashing data structure that.docx
Using Java- code a dynamic Linear Quotient Hashing data structure that.docx
 
using C++ to Write a program to demonstrate an array of 10 elements an.docx
using C++ to Write a program to demonstrate an array of 10 elements an.docxusing C++ to Write a program to demonstrate an array of 10 elements an.docx
using C++ to Write a program to demonstrate an array of 10 elements an.docx
 
Using complete sentences- briefly answer the following- A) Accurately.docx
Using complete sentences- briefly answer the following- A) Accurately.docxUsing complete sentences- briefly answer the following- A) Accurately.docx
Using complete sentences- briefly answer the following- A) Accurately.docx
 
Using a practical example- what are the benefits and potential problem.docx
Using a practical example- what are the benefits and potential problem.docxUsing a practical example- what are the benefits and potential problem.docx
Using a practical example- what are the benefits and potential problem.docx
 
User Interface Engneering A company is designing a kiosk that can disp.docx
User Interface Engneering A company is designing a kiosk that can disp.docxUser Interface Engneering A company is designing a kiosk that can disp.docx
User Interface Engneering A company is designing a kiosk that can disp.docx
 

Kürzlich hochgeladen

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...MerlizValdezGeronimo
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 

Kürzlich hochgeladen (20)

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
IPCRF/RPMS 2024 Classroom Observation tool is your access to the new performa...
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 

Relational algebra queries on course, professor, teaches relations

  • 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