2018-11-04

在智慧社区商超管理系统中,通常有多种不同角色的人员使用该系统,超市里面有各种各样不同的商品,商品都有不同的供应商。

.1、根据上述语义画出ER图。

2018-11-04_第1张图片
image.png
2018-11-04_第2张图片
image.png

收银员 库管员
工号(PK) 工号(PK)
姓名 姓名
密码 密码
电话 电话
商品 供货商
商品号(PK) 流水号(PK)
商品名称 供应商名称
商品价格 供应商电话
USE [super2017270385]
GO
/****** Object: Table [dbo].[销售表] Script Date: 11/04/2018 16:09:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[销售表](
[id] varchar NOT NULL,
[xssl] [int] NULL,
[time] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[id] 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: 11/04/2018 16:09:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[收银员](
[id] varchar NOT NULL,
[name] varchar NULL,
[xb] varchar NULL,
[mm] varchar NULL,
[tel] varchar NULL,
PRIMARY KEY CLUSTERED
(
[id] 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: 11/04/2018 16:09:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[商品](
[spid] varchar NOT NULL,
[spname] varchar NULL,
[spprice] [float] NULL,
[scrq] [datetime] NULL,
[sccj] varchar NULL,
PRIMARY KEY CLUSTERED
(
[spid] 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: 11/04/2018 16:09:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[录入表](
[id] varchar NOT NULL,
[spsl] [int] NULL,
[time] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[id] 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: 11/04/2018 16:09:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[管理员](
[id] varchar NOT NULL,
[name] varchar NULL,
[xb] varchar NULL,
[mm] varchar NULL,
[tel] varchar NULL,
PRIMARY KEY CLUSTERED
(
[id] 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: 11/04/2018 16:09:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[供货商](
[id] varchar NOT NULL,
[label] varchar NOT NULL,
[spname] varchar NULL,
[lxr] varchar NULL,
[tel] varchar NULL,
PRIMARY KEY CLUSTERED
(
[id] 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

你可能感兴趣的:(2018-11-04)