You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
634 B
MySQL

BEGIN TRANSACTION;
DROP TABLE IF EXISTS "author";
DROP TABLE IF EXISTS "quote";
DROP TABLE IF EXISTS "category";
DROP TABLE IF EXISTS "quotecategory";
CREATE TABLE author(
aid SERIAL PRIMARY KEY,
fname TEXT,
lname TEXT
);
CREATE TABLE quote(
qid SERIAL PRIMARY KEY,
qtext TEXT,
aid INTEGER,
source TEXT,
qdate DATE,
FOREIGN KEY (aid) REFERENCES Author(aid)
);
CREATE TABLE category(
cid SERIAL PRIMARY KEY,
description TEXT
);
CREATE TABLE quotecategory(
qid INTEGER,
cid INTEGER,
FOREIGN KEY(qid) REFERENCES Quote(qid),
FOREIGN KEY(cid) REFERENCES Category(cid)
);
COMMIT;