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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started