资源描述:
《数据库20100373苏浩辉作业三.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、SchoolofEconomics&BusinessAdministrationChongqingUniversityAssignment#03CourseNameDatabasePrincipleandApplicationNameofStudent苏浩辉StudentID20100373Class10信管Major信管InstructorDr.YongLiTutorBowenZhangCompletedTime2012-04-16Score1.FILM(Film_ID,Tittle,Kind,Rate)ConstraintTitleUNIQUENOTN
2、ULLConstraintKindIN(‘Classic’,‘Horror’,‘Action’,‘Comedy’,‘Foreign’,‘Educational’,‘Etc’)ConstraintRateNOTNULLFOREIGN_FILM(Film_ID,Language,Subtitle)ConstraintLanguageNOTNULLConstraintSubtitleNOTNULLEDUCATIONAL_FILM(Film_ID,Age_group)ConstraintAge_groupIN(‘infant’,‘child’,‘teenage’,
3、‘adult’,‘senior’)COPY(Film_ID,Copy_No,Condition)Foreignkey(Film_ID)ReferencesFILMConstraintConditionIN(‘1’,‘2’,‘3’,‘4’,‘5’)COPY_TYPE(Name,Price,Nights,Copy_No)Foreignkey(Copy_No)ReferencesCOPYConstraintPriceNOTNULLConstraintNightsBETWEEN1AND10AGREEMENT(AID,Checkout_DT,CID)Constrai
4、ntCheckout_DTNOTNULLForeignkey(CID)ReferencesCUSTOMERRENT(Film_ID,Copy_No,AID)Foreignkey(Film_ID)ReferencesFILMForeignkey(Copy_No)ReferencesCOPYForeignkey(AID)ReferencesAGREEMENTCUSTOMER(CID,First_Name,Middle_Init,Last_Name,Street,City,State,Zip,Phone,Birth_Year)ConstraintFirst_Na
5、meNOTNULLConstraintMiddle_InitNOTNULLConstraintLast_NameNOTNULLConstraintStreetNOTNULLConstraintCityNOTNULLConstraintStateNOTNULLConstraintZipNOTNULLConstraintPhoneNOTNULLConstraintBirth_YearNOTNULLPERFORMER(Stage_Name,Name,Christ_Name)ConstraintNameNOTNULLConstraintChrist_NameNOT
6、NULLTAKE_ROLE(Stage_Name,Film_ID,Role)Foreignkey(Stage_Name)ReferencesPERFORMERForeignkey(Film_ID)ReferencesFILMConstraintRoleIN(‘leadingactor’,‘supportingactor’)2.CUSTOMER(CID,CNAME,ADDRESS,PHONE)ConstraintCNAMEUNIQUENOTNULLConstraintADDRESSNOTNULLConstraintPHONENOTNULLFILM(FILM_
7、ID,TITLE,RATE)ConstraintTITLEUNIQUENOTNULLConstraintRATENOTNULLVIDEO_TYPE(FILM_ID,TAPE_NUM,CONDITION,TYPE,PRICE)Foreignkey(FILM_ID)ReferencesFILMConstraintCONDITIONIN(‘1’,‘2’,‘3’,‘4’,‘5’)ConstraintTYPEIN(‘DVD’,‘VCD’,‘BlueDVD’)ConstraintPRICENOTNULLRENT(CID,FILM_ID,TAPE_NUM,RID,DAT
8、E)Foreignkey(CID)ReferencesCUSTOM