-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuery
More file actions
32 lines (25 loc) · 673 Bytes
/
Copy pathQuery
File metadata and controls
32 lines (25 loc) · 673 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
28
29
30
31
32
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS timetable;
CREATE TABLE users (
sapid VARCHAR2(50) PRIMARY KEY,
name VARCHAR2(100) NOT NULL,
password VARCHAR2(100) NOT NULL
);
CREATE TABLE timetable (
subjects VARCHAR2(50) NULL,
monday NUMBER,
tuesday NUMBER,
wednesday NUMBER,
thursday NUMBER,
friday NUMBER,
saturday NUMBER,
total NUMBER NOT NULL
);
ALTER TABLE timetable ADD yourtotal NUMBER DEFAULT 0;
CREATE TABLE last_entry (
subject VARCHAR2(50) PRIMARY KEY,
day VARCHAR2(20),
entry_time TIMESTAMP
);
INSERT INTO timetable (sapid, total)
VALUES ('S12345', 40);