-
Notifications
You must be signed in to change notification settings - Fork 0
/
QLHH_Scripts.sql
61 lines (61 loc) · 4.21 KB
/
QLHH_Scripts.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
USE [QLHH]
GO
/****** Object: Table [dbo].[Nhacungcap] Script Date: 9/20/2024 9:40:22 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Nhacungcap](
[maNCC] [varchar](5) NOT NULL,
[tenNCC] [varchar](20) NULL,
[trangthai] [numeric](2, 0) NULL,
[thanhpho] [varchar](30) NULL,
CONSTRAINT [PK_Nhacungcap] PRIMARY KEY CLUSTERED
(
[maNCC] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Phutung] Script Date: 9/20/2024 9:40:22 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Phutung](
[maPT] [varchar](5) NOT NULL,
[tenPT] [varchar](10) NULL,
[mausac] [varchar](10) NULL,
[khoiluong] [float] NULL,
[thanhpho] [varchar](30) NULL,
CONSTRAINT [PK_Phutung] PRIMARY KEY CLUSTERED
(
[maPT] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[Vanchuyen] Script Date: 9/20/2024 9:40:22 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Vanchuyen](
[maNCC] [varchar](5) NOT NULL,
[maPT] [varchar](5) NOT NULL,
[soluong] [numeric](5, 0) NULL,
CONSTRAINT [PK_Vanchuyen] PRIMARY KEY CLUSTERED
(
[maNCC] ASC,
[maPT] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Vanchuyen] WITH CHECK ADD CONSTRAINT [FK_Vanchuyen_Nhacungcap] FOREIGN KEY([maNCC])
REFERENCES [dbo].[Nhacungcap] ([maNCC])
GO
ALTER TABLE [dbo].[Vanchuyen] CHECK CONSTRAINT [FK_Vanchuyen_Nhacungcap]
GO
ALTER TABLE [dbo].[Vanchuyen] WITH CHECK ADD CONSTRAINT [FK_Vanchuyen_Phutung] FOREIGN KEY([maPT])
REFERENCES [dbo].[Phutung] ([maPT])
GO
ALTER TABLE [dbo].[Vanchuyen] CHECK CONSTRAINT [FK_Vanchuyen_Phutung]
GO