|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
导致了一个使用几乎和mSQL一样的API接口的用于他们的数据库的新的SQL接口的产生,这样,这个API被设计成允许为用于mSQL而写的第三方代码更容易移植到MySQL。数据|数据库
TakeAssessment:Exercise1
RelationalDatabases
DesignthefollowingtwotablesandturninyoursubmissionsinanHTMLfilenamedBookPublisher.html.
BOOK:
PrimaryAuthor
Title
ISBN
PublisherID
Edition
DateofPublication
Price
BookDescription
PUBLISHER:
PublisherID
Name
Address
PartI
1.Identifythekeysinyourtablesasfollows.Forthisexercise,ignoretheperformanceconsiderationswhilechoosingyourkeys.
1.Foreachtable,indicatethePrimaryKey(s)(PKs).IfthereisnoPK,stateso.Fullyjustifyyouranswer.
2.Foreachtable,indicatetheAlternateKey(s)(AKs).IfthereisnoAK,stateso.Fullyjustifyyouranswer.
3.Foreachtable,identifytheForeignKey(s)(FKs)andtheintegrityconstraints.Fullyjustifyyouranswer.
2.Listallcolumnsofyourtables,andthedomains(thedatatypesandformats)ofthesecolumns.Fullyjustifyyouranswer.
InanHTMLtable,listatleastfourrowswithvalidvaluesineachofthetables.TurninyoursubmissioninafilenamedBookPublisher.html.
PartII
WriteSQLstatementsasspecifiedbelow.YoumayfindthishelponsettingupyourDBMSuseful.SubmityourSQLstatementsinafilenamedcreateDB.sql.
1.WritetheDDLstatementstocreatethetwotablesusingtheCREATETABLEstatement.Besuretoidentifyyourprimarykeysandalternatekeysinthestatement.
2.WritetheINSERTstatementstoinsertthefourrowsintoeachtable.
3.WritetheSQLstatementtoretrievethetitleandpriceofallbookspublishedbyeitheroftwopublishers(say"AddisonWesley"and"McGrawHill").InthefileRel-ops.txt,listwhichrelationaloperationsyouused,fromamongtheselect/project/joinoperations,inordertoperformthisquery.Explaintheroleofeachoperationinyourquery.
4.WritetheSQLstatementtoretrievethePublishernameofaparticularbooktitle(say"FundamentalsofDatabaseSystems").
PartIII
Inthefilenamedpart3.txt,provideanswerstothefollowingquestions.
1.In1.2.2RelationalOperations,therewasanexampleofthesetdifferenceoperation:theresultofr-swasprovidedtoyou.Providetheresultofthesetdifferenceoperations-r.
2.Intheclassnotes,thefollowingUNIONexamplewasdiscussed.Giveaprosaicdescriptionoftheresultsthatwillberetrievedbyreplacing
UNION
withEXCEPTinthefollowingquery:
3.(SELECTMemNo
4.FROMMEMBER,BOOK
5.WHEREMemNo=BorrowerMemNoAND
6.CallNumber=QA76.9.D26C66
7.)
8.
UNION
9.(SELECTMemNo
10.FROMMEMBER,BOOK
11.WHEREMemNo=BorrowerMemNoAND
12.CallNumber=QA76.9.D7E53
13.);
Yoursubmissionforthisexerciseshouldconsistofthefollowingfiles:BookPublisher.htmlandcreateDB.sql,Rel-ops.txt,andpart3.txt.
Tohelpyourselfdoyourbestonthisassessment,consultthisgenerallistofgradingguidelines.
修复过程包含最多4个阶段,在下面描述。在你开始前,你应该cd到数据库目录和检查表文件的权限,确保他们可被运行mysqld的Unix用户读取(和你,因为你需要存取你正在检查的文件)。如果它拒绝你修改文件,他们也必须是可被你写入的。 |
|