Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Table 3 : Department _ Heads Table table [ [ department , head _ _ name,salary ] , [ Biology , Watson, 9 0

Table 3: Department_Heads Table
\table[[department,head__name,salary],[Biology,Watson,90000],[Comp. Sci.,Taylor,100000],[Elec. Eng.,Taylor,85000],[Finance,Painter,120000],[History,Painter,50000],[Music,Packard,80000],[Physics,Watson,70000]]
Table 4: Prerequisites Table
courseidprereqidBIO-301BIO-101BIO-399BIO-101CS-190CS-101CS-315CS-101CS-319CS-101CS-347CS-101EE-181PHY-101
Table 5: Enrollment Table
\table[[course_id,student_id,semester,year,instructor,room__number,grade],[BIO-101,1,Summer,2017,Painter,514,B],[BIO-301,1,Summer,2018,Painter,514,A],[CS-101,1,Fall,2017,Packard,101,H],[CS-101,1,Spring,2018,Packard,101,F],[CS-190,1,Spring,2017,Taylor,3128,E],[CS-190,2,Spring,2017,Taylor,3128,A],[CS-315,1,Spring,2018,Watson,120,D],[CS-319,1,Spring,2018,Watson,100,B],[CS-319,2,Spring,2018,Taylor,3128,4],[CS-347,1,Fall,2017,Taylor,3128,A],[EE-181,1,Spring,2017,Taylor,3128,4],[FIN-201,1,Spring,2018,Packard,101,B],[HIS-351,1,Spring,2018,Painter,514,C],[MU-199,1,Spring,2018,Packard,101,D],[PHY-101,1,Fall,2017,Watson,100,A]] Table 6: Faculty_Teaching Table
\table[[faculty_id,course_id,section,semester,year],[10101,CS-101,1,Fall,2017],[10101,CS-315,1,Spring,2018],[10101,CS-347,1,Fall,2017],[12121,FIN-201,1,Spring,2018],[15151,MU-199,1,Spring,2018],[22222,PHY-101,1,Fall,2017],[32343,HIS-351,1,Spring,2018],[45565,CS-101,1,Spring,2018],[45565,CS-319,1,Spring,2018],[76766,BIO-101,1,Summer,2017],[76766,BIO-301,1,Summer,2018],[83821,CS-190,1,Spring,2017],[83821,CS-190,2,Spring,2017],[83821,CS-319,2,Spring,2018],[98345,EE-181,1,Spring,2017]]1. Create a database called "abc"
2. Use "abc" database to create all 6 tables. Provide SQL queries to
create all tables.
3. Insert all samples values into the tables.
Questions : Write SQL queries and their corresponding Relational Algebra
(clearly state the subscript and superscript)Tables:
1. List all courses taught by Professor Taylor.
2. Find the total number of students enrolled in each course
3. List the names of all faculty members who teach at least one course with4 credits.
4. Find the average salary of all faculty members who are department heads.
5. List all courses with enrollment counts ordered by the number of enrolled
students (descending order).
6. Find the names of all faculty members who have never taught any course
7. List all courses along with their departments and the number of students
enrolled in each course in Spring 2018.
8.Find the names of all students who have not enrolled in any course
9.List all departments along with the total number of faculty members in
each department.
10. Find the names of all students who are enrolled in more than one course.
11. List all courses that have not been taught yet.
12. Find the names of all faculty members who teach courses with more than 3 credits
13. Find the average salary of faculty members in each department.
14. List all courses along with the number of students enrolled in each course taught by Professor Watson.
15. Find the names of all students who have earned an A grade in at least one course.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago

Question

7. Describe phases of multicultural identity development.

Answered: 1 week ago