-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql
More file actions
25 lines (23 loc) · 711 Bytes
/
sql
File metadata and controls
25 lines (23 loc) · 711 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
CREATE TABLE departments(
id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(255),
short_code varchar(255),
code varchar(255),
);
CREATE TABLE student(
id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(255),
email varchar(255),
dob MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci,
department_id int,
FOREIGN KEY (department_id) REFERENCES departments(id)
);
CREATE TABLE users(
id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
lastname varchar(255),
firstname varchar(255),
description MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci,
age int,
department_id int,
FOREIGN KEY (department_id) REFERENCES departments(id)
);