Question: In SQL, given the table mapping and SQL proclamation: Create and check the data using a set of test data scripts within an SQL program

In SQL, given the table mapping and SQL proclamation: Create and check the data using a set of test data scripts within an SQL program (preferably SQLServerDatabases, but anything that works is fine), and provide the results. if anything is necessary to add to the table and proclamation data for it to function as a propper gradebook, add such so that a working test is possiible, then test and provide results. (a step by step on generally doing this would also be nice, but it's not required)

Make TABLE Classes ( ClassID int Essential KEY IDENTITY(1,1), Name nvarchar(255) NOT Invalid );

Make TABLE Understudies ( StudentID int Essential KEY IDENTITY(1,1), Name nvarchar(255) NOT Invalid, ClassID int NOT Invalid, GPA decimal(5,2) Invalid, Unfamiliar KEY (ClassID) REFERENCES Classes(ClassID) );

Make TABLE Instructors ( TeacherID int Essential KEY IDENTITY(1,1), Name nvarchar(255) NOT Invalid, ClassID int NOT Invalid, Unfamiliar KEY (ClassID) REFERENCES Classes(ClassID) );

Make TABLE Things ( ItemID int Essential KEY IDENTITY(1,1), Name nvarchar(255) NOT Invalid, Type nvarchar(255) NOT Invalid, Weight decimal(5,2) NOT Invalid, ClassID int NOT Invalid, Unfamiliar KEY (ClassID) REFERENCES Classes(ClassID) );

Make TABLE Grades ( GradeID int Essential KEY IDENTITY(1,1), StudentID int NOT Invalid, ItemID int NOT Invalid, Grade decimal(5,2) NOT Invalid, Unfamiliar KEY (StudentID) REFERENCES Students(StudentID), Unfamiliar KEY (ItemID) REFERENCES Items(ItemID) );

SET GPA = ( SELECT SUM(Grade * Weight)/SUM(Weight) FROM Grades JOIN Things ON Grades.ItemID = Items.ItemsID WHERE Grades.StudentID = Students.StudentsID );

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!