112.    Show the SQL commands necessary to create table Semester. Show all Primary and Foreign Keys. Remember that this is simply unique information about a semester. Each semester should have a unique name (e.g., Fall 2003), and unique starting and ending times (e.g., two semesters can not start on, September 1, 2004 – or can they? Maybe, buts let’s assume they can’t – for now) and of course we need to protect against dumb entries (e.g., a semester can not end before it begins).

 

 

create table semester

( semID integer,

  semname char(15),

  semstart date,

  semend date,

  primary key (semID),

  constraint semester_startLTend_CK check (semstart < semend),

  unique (semname),

  unique (semstart),

  unique (semend));