1 / 25

Database Systems: A Comprehensive Guide

This book provides a comprehensive guide to database systems, covering various topics such as design, implementation, and management. It is authored by Hector Garcia-Molina.

speth
Télécharger la présentation

Database Systems: A Comprehensive Guide

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML <?xml version="1.0"?> <Book Edition=”1”> <Title>Database systems</Title> <Author>Hector Garcia-Molina</Author> <ISBN>135-383-9038</ISBN> <Price>$100</Price> </Book>

  2. XML Namespace <?xml version="1.0"?> <Book Edition=”1”xmlns=“http://oak.cs.ucla.edu/cs144”> <Title>Database systems</Title> <Author>Hector Garcia-Molina</Author> <ISBN>135-383-9038</ISBN> <Price>$100</Price> </Book>

  3. Multiple Namespace <?xml version="1.0"?> <Book Edition=”1”> <Title>Database systems</Title> <Author>Hector Garcia-Molina</Author> <ISBN>135-383-9038</ISBN> <Price>$100</Price> </Book> • Book, Edition, Title, Author, ISBN: http://oak.cs.ucla.edu/cs144 • Price: http://xml.com/shopping

  4. Multiple Namespace <?xml version="1.0"?> <Book Edition=”1”xmlns=“http://oak.cs.ucla.edu/cs144”> <Title>Database systems</Title> <Author>Hector Garcia-Molina</Author> <ISBN>135-383-9038</ISBN> <Price>$100</Price> </Book>

  5. Multiple Namespace <?xml version="1.0"?> <Book Edition=”1”xmlns=“http://oak.cs.ucla.edu/cs144” xmlns:s=“http://xml.com/shopping”> <Title>Database systems</Title> <Author>Hector Garcia-Molina</Author> <ISBN>135-383-9038</ISBN> <s:Price>$100</s:Price> </Book>

  6. Multiple Namespace <?xml version="1.0"?> <Book o:Edition=”1”xmlns=“http://oak.cs.ucla.edu/cs144” xmlns:s=“http://xml.com/shopping” xmlns:o=“http://oak.cs.ucla.edu/cs144”> <Title>Database systems</Title> <Author>Hector Garcia-Molina</Author> <ISBN>135-383-9038</ISBN> <s:Price>$100</s:Price> </Book>

  7. <a:E1 xmlns:a=“http://a.com/”> <b:E2 xmlns:b=“http://a.com/”> • Q: Do E1 and E2 belong to the same namespace?

  8. <?xml version="1.0"?> <Bookstore> <Book ISBN="0130353000" Price="$65" Ed="2nd"> <Title>First Course in Database Systems</Title> <Author> <First_Name>Jeffrey</First_Name> <Last_Name>Ullman</Last_Name> </Author> </Book> <Book ISBN="0130319953" Price="$75"> <Title>Database Systems: Complete Book</Title> <Author>Hector Garcia-Molina</Author> <Author> <First_Name>Jeffrey</First_Name> <Last_Name>Ullman</Last_Name> </Author> <Remark>It's a great deal!</Remark> </Book> </Bookstore>

  9. ISBN ISBN Price Price Ed Tree Representation Bookstore Book Book Title Author Title Author Author Remark FC FN LN DS HGM FN LN buy… J U J U

  10. DTD <!ELEMENT Bookstore (Book*)> <!ELEMENT Book (Title, Author+, Remark?)> <!ATTLIST Book ISBN CDATA #REQUIRED Price CDATA #REQUIRED Ed CDATA #IMPLIED> <!ELEMENT Title (#PCDATA)> <!ELEMENT Author (#PCDATA| (First_Name, Last_Name))> <!ELEMENT Remark (#PCDATA)> <!ELEMENT First_Name (#PCDATA)> <!ELEMENT Last_Name (#PCDATA)>

  11. Ed ISBN ISBN Price Price Authors Alternative Representation? Bookstore Book Book Author Author Authors Title Title Remark HGM FN LN FC DS buy… J U

  12. Add reference to the authors (IDREF type attribute) Assign a unique “key” to each author (ID type attribute) <?xml version="1.0"?> <Bookstore> <Book ISBN="0130353000" Price="$65" Ed="2nd"> <Title>A First Course in Database Systems</Title> </Book> <Book ISBN="0130319953" Price="$75"> <Title>Database Systems: Complete Book</Title> <Remark>It's a great deal!</Remark> </Book> <Author>Hector Garcia-Molina</Author> <Author> <First_Name>Jeffrey</First_Name> <Last_Name>Ullman</Last_Name> </Author> </Bookstore>

  13. <Author>Hector Garcia-Molina</Author> <Author> <First_Name>Jeffrey</First_Name> <Last_Name>Ullman</Last_Name> </Author> Adding Keys

  14. Adding Keys <Author Ident=“HG”>Hector Garcia-Molina</Author> <Author Ident=“JU”> <First_Name>Jeffrey</First_Name> <Last_Name>Ullman</Last_Name> </Author>

  15. Adding References <Book ISBN="0130353000" Price="$65” Ed="2nd"> <Title>A First Course in Database Systems</Title> </Book> <Book ISBN="0130319953" Price="$75"> <Title>Database Systems: The Complete Book</Title> <Remark>It's a great deal!</Remark> </Book>

  16. Adding References <Book ISBN="0130353000" Price="$65“ Ed="2nd“Authors=“JU”> <Title>A First Course in Database Systems</Title> </Book> <Book ISBN="0130319953" Price="$75" Authors=“HG JU”> <Title>Database Systems: The Complete Book</Title> <Remark>It's a great deal!</Remark> </Book>

  17. Specifying Keys and References in DTD <!ELEMENT Bookstore (Book*, Author*)> <!ELEMENT Book (Title, Remark?)> <!ATTLIST Book ISBN CDATA #REQUIRED Price CDATA #REQUIRED Edition CDATA #IMPLIED> <!ELEMENT Title (#PCDATA)> <!ELEMENT Remark (#PCDATA)> <!ELEMENT Author (#PCDATA| (First_Name, Last_Name))> <!ELEMENT First_Name (#PCDATA)> <!ELEMENT Last_Name (#PCDATA)>

  18. Specifying Keys and References in DTD <!ELEMENT Bookstore (Book*, Author*)> <!ELEMENT Book (Title, Remark?)> <!ATTLIST Book ISBN CDATA #REQUIRED Price CDATA #REQUIRED Edition CDATA #IMPLIED> <!ELEMENT Title (#PCDATA)> <!ELEMENT Remark (#PCDATA)> <!ELEMENT Author (#PCDATA| (First_Name, Last_Name))> <!ATTLIST Author Ident ID #REQUIRED> <!ELEMENT First_Name (#PCDATA)> <!ELEMENT Last_Name (#PCDATA)>

  19. Specifying Keys and References in DTD <!ELEMENT Bookstore (Book*, Author*)> <!ELEMENT Book (Title, Remark?)> <!ATTLIST Book ISBN CDATA #REQUIRED Price CDATA #REQUIRED Edition CDATA #IMPLIED Authors IDREFS #REQUIRED> <!ELEMENT Title (#PCDATA)> <!ELEMENT Remark (#PCDATA)> <!ELEMENT Author (#PCDATA| (First_Name, Last_Name))> <!ATTLIST Author Ident ID #REQUIRED> <!ELEMENT First_Name (#PCDATA)> <!ELEMENT Last_Name (#PCDATA)>

  20. XML Schema Example XML document <?xml version=“1.0”?> <Book>Web App</Book>

  21. Example DTD <!ELEMENT Book (Title, Author+, Remark?)> <!ELEMENT Title (#PCDATA)> <!ELEMENT Remark (#PCDATA)> <!ELEMENT Author (#PCDATA)> <!ATTLIST Book ISBN CDATA #REQUIRED Edition CDATA #IMPLIED>

  22. key/keyref Example <Bookstore> <Book><ISBN>103</ISBN></Book> <Book><ISBN>104</ISBN></Book> <Review isbn=”103”>Great!</Review></Bookstore> • ISBN value should be unique among all Books • Review’s isbn attribute is a foreign key to Book ISBN

  23. XPath Example <AAA>      <BBB aaa="111" bbb="222">           <CCC/>           <CCC xxx="555" yyy="666" zzz="777"/>      </BBB>      <BBB aaa="999">           <CCC xxx=“ww"/>           <DDD xxx="ww"> <CCC>35</CCC> <EEE/> </DDD>     </BBB>      <BBB/> </AAA>

  24. XML to Relation (1) <!ELEMENT Book (Title, Author, Remark)> <!ELEMENT Title (#PCDATA)> <!ELEMENT Author (First_Name, Last_Name, Bio)> <!ELEMENT First_Name (#PCDATA)> <!ELEMENT Last_Name (#PCDATA)> <!ELEMENT Bio (#PCDATA)> <!ELEMENT Remark (#PCDATA)> <!ATTLIST Book ISBN CDATA #REQUIRED Price CDATA #REQUIRED>

  25. XML to Relation (2) <!ELEMENT Book (Title, Author+, Remark*)> <!ELEMENT Title (#PCDATA)> <!ELEMENT Author (First_Name, Last_Name, Bio)> <!ELEMENT First_Name (#PCDATA)> <!ELEMENT Last_Name (#PCDATA)> <!ELEMENT Bio (#PCDATA)> <!ELEMENT Remark (#PCDATA)> <!ATTLIST Book ISBN CDATA #REQUIRED Price CDATA #IMPLIED>

More Related