Question: USE CSIS 3 3 0 0 M 1 ; - - Drop tables if they exist ( for testing purposes, only use them if you
USE CSISM;
Drop tables if they exist for testing purposes, only use them if you need to drop tables.
IF OBJECTIDFacultyU IS NOT NULLIF OBJECTIDCoursesU IS NOT NULLIF OBJECTIDDepartmentHeads', U IS NOT NULLIF OBJECTIDPrerequisitesU IS NOT NULL DROP CONSTRAINT FKPrerequisitesCourses;
IF OBJECTIDEnrollmentU IS NOT NULL DROP CONSTRAINT FKEnrollmentCourses;
IF OBJECTIDStudentsU IS NOT NULLUsing NoSQL to answer these below questions INSERT INTO Faculty facultyid name, department, salary VALUES
'Srinivasan', 'Comp. Sci.
Wu 'Finance',
'Mozart', 'Music',
'Einstein', 'Physics',
El Said', 'History',
'Gold', 'Physics',
'Katz', 'Comp. Sci.
'Califieri', 'History',
'Singh', 'Finance',
'Crick', 'Biology',
'Brandt', 'Comp. Sci.
'Kim', 'Elec. Eng.; INSERT INTO Courses courseid coursename, department, credits VALUES
BIO 'Intro. to Biology', 'Biology',
BIO 'Genetics', 'Biology',
BIO 'Computational Biology', 'Biology',
CS 'Intro. to Computer Science', 'Comp. Sci.
CS 'Game Design', 'Comp. Sci.
CS 'Robotics', 'Comp. Sci.
CS 'Image Processing', 'Comp. Sci.
CS 'Database System Concepts', 'Comp. Sci.
EE 'Intro. to Digital Systems', 'Elec. Eng.
FIN 'Investment Banking', 'Finance',
HIS 'World History', 'History',
MU 'Music Video Production', 'Music',
PHY 'Physical Principles', 'Physics', ; Biology 'Crick',
Comp Sci. 'Brandt',
Elec Eng. 'Kim',
FinanceWu
HistoryEl Said',
Music 'Mozart',
Physics 'Einstein', ;
INSERT INTO Prerequisites courseid prereqid VALUES
BIO 'BIO
BIO 'BIO
CSCS
CSCS
CSCS
CSCS
EEPHY; INSERT INTO Students id name, deptname, totalcredit VALUES
'John Doe', 'Comp. Sci.
'Jane Smith', 'Biology',
'Alice Johnson', 'Physics',
'Robert Brown', 'History',
'Emily Wilson', 'Comp. Sci.
'Michael Clark', 'Finance',
'Sarah Lewis', 'Music',
'David Lee', 'Elec. Eng.
'Jessica Miller', 'History',
'Ryan Martinez', 'Physics', ;INSERT INTO Enrollment courseid studentid semester, year, instructor, roomnumber, grade VALUES
BIO 'Summer', 'Crick', B
BIO 'Summer', 'Crick', A
CS 'Fall', 'Mozart', B
CS 'Spring', 'Mozart', F
CS 'Spring', 'Brandt', A
CS 'Spring', 'Brandt', A
CS 'Spring', 'Singh', D
CS 'Spring', 'Singh', B
CS 'Spring', 'Brandt', A
CS 'Fall', 'Brandt',
Q: Write a noSQL to list all courses taught within the same department as Professor Kim.
List Course ID Course Name, Department Name and Professor's name.
Q: Write a NoSQL to Calculate the total number of students enrolled in each course in Fall
List Course Id Course Name and Total No of Enrollment.
Q: Write a noSQL to Identify faculty members who teach at least one course with credits
List Faculty ID Faculty Name, Course ID and Course Names.
Q: Write a noSQL to Find the average salary of all faculty members who are not department heads
List AVG salary only.
Q: Write a noSQL to List all courses with enrollment counts ordered by the number of enrolled students ascending order
List Course Id Course Name and No of Enrollment.
Q: Write a noSQL to Find the names of all students who have not enrolled in any course.
List Student Id and Student Name.
Q: Write a noSQL to List all departments along with the total number of faculty members in each department, Order by lowest to highest.
List Dept Name and No of Faculty Members
Q: Write a noSQL to Identify the names of all students who are enrolled in exactly one course.
List Student ID and Name
Q: Write a noSQL to Retrieve the courses that have no enrollment records.
List Student ID and Name
Q: Write a noSQL to Identify the names of all students who have earned a B grade in at least one course
List Student ID Name and Course Name.
Q: Write a noSQL to List all courses that have not been taught in Spring List Course ID Name and Dept Name.
Q: Write a noSQL to Find courses that have prerequisites in the same department. List course ID course name, and prerequisite ID
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
