


CREATE TABLE courses (
  id varchar(11) NOT NULL,
  level int(11) DEFAULT NULL,
  PRIMARY KEY (id)
);


INSERT INTO courses(id,level)  VALUES ('c1',  1);
INSERT INTO courses(id,level)  VALUES ('c2',  2);
INSERT INTO courses(id,level)  VALUES ('c3',  3);
INSERT INTO courses(id,level)  VALUES ('c4',  4);
INSERT INTO courses(id,level)  VALUES ('c5',  5);
INSERT INTO courses(id,level)  VALUES ('c0',  0);

/* Students from the basic course (level = 0) */
create or replace view basic(student) as
   select S.student
   from standard S
   where S.level = 0 and S.pass=1;

/* Awards are only for students from the basic level */
create or replace view awards(student) as
  select student from  basic
  except
  select student from  intensive;

/*
create or replace view awards(student) as
select student
  from  basic
  where student not in (select student from intensive);
*/