邓迪 2016270408
1、ER图
2、脚本
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,
[电话] [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
[图片上传中...(01.png-29c399-1524474477986-1)]