当前位置:网站首页>Design of warehouse management database system

Design of warehouse management database system

2022-04-23 19:42:00 X heart

The first 1 Turn off : Database table design - Core table creation

#ÇëÔÚ´ËÌí¼ÓʵÏÖ´úÂë
########## Begin ##########
#ÔÚwarehouse_db¿âÖд´½¨warehouse±í
use warehouse_db;
create table warehouse(
    warehouseId int(11) primary key,
    area int(11) not null,
    phone int(11) not null
);

#ÔÚwarehouse_db¿âÖд´½¨component±í
create table component(
    componentId int(11) primary key,
    componentName varchar(20) not null,
    standard varchar(255) not null,
    price double(10,2) not null,
    `describe` varchar(255) not null
);


#ÔÚwarehouse_db¿âÖд´½¨supplier±í
create table supplier(
    supplyId int(11) primary key,
    name varchar(20) not null,
    address varchar(255) not null,
    phone int(11) not null,
    account bigint(18) not null
);


########## End ##########

The first 2 Turn off : Database table design - Project staff table

# Please add the implementation code here 
########## Begin ##########
# stay warehouse_db Create... In the library project surface 
use warehouse_db;
create table project(
 projectId int(11) primary key,
 projectBudget double(10,0) not null,
 commenceDate datetime not null
);


# stay warehouse_db Create... In the library employee surface 
create table employee(
    employeeId int(11) primary key,
    name varchar(20) not null,
    age int(3) not null,
    designation varchar(20) not null,
    warehouseId int(11) not null,
    leaders varchar(20) not null,
    constraint FK_employee_warehouseId foreign key(warehouseId) references warehouse(warehouseId)
);


########## End ##########

The first 3 Turn off : Database table design - Association table

# Please add the implementation code here 
########## Begin ##########
# stay warehouse_db Create... In the library supply surface 
use warehouse_db;
create table supply(
    supplyId int(11) primary key,
    projectId int(11) not null,
    componentId int(11) not null,
    supplyCount int(11) not null,
    constraint FK_supply_supplyId foreign key(supplyId) references supplier(supplyId),
    constraint FK_supply_projectId foreign key(projectId) references project(projectId),
    constraint FK_supply_componentId foreign key(componentId) references component(componentId)
);


# stay warehouse_db Create... In the library repertory surface 
create table repertory(
    warehouseId int(11) primary key,
    componentId int(11) not null,
    repertoryCount int(11) not null,
    constraint FK_repertory_warehouseId foreign key(warehouseId) references warehouse(warehouseId),
    constraint FK_repertory_component_componentId foreign key(componentId) references component(componentId)
);



########## End ##########

版权声明
本文为[X heart]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231927030641.html