-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdorms.sql
More file actions
27 lines (26 loc) · 893 Bytes
/
dorms.sql
File metadata and controls
27 lines (26 loc) · 893 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
27
drop table if exists dorm;
create table dorm (
dorm_id integer primary key autoincrement,
name text,
spaces integer
);
insert into dorm values(1, 'Armstrong', 124);
insert into dorm values(2, 'Brown', 158);
insert into dorm values(3, 'Caldwell', 158);
drop table if exists stud;
create table stud (
stud_id integer primary key autoincrement,
name text,
gpa float,
dorm_id integer references dorm(dorm_id)
);
insert into stud values (1, 'Alice', 3.6, 1);
insert into stud values (2, 'Bob', 2.7, 1);
insert into stud values (3, 'Cheng', 3.9, 1);
insert into stud values (4, 'Dhruv', 3.4, 2);
insert into stud values (5, 'Ellie', 4.0, 2);
insert into stud values (6, 'Fong', 2.3, 2);
insert into stud values (7, 'Gerd', 4.0, 3);
insert into stud values (8, 'Hal', 2.2, 3);
insert into stud values (9, 'Isaac', 2.0, 3);
insert into stud values (10, 'Jacque', 5.0, 3);