subject

Write the SQL and relational algebra queries using the following schema Homework Problem
STUDENT(Sid: integer, Fname, Lname, Major)
COURSE(Course_id, Cname, Dept)
ENROLL(Sid, Course_id, Quarter, Grade)
FOREIGN KEY (Sid) REFERENCES STUDENT(Sid)
FOREIGN KEY (Course_id) REFERENCES COURSE(Course_id)
ADOPT_BOOKS(Course_id, Quarter, Isbn)
FOREIGN KEY (Course_id) REFERENCES COURSE(Course_id)
FOREIGN KEY(Isbn) REFERENCES BOOK(Isbn)
BOOK(Isbn, Title, Publisher)
BOOK_AUTHORS(Isbn, Fname, Lname)
FOREIGN KEY (Isbn) REFERENCES BOOK(Isbn)
1. (10 points; 5 each) - Write R. A. and SQL
Retrieve the student id and student name of those who have enrolled in a course that is offered by the department called Computer Science.
SQL:
2. (10 points; 5 each) – Write R. A. and SQL
Retrieve the student ids and their names of those who have enrolled in all of the courses offered by both the Computer Science department and Mathematics departments.
3. (10 points; 5 points) – Write R. A. and SQL
Retrieve all of the student information for all students who have not taken any courses offered by the Physics department.
4. (10 points; 5 each) – Write R. A. and SQL
For each book, retrieve the Isbn, the title and and the count of the number of authors
5. (10 points; 5 each) - Write R. A. and SQL
Retrieve the Cname, Course_id and Quarter for all courses with the following requirements:
enrollments > 40 students
and had at least 3 students withdraw from the class (note: grade of "W" is a withdraw)
both of these must be satisfied to be retrieved by the query
We consider every Course_id and Quarter to be a separate course.
6. (10 points) - Write R. A. and SQL
Retrieve the count of the number of Computer Science majors that took courses offered by the Computer Science department in the S20 quarter. (A Computer Science student needs to be counted every time a Computer Science course was taken by that student in the S20 quarter.)
7. (10 points – 5 each) Write R. A. and SQL
List the book information for books that have an author of "Stephen King" or "Dean Koontz". Note: the book could have other authors but we are looking for books with these authors.
8. (10 points - 5 each) Write R. A. and SQL
Retrieve all student information along with the course_id, quarter and grade for those students who have taken the same course more than once.
9. (5 points)
For problem 8) above show what the final relation would look like in terms of attributes/columns. Be sure to show the order of the columns based on your own R. A.
10. (5 points)
What does this return (be specific)? Write the query that generated this.
SELECT COUNT(*)
FROM STUDENT, COURSE, ENROLL
WHERE STUDENT. Sid = ENROLL. Sid
AND COURSE. Course_id = ENROLL. Course_id
AND Major = "Physics"
AND Dept = "Computer Science"
AND Grade NOT IN ("W", "F", "D")

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Which of these is a benefit of using objects in a powerpoint presentation? a. collaborators can create the external files while you create and edit the slide show. b. you can easily change the theme and design of the presentation. c. you can have older data in the source file while having up-to-date data in the presentation. d. collaborators can easily share the presentation.
Answers: 2
You know the right answer?
Write the SQL and relational algebra queries using the following schema Homework Problem
STU...
Questions
question
Mathematics, 03.08.2019 13:00
question
English, 03.08.2019 13:00
question
Chemistry, 03.08.2019 13:00
Questions on the website: 13722363