资源描述:
《数据库20100373苏浩辉作业四.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、SchoolofEconomics&BusinessAdministrationChongqingUniversityAssignment#04CourseNameDatabasePrincipleandApplicationNameofStudent苏浩辉StudentID20100373Class10信管Major信管InstructorDr.YongLiTutorBowenZhangCompletedTime2012-05-07ScoreDROPTABLERENT;DROPTABLEAGREEMENT;DROPTA
2、BLECUSTOMER;DROPTABLEFILM_DIRECTOR;DROPTABLESTAR_IN;DROPTABLEEDUCATIONAL_FILM;DROPTABLEFOREIGN_FILM;DROPTABLECOPY;DROPTABLEPERFORMER;DROPTABLEFILM;DROPTABLECOPY_TYPE;CREATETABLECUSTOMER(CIDChar(5),FNAMEChar(10)UNIQUENOTNULL,MIDDLEChar(10)NOTNULL,LNAMEChar(10)NOTN
3、ULL,STREETChar(10)NOTNULL,CITYChar(5)NOTNULL,STATE_Char(5)NOTNULL,ZIPChar(10)NOTNULL,PHONEChar(10)UNIQUENOTNULL,BIRTH_YRDATE,ConstraintCUSTOMER_PKprimarykey(CID),);CREATETABLECOPY_TYPE(NAMECHAR(5),PRICECHAR(5)NOTNULL,NIGHTSCHAR(2)NOTNULL,ConstraintCOPY_TYPE_PKpri
4、marykey(NAME),ConstraintNAMECHECK(NAMEIN('VIDEO_TYPE','VCD','DVD')),ConstraintNIGHTSCHECK(NIGHTS>=1ANDNIGHTS<=10),);CREATETABLEPERFORMER(STAGE_NMCHAR(10),NAMECHAR(10),CHRIST_NMCHAR(10),ConstraintPERFORMER_PKprimarykey(STAGE_NM),);CREATETABLEFILM(FILM_IDCHAR(10),T
5、ITLECHAR(10),KINDCHAR(10),RATECHAR(10),ConstraintFOLM_PKprimarykey(FILM_ID),);CREATETABLEFILM_DIRECTOR(FILM_IDCHAR(10)REFERENCESFILM,DIRECTORCHAR(10),ConstraintFILM_DIRECTOR_PKprimarykey(FILM_ID,DIRECTOR),);CREATETABLEFOREIGN_FILM(FILM_IDCHAR(10)REFERENCESFILM,SP
6、OKENCHAR(10),SUBTITLECHAR(10),ConstraintFOREIGN_FILM_PKprimarykey(FILM_ID),);CREATETABLEEDUCATIONAL_FILM(FILM_IDCHAR(10)REFERENCESFILM,AGE_GROUPCHAR(5),ConstraintEDUCATIONAL_FILM_PKprimarykey(FILM_ID),ConstraintAGE_GROUPCHECK(AGE_GROUPIN('infant','child','teenage
7、','adult','senior')),);CREATETABLESTAR_IN(STAGE_NMCHAR(10)referencesPERFORMER,FILM_IDCHAR(10)REFERENCESFILM,ROLE_CHAR(5)NOTNULL,ConstraintSTAR_IN_PKprimarykey(STAGE_NM,FILM_ID),);CREATETABLECOPY(FILM_IDCHAR(10)REFERENCESFILM,COPY_NUMCHAR(10)NOTNULL,NAMECHAR(5)REF
8、ERENCESCOPY_TYPE,CONDITIONCHAR(10)NOTNULL,ConstraintCOPY_PKprimarykey(FILM_ID,COPY_NUM),ConstraintCONDITIONCHECK(CONDITION>=1ANDCONDITION<=5),);CREATETABLEAGRE