-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDB_creation.sql
101 lines (84 loc) · 1.85 KB
/
DB_creation.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
94
95
96
97
98
99
100
101
CREATE DATABASE JOBPORTAL;
USE JOBPORTAL;
CREATE TABLE CONTACT(
CONTACTID INT PRIMARY KEY IDENTITY(1,1) NOT NULL,
NAME VARCHAR(50),
EMAIL VARCHAR(50),
SUBJECT VARCHAR(100),
MESSAGE VARCHAR(MAX)
);
SELECT * FROM CONTACT;
USE JobPortal;
CREATE TABLE Country(
CountryId INT PRIMARY KEY IDENTITY(1,1),
CountryName VARCHAR(50)
)
SELECT * FROM Country;
INSERT INTO Country VALUES ('Vietnam');
INSERT INTO Country VALUES
('France'),
('Brazil'),
('Canada'),
('South Africa'),
('Thailand'),
('Russia'),
('Mexico'),
('Italy'),
('Spain'),
('Japan');
CREATE TABLE [User](
UserId INT PRIMARY KEY IDENTITY(1,1),
Username VARCHAR(50),
Password VARCHAR(50),
Name VARCHAR(50),
Email VARCHAR(50),
Mobile VARCHAR(50),
TenthGrade VARCHAR(50),
TwelfthGrade VARCHAR(50),
GraduationGrade VARCHAR(50),
PostGraduationGrade VARCHAR(50),
Phd VARCHAR(50),
WorksOn VARCHAR(50),
Experience VARCHAR(50),
Resume VARCHAR(50),
Address VARCHAR(MAX),
Country VARCHAR(50)
)
ALTER TABLE [User] ALTER COLUMN Resume NVARCHAR(200);
ALTER TABLE [User] ADD UNIQUE (Username);
SELECT * FROM [User];
DELETE FROM [User];
-------Part 4----
ALTER TABLE [User]
ALTER COLUMN Resume VARCHAR(MAX);
CREATE TABLE Jobs(
JobId INT PRIMARY KEY IDENTITY(1,1),
Title VARCHAR(50),
NoOfPost INT,
Description VARCHAR(MAX),
Qualification VARCHAR(50),
Experience VARCHAR(50),
Specialization VARCHAR(50),
LastDateToApply DATE,
Salary VARCHAR(50),
JobType VARCHAR(50),
CompanyName VARCHAR(200),
CompanyImage VARCHAR(500),
Website VARCHAR(100),
Email VARCHAR(50),
Address VARCHAR(MAX),
Country VARCHAR(50),
State VARCHAR(50),
CreateDate DATETIME
)
<<<<<<< HEAD
SELECT * FROM Jobs;
=======
CREATE TABLE AppliedJobs(
AppliedJobId INT PRIMARY KEY IDENTITY,
JobId int,
UserId int,
AppliedDate DATETIME
)
ALTER TABLE [User] ALTER COLUMN Resume varchar(MAX);
>>>>>>> 048723e336010a15bf4dc812695bc6d22d5f5ea0