Question

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 all the courses he/she has taken and earned an A in each course, i.e. every grade is an A and no NULL value

3. List the name of every student and SSN who earned no A in any course.

4. List the name and major of every student who has only taken courses that meet MW afternoon (12 or after).

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

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

7. List every CoursaeNumber and Quarter which has the highest enrollment.

8. List every CourseNumber and CourseTitle which has the highest enrollment based on all quarters.

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

10. 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 a.CourseTitle , b.CourseTitle ,c.CourseNumber from Course as a,Course as b,Course as c where a.PrerequisiteCourseNumber=b.PrerequisiteCourseNumber ;

2) select a.name,a.SSN from Student a Inner Join Enrollment b on a.SSN=b.SSN where grade='A';

3)select a.name,a.SSN from Student a Inner Join Enrollment b on a.SSN=b.SSN where grade NOT LIKE 'A';

4) select name,major from student UNION section where daytime='MW';

Add a comment
Know the answer?
Add Answer to:
Student = (SSN, Name, Major) Course = ( CourseNumber, PrerequisiteCourseNumber, Course Title, NumberUnits) Section = (...
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
  • 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...

  • 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...

  • 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...

  • 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...

  • Create sql queries to find the following miscrosoft access compatible commands please 9. Courses for which...

    Create sql queries to find the following miscrosoft access compatible commands please 9. Courses for which at least three students earned a grade of A, showing the grade and the course code 10. Semesters when the highest number of courses have been scheduled, showing the semester name and the number of sections 11. (Extra) Professors that are not students, and students that are not professors, showing their ID and SSN 12. (Extra) Semesters for which all courses are taught by...

  • Design and code a JAVA program called ‘Grades’. ? Your system should store student’s name, and...

    Design and code a JAVA program called ‘Grades’. ? Your system should store student’s name, and his/her course names with grades. ? Your system should allow the user to input, update, delete, list and search students’ grades. ? Each student has a name (assuming no students share the same name) and some course/grade pairs. If an existing name detected, user can choose to quit or to add new courses to that student. ? Each student has 1 to 5 courses,...

  • 1. Consider the following database. Note that it distinguishes between a course and the class of...

    1. Consider the following database. Note that it distinguishes between a course and the class of that course in a particular year. Courses can have prerequisites (aka a prereq), which is again a course. 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...

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