Question: 1 . Review the SQL statements contained in the file below. SQL Schema: grades . sql Summarize all constraints ( L 2 . 1 The

1. Review the SQL statements contained in the file below.
SQL Schema:grades.sql
Summarize all constraints (L2.1 The Relational Model & Ch4) in this schema
Find and fix a minor SQL syntax error in the given schema
2. Create a database using the queries specified in the schema linked above (grades.sql).
3. Record that the Database Management Systems course is a 3-credit course with number 0145443 and is capped at 25 students.
4. Record that prof. Smith graded Susan Cooper for the databases courses in term 1702 with a 'B+' on January 4,2017.
5. Record that Prof. Smith updated Susan Cooper's grade from a B+ to an A- on January 6,2017.
6.Write a query that answer the following question: What are the last names of the students?
7.Write a query that answer the following question: What courses are offered in term 1702?
8. Write a query that answer the following question: Which students scored a B or higher for the databases course in term 1702?
9. Write a query that shows the grade roster (firstname, lastname, grade) in the databases course, sorted by grade (highest to lowest).
All courses and all sections -- CREATE TABLE courses ( courseid INTEGER, coursename VARCHAR(40) NOT NULL, credits REAL NOT NULL, max_students INTEGER NOT NULL, PRIMARY KEY (courseid)); ---- People -- CREATE TABLE people ( personid INTEGER, lastname VARCHAR(80) NOT NULL, firstname VARCHAR(80) NOT NULL, dob DATE, gender char(1), is_student INTEGER NOT NULL, is_professor INTEGER NOT NULL, PRIMARY KEY (personid), CHECK (gender in ('M','F','O'))); ---- Records all grades for all students -- CREATE TABLE grades ( studentid INTEGER, courseid INTEGER, term VARCHAR(10), grade VARCHAR(2) NOT NULL, professorid INTEGER NOT NULL, grade_date DATE NOT NULL, PRIMARY KEY (studentid, courseid, term), FOREIGN KEY (studentid) REFERENCES people(personid), FOREIGN KEY (courseid) REFERENCES courses, FOREIGN KEY (professorid) REFERENCES people(personid), CHECK (grade IN ('F','I','D','C-','C','C+','B-','B','B+','A-','A','A+'))); ---- Data load -- INSERT INTO people (personid, lastname, firstname, dob, gender, is_student, is_professor) VALUES (1000000001, 'Smith', 'John', '1975/1/1','M',1,0); INSERT INTO people (personid, lastname, firstname, dob, gender, is_student, is_professor) VALUES (1000000002, 'Doe', 'Jane', '1985/12/15','F',1,0); INSERT INTO people (personid, lastname, firstname, dob, gender, is_student, is_professor) VALUES (1000000003, 'Greene', 'David', '1995/6/15','M',1,0); INSERT INTO people (personid, lastname, firstname, dob, gender, is_student, is_professor) VALUES (1000000004, 'Cooper', 'Susan', '1998/8/12','F',0,1);
Please help with this ill leave a good review I need to understand this more.

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 Programming Questions!