-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdatabase.sql
93 lines (85 loc) · 2.05 KB
/
database.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
CREATE DATABASE resume_db;
-- DROP DATABASE resume_db;
USE resume_db;
-- rollback;
CREATE TABLE users (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
-- DROP TABLE users;
/*
INSERT INTO users VALUES
(1,"Subash Pandey","[email protected]","d1e6989494884caca3c994c88b050cd8");
SELECT * FROM users;
*/
CREATE TABLE personal (
id INT PRIMARY KEY,
first_name VARCHAR(50),
middle_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(50),
phone_number VARCHAR(20),
address VARCHAR(100),
address_2 VARCHAR(100),
city VARCHAR(50),
state VARCHAR(50),
zip_code VARCHAR(20),
user_email VARCHAR(50),
FOREIGN KEY (user_email) REFERENCES users(email)
);
SELECT * FROM personal;
-- DELETE FROM personal;
-- DROP TABLE personal;
CREATE TABLE education (
id INT ,
eid INT AUTO_INCREMENT PRIMARY KEY ,
education_level VARCHAR(50),
school VARCHAR(50),
city VARCHAR(50),
start_date DATE,
end_date DATE,
FOREIGN KEY (id) REFERENCES personal(id)
);
SELECT * FROM education;
-- DROP TABLE education;
CREATE TABLE employment (
id INT,
emid INT AUTO_INCREMENT PRIMARY KEY ,
company_name VARCHAR(50),
job_title VARCHAR(50),
city VARCHAR(50),
start_date DATE,
end_date DATE,
FOREIGN KEY (id) REFERENCES personal(id)
);
SELECT * FROM employment;
-- DROP TABLE employment;
CREATE TABLE skills (
id INT ,
sid INT AUTO_INCREMENT PRIMARY KEY ,
skill VARCHAR(255) NOT NULL,
proficiency_level VARCHAR(255) NOT NULL,
FOREIGN KEY (id) REFERENCES personal(id)
);
SELECT * FROM skills;
-- DROP TABLE skills;
CREATE TABLE hobbies (
id INT,
hid INT AUTO_INCREMENT PRIMARY KEY ,
hobbiesname VARCHAR(255) NOT NULL,
FOREIGN KEY (id) REFERENCES personal(id)
);
SELECT * FROM hobbies;
-- DROP TABLE hobbies;
CREATE TABLE summary (
id INT,
suid INT AUTO_INCREMENT PRIMARY KEY ,
summaries TEXT NOT NULL,
FOREIGN KEY (id) REFERENCES personal(id)
);
SELECT * FROM summary;
-- DELETE FROM summary;
-- DROP TABLE summary;