HW#1:

Question 1: Write an SQL statement that creates the (empty) Transcript table.
CREATE TABLE Transcript(
Id       INTEGER,
StuId       INTEGER,
CrsCode     INTEGER,
Semester  CHAR(50),
Grade   	  CHAR(10),
PRIMARY KEY(Id))
    
Show Student Table
Reset the Student Table

Question 2: Write an SQL statement to accomplish each of these:
  • Question 2.1 : Return the Ids of all seniors in the table Student.
  • Question 2.2 : Deletes all seniors from table Student.
  • Question 2.3 : Promotes all juniors in the table Student to seniors.

  • Question 3: Given the relation Married that consists of tuples of the form < a, b >, where a is the husband and b is the wife, the relation Brother that has tuples of the form < c, d >, where c is the brother of d, and the relation Sibling, which has tuples of the form < e, f >, where e and f are siblings:
  • Question 3.1 : Describe (design) how you would define the relation BrotherInLaw, where tuples have the form < x, y > with x being the brother-in-law of y.
  • Question 3.2 : Write the (just one) SQL statement that would implement your design.