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.
26 lines
502 B
MySQL
26 lines
502 B
MySQL
2 years ago
|
BEGIN TRANSACTION;
|
||
|
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;
|