【正文】
datetime not null, storgeoutamount int check(storgeoutamount0), storgeouttime datetime not null )。 表八 價格調(diào)整表create table priceadjust( pno char(5) not null, productiondatetime datetime not null, oldprice int not null check(oldprice0), newprice int not null check(newprice0) )。. 創(chuàng)建一個存儲過程修改商品的保質(zhì)期create procedure pro_ modifydatetime as begin update products set pvaliddate=pvaliddate+3。 return endgo出倉:create proc material_out_pro chudan_no int,kehu_no varchar(10),material_no varchar(10),out_data datetime,chu_qty bigint,kehu_pay bigint,staff_no varchar(10),out varchar(20)=39。 return end end觸發(fā)器設(shè)計1.2.3.4.5.6.... 創(chuàng)建觸發(fā)器,限制只能在工作日對該表進行插入操作create trigger tri_products_insert before insert on products begin if to_char(sysdatetime,39。)。p00139。,6,2)。,39。,39。西安39。)。,39。西安盱眙39。,39。s00139。商品編號倉庫編號生產(chǎn)日期入庫量入庫時間 Insert into storgein values(39。)。,20, 39。,1000,50,8)。u00139。insert into users values(39。)。11139。,39。,12,)。delete from products where pno=39。 查詢商品編號為p001的倉庫詳細信息 select * from warehouses where wno =( select wno from totalstorge where pno=39。select * from users。通過這次課程設(shè)計,加深了我對數(shù)據(jù)庫的理解。一家企業(yè)的商品越多、種類越多、聯(lián)系越緊密,所需要做的統(tǒng)計工作就越多,庫存管理的工作難度就會越大。execute pro_adjustprice。 查詢供應(yīng)商名稱中帶有‘薯片’的商品記錄 select * from products where pname like 39。 where pno=39。 想商品表中添加一條產(chǎn)品記錄 insert into products values(39。,39。喬歡39。,39。1234539。,39。商品編號倉庫編號庫存上限庫存下限 insert into totalstorge values(39。,39。, 39。20161225 12:5639。)。 insert into providers values(39。s00239。,39。,39。w00239。 insert into warehouses values(39。清風(fēng)抽紙39。 insert into products values(39。產(chǎn)品表中的信息不能刪除39。,39。 return end else begin if chu_qty(select qty from cunhuo where material_no=material_no) begin select out=39。 outputas DECLARE n1 int select n1=count(material_no) from material where material_no=material_no if (n1=0) begin select out=39。系統(tǒng)關(guān)鍵技術(shù)實現(xiàn)123456存儲過程設(shè)計1.2.3.4.5.6... 創(chuàng)建一個存儲過程將所有的商品價格都增加一元create procedure pro_adjustprice as begin update products set pprice=pprice+1。 表七總庫存表 create table totalstorge( pno char(5) not null, wno char(5) not null, total int, storgeupper int not null check(storgeupper0), storgelower int not null check(storgelower0) )。 表五入庫表 create table storgein( pno char(5) not null, wno char(5) not null, productiondatetime datetime not null, storgeinamount int not null check(storgeinamount0), storgeintime datetime not null )。聯(lián)合主鍵Productiondate生產(chǎn)日期Date 聯(lián)合主鍵Supplydate供應(yīng)日期DateNot nullSupplyamount供應(yīng)量IntNot null ,0. 入庫表(storgein)字段名稱含義字段類型約束Pno商品編號Char(5)外鍵,引用products表的pno字段;聯(lián)合主鍵Wno倉庫編號Char(5)外鍵,引用warehouses表的wno字段;聯(lián)合主鍵Productiondate生產(chǎn)日期Date聯(lián)合主鍵Storgeinamount入庫量IntNot nullStorgeintime入庫時間DateNot null. 出庫表(storgeout)字段名稱含義字段類型約束Pno商品編號Char(5)產(chǎn)品出現(xiàn)缺貨、超儲、接近或超過有效期限時系統(tǒng)需報警。 入庫管理 入庫管理,庫存管理員根據(jù)庫存情況將采購計劃反映給采購員,經(jīng)批準(zhǔn)后采購員將從供應(yīng)商處訂貨。使用該數(shù)據(jù)庫系統(tǒng)時提供其工號和密碼登錄即可自由進行其相應(yīng)權(quán)限內(nèi)的操作。處于社會經(jīng)濟技術(shù)快速發(fā)展的今天各種各樣的行業(yè)競爭日益激烈。這就需要我們開發(fā)一個商場資源管理系統(tǒng)來很大程度上減少這些問題的發(fā)生,而且還可以減少資源和不必要的浪費。因此開發(fā)一套能夠為商場工作人員提提供方便的庫存管理系統(tǒng)數(shù)據(jù)庫的設(shè)計將是非常必要