Question

Please do these carefully. Student = (SSN, Name, Major) Course = ( CourseNumber, PrerequisiteCourseNumber, Course Title,...

Please do these carefully.

Student = (SSN, Name, Major)

Course = ( CourseNumber, PrerequisiteCourseNumber, Course Title, NumberUnits)

Section = ( CourseNumber, Quarter, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00PM.

Enrollment = (SSN,CourseNumber, Quarter, Grade)// Grade is either Null or a letter grade.

Express the following queries using appropriate SQL statements with a minimum number of operations:

1. List the name of every student and SSN who has not taken any course more than once.

2. List every two CourseNumber and their titles which have the same prerequisites.

3. List the name and major of every student who has taken all the courses that meet MW afternoon.

4. List the name and major of every student who has not taken any course that meets MW afternoon.

5. List every CourseNumber and Quarter which has the highest enrollment.

6. List the name and major of every student who has completed the highest number of units.

7. List every Course tile which is a prerequisite for the largest number of courses.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

Select Name, SSN from Student where SSN in (Select SSN.Enrollment from Enrollment JOIN Course where Enrollment.CourseNumber = Section.CourseNumber);

2.

Select A.CourseNumber as Course1, A.CourseTitle as Course1Title, B,CourseNumber as Course2, B.CourseTitle as Course2Title from Course A, Course B where A.CourseNumber <> B.CourseNumber AND A.PrerequisiteCourseNumber = B.PrerequisiteCourseNumber;

Add a comment
Know the answer?
Add Answer to:
Please do these carefully. Student = (SSN, Name, Major) Course = ( CourseNumber, PrerequisiteCourseNumber, Course Title,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Student = (SSN, Name, Major) Course = ( CourseNumber, PrerequisiteCourseNumber, Course Title, NumberUnits) Section = (...

    Student = (SSN, Name, Major) Course = ( CourseNumber, PrerequisiteCourseNumber, Course Title, NumberUnits) Section = ( CourseNumber, Quarter, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00PM. Enrollment = (SSN,CourseNumber, Quarter, Grade)// Grade is either Null or a letter grade. Express the following queries using appropriate SQL statements with a minimum number of operations: 1. List every two CourseNumber and their titles which have the same prerequisites. 2. List the name of every student and SSN who has completed...

  • Given the following relational database schema: Student = (SSN, Name, Major) Course = ( CourseNumber ,...

    Given the following relational database schema: Student = (SSN, Name, Major) Course = ( CourseNumber , CourseTitle, NumberOfUnits, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00. Enrollment = (SSN , CourseNumber, Grade) Express the following queries using AQL statements with minimum number of tables and operations. List the name of every student whose name starts with the letter S and ends with the letter M, and has earned the grade B in at least one course.

  • 31. (15 pts) Consider the following relations and relationship: Student (studentID, name, address, gender, major) Course...

    31. (15 pts) Consider the following relations and relationship: Student (studentID, name, address, gender, major) Course (courselD, title, hour, department) Enrollment (StudentID, courselD, date Write the SQL statements to perf orm the following operations: List all the students' information for those majoring in "Computer Science". (2 pts) List the majors, and the numbers of the students in every major. (2 pts) List the departments, and the total number of hours of the courses offered by every department. (2 pts) List...

  • Person(UPI, givenname, surname) with key UPI Courses(course, title, program) with key course Classes(classnr, course, year) with...

    Person(UPI, givenname, surname) with key UPI Courses(course, title, program) with key course Classes(classnr, course, year) with key classnr Enrollments(UPI, classnr) Grades(UPI, classnr, grade) Prereqs(course, prereq) Teachers(UPI, classnr) With natural foreign key constraints given by common attribute names. 1. List all UPIs of all teachers who teach a course with a prerequisite. 2. List all enrollments (i.e., list UPI and classnr) where the enrolled person has a grade for all prerequisites. 3. List all enrollments where the enrolled person has a...

  • Consider the following relations for a database that keeps track of student enrollment in courses and...

    Consider the following relations for a database that keeps track of student enrollment in courses and books adopted for each course. -------------------------------------------------------------------------------------------------------- STUDENT(Ssn,Name,Major,Bdate) COURSE(Course#,Cname,Dept) ENROLL(Ssn,Course#,Quarter,Grade) TEXTBOOK(Book_isbn,Book_title,Publisher,Author) BOOK_ASSOC(Course#,Quarter,Book_isbn) ------------------------------------------------------------------------------------------------------------------------------- Having that a relation can have zero or more foreign keys and each foreign key can refer to different referenced relations. Specify the foreign keys for this schema.

  • Name Use complete sentences if possible The following StudentGrade relation (table) stores the Student, Major, and Course information Each student has unique StudentID. Assume that a student has...

    Name Use complete sentences if possible The following StudentGrade relation (table) stores the Student, Major, and Course information Each student has unique StudentID. Assume that a student has only one major. One student can take multiple courses in one SemesterYear. One course can be taken by many students in each SemesterYear. Given values for StudentID, Course Number, and SemesterYear, one can determine all the rest of values for a record. However only Grade is functionally dependent on StudentlD, CourseNumber and...

  • Can someone please help me solve the following database management question a - d please help...

    Can someone please help me solve the following database management question a - d please help uestion-4 The relational database schema of Question-3 is reproduced here. COURSE (NUMBER, TITLE, ENROLLED) RANK-1 (CNUMBER, R1-SSN) RANK-2 (CNUMBER, R2-SSN) TALLEST (CNUMBER, TALL-SSN) STUDENT (SSN, NAME, MAJOR, SEX, GPA) Formulate the following queries in soL. (30] (a) List the course numbers in which "Jack Hernandez" is the first ranked student. You are not allowed to use any JOIN operation and your answer must be...

  • 2. Consider the following database and answer the questions below SPORT ENROLLMENT STUDENT COURSE ST ST...

    2. Consider the following database and answer the questions below SPORT ENROLLMENT STUDENT COURSE ST ST TITLE 313 1313 50s0 Basketbal 8989 Basketbal 007 COMP203A 7007 COMP20e 007 ames Bond 302 Database Systems COMP203 Computer Or n Brown 00 CoMP302 A o0 3un SmuCOMP42daedDatabase Systems 3 13 COMP 209 70 5050 Susan Smith COMP447 nced Database S 1313 COMP2O3A 1313 COMP302 5050 COMP20 C 1313 COMP42 7007 Write the SQL statement that displays the names of the students who have...

  • Someone please answer all of these. I need these badly. The submission date is knocking at...

    Someone please answer all of these. I need these badly. The submission date is knocking at the door. Experiment 1: SQL data definition and data insertion 46 hours) 1. CREATE TABLE. The database schema consists of the three relations, whose schemas are: S (Spa, Sname. Sgender, Sage, Sdert? // students(SID, name, gender, age, department) SC (Spa, Cne. Grade) //Course(SID, CID, grade) C (One Cname Crno. Ceredit) l/courses (CID, course name, prerequisite courses, credit) 2. DROP TABLE, ALTER TABLE, CREATE INDEX,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT