资源描述:
《数据库一实验报告》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、构成产品编号cha「⑼零件号ch頭9)制成■零件号char(9)编号char(9)1产品产品编号宀3?面__名称varchar(40)价格numeric(2)生产日期datetime零件零件号cha「⑼规格ch曲40)名称char(40)1存储零件号char⑼char(9)1仓库仓库号cha「(9V电话char(12)主任名char(3)材料编号ch引⑼价格numeric(3)材料名ch刃(40)订单号char(9)存放编号材料库号char⑼char⑻材料库材料库号chs「⑻负责人ch8«3)*//*DBMSname:Microsoft
2、SQLServer6.0*//*Createdon:2012-10-1715:16*/*/*//*Table:PRODUCTS*/createtablePRODUCTSPNUMPNAMEPRICEDATEchar(9)varchar(40)numeric(2)datetimenotnull,notnull,null,nullconstraintPK_PRODUCTSprimarykey(PNUM))*//*Table:PART*/*/createtablePARTPNUMSTANDARPNAMchar(9)char(40)char(40)
3、notnull,nullnotnull,constraintPK_PARTprimarykey(PNUM))go*//*Databasename:MODEL1/*Table:MATERIALS*/createtableMATERIALSMNUMchar(9)notnull,MPRICEnumeric(3)null,MNAMEchar(40)notnull,MORDERchar(9)nullconstraintPK_.MATERIALSprimarykey(MNUM)go/*Table:STORAGE*/*/*/*/createtableS
4、TORAGESNUMPHONENUMSPRINC1PALnotnull,nullnullchar(9)char(12)char(3)constraintPK_STORAGEprimarykey(SNUM))go/*============================================================*//*Table:MSTORAGE*//*二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二*/createtableMSTORAGE(M
5、STORNUMchar(8)notnull,MPRINCIPALchar(3)null,constraintPK_MSTORAGEprimarykey(MSTORNUM))go二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二二*//*Table:FORM*//*————————————————————————————————————————————————————————————*/createtableFORM(PNUMchar(9)notnull,PNUMchar(
6、9)notnull,constraintPK_FORMprimarykey(PNUM,PNUM))go*//*Index:RELATION_43_FK2*/createindexRELATION_43_FK2onFORM(PNUM)goIndex:RELATION43FK*/createindexRELATION_43_FKonFORM(PNUM)*/*/go/*============================================================*//*Table:MAKE*//*===========
7、=================================================*/createtableMAKE(PNUMchar(9)notnull,MNUMchar(9)notnull,constraintPK_MAKEprimarykey(PNUM,MNUM))go/*============================================================*//*Index:RELATION_44_FK2*//*===================================
8、=========================*/createindexRELATION_44_FK2onMAKE(PNUM)go/*===========================