2018-12-04

2.4项目报告

1.任务内容

        对实体进行抽象提炼,形成ER图,转换成数据表,最后转变为数据库表,从而完成本系统的数据库设计工作。

2.任务目标

       熟悉VS的开发环境
       熟悉数据库设计方法:实体、ER图、数据表、数据库表等
       理解面向对象的基本概念:类、对象、实例

3.ER图

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

4.数据库脚本

USE [SuperMarketSales]
GO
/****** Object:  Table [dbo].[USERS]    Script Date: 04/18/2018 14:16:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[USERS](
    [ID] [int] NOT NULL,
    [NAME] [varchar](50) NULL,
    [PASSWORD] [varchar](50) NULL,
    [PHONE] [varchar](15) NULL,
 CONSTRAINT [PK_USER] 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
INSERT [dbo].[USERS] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (1001, N'老赵', N'123', N'13333333333')
INSERT [dbo].[USERS] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (1002, N'老钱', N'123', N'13444444444')
INSERT [dbo].[USERS] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (1003, N'老孙', N'123', N'13555555555')
INSERT [dbo].[USERS] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (1004, N'老李', N'123', N'13666666666')
/****** Object:  Table [dbo].[ADMIN]    Script Date: 04/18/2018 14:16:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ADMIN](
    [ID] [int] NOT NULL,
    [NAME] [varchar](50) NULL,
    [PASSWORD] [varchar](50) NULL,
    [PHONE] [varchar](15) NULL,
 CONSTRAINT [PK_ADMIN] 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
INSERT [dbo].[ADMIN] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (2001, N'郭靖', N'123', N'15888888888')
INSERT [dbo].[ADMIN] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (2002, N'张无忌', N'123', N'15999999999')
INSERT [dbo].[ADMIN] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (2003, N'令狐冲', N'123', N'15777777777')
INSERT [dbo].[ADMIN] ([ID], [NAME], [PASSWORD], [PHONE]) VALUES (2004, N'老赵', N'123', N'15666666666')

4.建立数据库表

(1)收银员表(USERS)

2018-12-04_第2张图片
屏幕截图(7).png

(2)库管员表(ADMIN)

2018-12-04_第3张图片
屏幕截图(8).png

5.项目总结

       本次项目通过建立数据表让我们对面向对象的基本概念:类、对象、实例有了更深的理解。

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