Query 1 (2 pts)
Find all courses taught by Mozart. For each such course, output the title, semester, and year.
Query 2 (2 pts)
Find the names of all students who took both “Intro. to Computer Science” and “Game Design”.
Query 3 (2 pts)
Find the names of all instructors in the computer science department who never taught “Intro. to Computer Science”.
Query 4 (2 pts)
For each student, find the number of courses taken by this student. Output a table consisting of two columns: name of student, number of courses.
Query 5 (2 pts)
For each semester, find the number of students who took at least one section in this semester. Output a table consisting of three columns: semester, year, number of students. Order rows in the resulting table by the number of students in descending order.
Query 6 (2 pts)
Find all instructors who taught at least two sections. Output a table consisting of two columns: name of instructor, number of sections. Order rows in the resulting table by the number of sections in descending order.
Query 1
Select title , semester , year from course inner join teaches on course.course_id = teaches.course_id inner join instructor on teaches.ID = instructor.ID where instructor.name = 'Mozart';
Query 2
Select student.name from student inner join takes on student.ID = takes.ID inner join course on takes.course_id = course.course_id where title = 'Intro. to Computer Science' and title = 'Game Design';
Query 3
Select instructor.name from instructor inner join teaches on instructor.ID = teaches .ID inner join course on course.course_id = teaches.course_id where instructor.dept_name = 'computer science' and course.title != 'Intro. to Computer Science';
Query 4
Select student.name, count(course.course_id) from student inner join takes on student.ID = takes.ID inner join course on takes.course_id = course.course_id group by student.name;
Query 5
Select semester,year, count(student.ID) as NumberOfStudents from takes inner join student on takes.ID = student.ID group by semester,year having(sec_id) >= 1 order by NumberOfStudents desc;
Query 6
Select instructor.name , count(section.sec_id) as NumberOfSections from instructor inner join teaches on instructor.ID = teaches.ID inner join section on teaches.sec_id = section.sec_id group by instructor.name having count(section.sec_id) >= 2 order by NumberOfSections desc;
Do ask if any doubt. Please upvote.
Find all courses taught by Mozart. For each such course, output the title, semester, and year.
10- Specify the following
queries in SQL on the database schema of Figure 2. a. Retrieve the
names of all senior students majoring in ‘CS’ (Computer Science).
b. Retrieve the names of all courses taught by Professor King in
2004 and 2005. c. For each section taught by Professor King,
retrieve the course number, semester, year, and number of students
who took the section. d. Retrieve the name and transcript of each
senior student (Class =4) majoring in CS. A...
This is database system concept. 1.Find the ids of instructors who are also students using a set operation. Assume that a person is identified by her or his id. So, if the same id appears in both instructor and student, then that person is both an instructor and a student. Remember: set operation means union, intersect or set difference. 2.Find the ids of instructors who are also students using the set membership operator. 3.Find the ids of instructors who are...
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...
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...
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,...
5. North Carolina State University posts the complete grade distributions for its courses online. The distribution of grades for all students in all sections of Accounting 210 in the spring semester of 2001 was Grade Probability .18 32 34 09 07 a. Using the scale A -4, B-3, C-2, D- 1, and F 0, let Xbe the grade of a randomly chosen b. Let X denote the mean grade for a random sample of 50 students from Accounting 210. Since...
Question 5: Sevens Let's take a look at data from both of our tables, students and checkboxes, to find out if students that got the number 7 assigned to them also chose '7' for the obedience question. Specifically, we want to look at the students that fulfill the below conditions and see if they also chose '7' in the question that asked students to choose the number 7 (column seven in students). reported that their favorite number (column number in...
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...
conducted to determine success rates of students enrolled in the Statistics courses offered at South Plains College for the fall semester of 2015. A random sample of 14 students was taken, and we recorded each student's age, final average, gender, # hours worked per week, race, and t attended this semester). Use the results from the following table to answer all parts of #2. he attendance record (# of classes not Age 20 18 19 Final Average Gender # Hrs...