智慧商超系统ER图及数据表
脚本文件
USE [store]
GO
/****** Object: Table [dbo].[仓库] Script Date: 04/16/2018 20:06:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[仓库](
[仓库号] [int] NOT NULL,
[地点] varchar NOT NULL,
[面积] [float] NOT 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
/****** Object: Table [dbo].[商品] Script Date: 04/16/2018 20:06:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[商品](
[商品号] [int] NOT NULL,
[仓库号] [int] NOT NULL,
[价格] [float] NOT NULL,
[商品名称] varchar NOT 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
/****** Object: ForeignKey [FK_商品仓库] Script Date: 04/16/2018 20:06:46 ******/
ALTER TABLE [dbo].[商品] WITH CHECK ADD CONSTRAINT [FK商品仓库] FOREIGN KEY([商品号])
REFERENCES [dbo].[仓库] ([仓库号])
GO
ALTER TABLE [dbo].[商品] CHECK CONSTRAINT [FK商品_仓库]
GO