失效链接处理 |
数据库超市信息管理数据库设计课程设计 PDF 下载
本站整理下载:
相关截图:
主要内容:
三、系统实现
1. 数据表的创建语句(最好有注释)
----- 创建SUPERMARKET数据库 -----
CREATE DATABASE SUPERMARKET
GO
----- 创建表GongYingShang 供应商 -----
USE SUPERMARKET
CREATE TABLE GongYingShang
(
G_ID CHAR(50) PRIMARY KEY,
G_NAME VARCHAR(50) NOT NULL,
G_PHONE VARCHAR(50),
G_ADDRESS VARCHAR(50)
)
(表--供应商)
----- 创建表BuMen 部门 -----
USE SUPERMARKET
CREATE TABLE BuMen
(
B_ID CHAR(50) PRIMARY KEY,
B_NAME VARCHAR(50) NOT NULL,
B_OFFICER VARCHAR(50),
B_OFFICE_ADDRESS VARCHAR(50)
)
(表—-部门)
----- 创建表ShangPin 商品 -----
USE SUPERMARKET
CREATE TABLE ShangPin
(
S_ID CHAR(50) PRIMARY KEY,
S_NAME VARCHAR(50) NOT NULL,
S_PRICE VARCHAR(5000),
S_CLASS VARCHAR(50),
B_ID CHAR(50),
B_NAME VARCHAR(50),
FOREIGN KEY (B_ID) REFERENCES BuMen(B_ID)
)
(表—-商品)
----- 创建表JinHuo 进货 -----
USE SUPERMARKET
CREATE TABLE JinHuo
(
J_ID CHAR(50),
J_TIME VARCHAR(50) NOT NULL,
S_ID CHAR(50),
S_NAME VARCHAR(50),
J_NUMBER VARCHAR(50),
J_PRICE VARCHAR(50),
G_ID CHAR(50),
G_NAME VARCHAR(50),
FOREIGN KEY (S_ID) REFERENCES ShangPin(S_ID),
FOREIGN KEY (G_ID) REFERENCES GongYingShang(G_ID)
)
(表—-进货)
----- 创建表YuanGong 员工 -----
USE SUPERMARKET
CREATE TABLE YuanGong
(
Y_ID CHAR(50) PRIMARY KEY,
Y_NAME VARCHAR(50) NOT NULL,
Y_ZHICHENG VARCHAR(50),
Y_PHONE VARCHAR(50),
B_ID CHAR(50),
B_NAME VARCHAR(50),
FOREIGN KEY (B_ID) REFERENCES BuMen(B_ID)
|