-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathschema.sql
More file actions
25 lines (25 loc) · 720 Bytes
/
schema.sql
File metadata and controls
25 lines (25 loc) · 720 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
drop table if exists cars;
drop table if exists rides;
create table rides (
id integer primary key autoincrement,
date date not null,
time time,
destination text not null,
pickUpSpot text not null,
driverId references people(id),
numberOfPassengers int default 6,
spotsOpen int default 6,
secretCode text
);
drop table if exists people;
create table people (
id integer primary key autoincrement,
name text not null,
phone text not null
);
drop table if exists passengers;
create table passengers (
id integer primary key autoincrement,
rideId references rides(id),
passengerId references people(id)
);