商超E-R图
数据表
分割线
1.仓库商品关系E-R图及数据表
1.1仓库商品关系E-R图
1.2仓库商品数据表
2.商超管理关系E-R图及数据表
2.1商超管理关系E-R图
2.2商超管理数据表
数据库脚本:
USE [Leo]
GO
/****** Object: Table [dbo].[仓库] Script Date: 04/18/2018 18:44:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[仓库](
[仓库号] [int] NOT NULL,
[地点] [varchar](50) NULL,
[面积] [varchar](50) NULL,
CONSTRAINT [PK_仓库] PRIMARY KEY CLUSTERED
(
[仓库号] 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
INSERT [dbo].[仓库] ([仓库号], [地点], [面积]) VALUES (1, N'2', N'2')
/****** Object: Table [dbo].[商品] Script Date: 04/18/2018 18:44:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[商品](
[商品号] [int] NULL,
[商品名] [varchar](50) NULL,
[仓库号] [int] NULL,
[价格] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[商品] ([商品号], [商品名], [仓库号], [价格]) VALUES (1, N'1', 1, 1)
/****** Object: ForeignKey [FK_商品_仓库] Script Date: 04/18/2018 18:44:06 ******/
ALTER TABLE [dbo].[商品] WITH CHECK ADD CONSTRAINT [FK_商品_仓库] FOREIGN KEY([仓库号])
REFERENCES [dbo].[仓库] ([仓库号])
GO
ALTER TABLE [dbo].[商品] CHECK CONSTRAINT [FK_商品_仓库]
GO