-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQLScript.txt
54 lines (37 loc) · 990 Bytes
/
SQLScript.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
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
GO
create database vehical
GO
use vehical
GO
CREATE TABLE Users (
UserID INT identity(1,1) PRIMARY KEY,
Name VARCHAR(255),
MobileNumber VARCHAR(20),
Organization VARCHAR(255),
Address VARCHAR(255),
EmailAddress VARCHAR(255),
Location VARCHAR(255),
PhotoPath VARCHAR(255)
);
GO
CREATE TABLE [dbo].[Devices](
[DeviceID] [int] identity(1,1) PRIMARY KEY,
[DeviceName] [varchar](20) NULL,
)
GO
CREATE TABLE Vehicles (
VehicleNumber VARCHAR(20) PRIMARY KEY,
VehicleType VARCHAR(255),
ChassisNumber VARCHAR(255),
EngineNumber VARCHAR(255),
ManufacturingYear INT,
LoadCarryingCapacity DECIMAL(10, 2),
MakeOfVehicle VARCHAR(255),
ModelNumber VARCHAR(255),
BodyType VARCHAR(255),
OrganisationName VARCHAR(255),
DeviceID INT,
UserID INT,
FOREIGN KEY (DeviceID) REFERENCES Devices(DeviceID),
FOREIGN KEY (UserID) REFERENCES Users(UserID)
);