-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathcreate-pubs.sql
More file actions
26 lines (22 loc) · 809 Bytes
/
create-pubs.sql
File metadata and controls
26 lines (22 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
create table if not exists author (
author_id integer primary key autoincrement,
first_name text not null check(first_name != ''),
last_name text not null check(last_name != '')
);
create table if not exists venue (
venue_id integer primary key,
booktitle text not null not null check(booktitle != ''),
month text not null check(month != ''),
year integer not null
);
create table if not exists pub (
pub_id integer primary key,
title text not null check(title != ''),
venue_id integer not null references venue(venue_id)
);
create table if not exists author_pub (
author_id integer not null references author(author_id),
pub_id integer not null references publication(pub_id),
author_position integer not null, -- first author, second, etc?
primary key (author_id, pub_id)
);