-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStockManagementSystem.sql
More file actions
91 lines (87 loc) · 5.25 KB
/
StockManagementSystem.sql
File metadata and controls
91 lines (87 loc) · 5.25 KB
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
USE [StockManagementSystem]
GO
/****** Object: Table [dbo].[Category] Script Date: 7/26/2018 5:48:20 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Category](
[SL] [int] IDENTITY(1,1) NOT NULL,
[CategoryName] [varchar](100) NULL,
CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED
(
[SL] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Company] Script Date: 7/26/2018 5:48:20 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Company](
[SL] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
[CompanyName] [varchar](200) NOT NULL,
CONSTRAINT [PK_Company_1] PRIMARY KEY CLUSTERED
(
[SL] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Item] Script Date: 7/26/2018 5:48:20 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Item](
[ItemNo] [int] IDENTITY(1,1) NOT NULL,
[CategorySL] [int] NOT NULL,
[CompanySL] [int] NOT NULL,
[ItemName] [varchar](150) NULL,
[ReorderLevel] [int] NULL,
CONSTRAINT [PK_Item] PRIMARY KEY CLUSTERED
(
[ItemNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[StockIn] Script Date: 7/26/2018 5:48:20 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[StockIn](
[StockInNo] [int] IDENTITY(1,1) NOT NULL,
[CompanySL] [int] NULL,
[ItemNo] [int] NULL,
[Reorderlevel] [int] NULL,
[AvailableQuantity] [int] NULL,
[StockInQuantity] [int] NULL,
CONSTRAINT [PK_StockIn] PRIMARY KEY CLUSTERED
(
[StockInNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Item] WITH CHECK ADD CONSTRAINT [FK_Item_Company] FOREIGN KEY([CompanySL])
REFERENCES [dbo].[Company] ([SL])
GO
ALTER TABLE [dbo].[Item] CHECK CONSTRAINT [FK_Item_Company]
GO
ALTER TABLE [dbo].[StockIn] WITH CHECK ADD CONSTRAINT [FK_StockIn_Item1] FOREIGN KEY([CompanySL])
REFERENCES [dbo].[Company] ([SL])
GO
ALTER TABLE [dbo].[StockIn] CHECK CONSTRAINT [FK_StockIn_Item1]
GO