-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsql_dummydata.sql
33 lines (25 loc) · 920 Bytes
/
sql_dummydata.sql
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
28
29
30
DROP TABLE IF EXISTS Accounts;
CREATE TABLE Accounts (
uname varchar(50) PRIMARY KEY,
pass varchar(256) NOT NULL
);
INSERT INTO Accounts VALUES ('root', 'password');
INSERT INTO Accounts VALUES ('user', 'password');
INSERT INTO Accounts VALUES ('rogers', 'password');
INSERT INTO Accounts VALUES ('stark', 'password');
INSERT INTO Accounts VALUES ('romanoff', 'password');
SELECT * FROM Accounts;
DROP TABLE IF EXISTS Passengers;
CREATE TABLE Passengers (
uname varchar(50) PRIMARY KEY REFERENCES Accounts (uname) ON DELETE CASCADE
);
SELECT * FROM Passengers;
DROP TABLE IF EXISTS Drivers;
CREATE TABLE Drivers (
uname varchar(50) PRIMARY KEY REFERENCES Accounts (uname) ON DELETE CASCADE,
license text NOT NULL --primarykey as well
);
DROP TABLE IF EXISTS Advertizers;
CREATE TABLE Advertizers (
uname varchar(50) PRIMARY KEY REFERENCES Accounts (uname) ON DELETE CASCADE
);