-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbSchema.txt
25 lines (23 loc) · 879 Bytes
/
dbSchema.txt
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 [dbo].[Users] (
[Name] VARCHAR (50) NOT NULL,
[Email] VARCHAR (50) NOT NULL,
[Password] VARCHAR (50) NOT NULL,
[Admin] BIT NOT NULL,
PRIMARY KEY CLUSTERED ([Email] ASC)
);
CREATE TABLE [dbo].[Restaurants] (
[Name] VARCHAR (50) NOT NULL,
[Location] VARCHAR (50) NOT NULL,
[Cuisine] VARCHAR (50) NOT NULL,
PRIMARY KEY CLUSTERED ([Name] ASC)
);
CREATE TABLE [dbo].[Comments] (
[Email] VARCHAR (50) NOT NULL,
[RestaurantName] VARCHAR (50) NOT NULL,
[Comment] VARCHAR (150) NULL,
[Rating] DECIMAL(4,2) NOT NULL,
[Approved] BIT NOT NULL,
PRIMARY KEY CLUSTERED ([Email],[RestaurantName] ASC),
FOREIGN KEY ([Email]) REFERENCES [dbo].[Users] ([Email]),
FOREIGN KEY ([RestaurantName]) REFERENCES [dbo].[Restaurants] ([Name])
);