CREATE TABLE staff (
    code  INT  PRIMARY KEY,
    name  TEXT NOT NULL,
    phone TEXT
);

CREATE TABLE course(
    code  INT  PRIMARY KEY,
    title TEXT NOT NULL,
    price INT
);

CREATE TABLE schedule(
    code       INT  PRIMARY KEY,
    course     INT  NOT NULL REFERENCES course(code),
    staff      INT  NOT NULL REFERENCES staff(code),
    start_date DATE NOT NULL,
    end_date   DATE NOT NULL
);

INSERT INTO staff VALUES(90, 'Tomoko Takahashi', '090-9876-5432');
INSERT INTO staff VALUES(10, 'Taro Yamada',      '03-1111-2222');
INSERT INTO staff VALUES(20, 'Yuka Sato',        '03-1234-5678');
INSERT INTO staff VALUES(30, 'Jiro Suzuki',      '03-2345-6789');

INSERT INTO course VALUES(100, 'PHP Programming', 30000);
INSERT INTO course VALUES(201, 'Linux Basic',     50000);
INSERT INTO course VALUES(202, 'Linux Master',    60000);
INSERT INTO course VALUES(101, 'PHP Basic',       25000);
INSERT INTO course VALUES(102, 'PHP Master',      25000);

INSERT INTO schedule VALUES(1001, 100, 10, '2010-07-30', '2010-11-30');
INSERT INTO schedule VALUES(1002, 100, 20, '2010-10-10', '2011-01-29');
INSERT INTO schedule VALUES(1003, 201, 10, '2010-06-18', '2011-02-10');
INSERT INTO schedule VALUES(1004, 201, 30, '2010-09-27', '2011-05-20');
INSERT INTO schedule VALUES(1005, 202, 20, '2011-02-10', '2011-07-03');
