Example: quiz answers

Introduction to Database Systems - unibz

1 Introduction to Database SystemsFundamental ConceptsWerner Nutt2 Characteristics of the DB Approach Insulationof application programsand datafrom each other Use of a catalogueto store the schema Support of multiple user views How can one realise these principles?3A DBMS Presents Programmers and Users with a Simplified EnvironmentUsers/ProgrammersQueries / Application ProgramsSoftware to Process Queries / ProgramsSoftware to Access Stored DataDBMS SoftwareDatabase SystemStored Database Definition(Metadata)StoredDatabase Catalogue , Data dictionary 4 Data Model, Schema and InstanceSchema A formal definition that fixes all the relevant featuresof those parts of the real world that are of interest to the users of the Database The schema of a db is held in the data dictionaryData Model A set of concepts that can be used to describ

4 Data Model, Schema and Instance Schema • A formal definition that fixes all the relevant features of those parts of the real world that are of interest to the users of the database

Tags:

  Database, Introduction, System, Introduction to database systems

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Introduction to Database Systems - unibz

1 1 Introduction to Database SystemsFundamental ConceptsWerner Nutt2 Characteristics of the DB Approach Insulationof application programsand datafrom each other Use of a catalogueto store the schema Support of multiple user views How can one realise these principles?3A DBMS Presents Programmers and Users with a Simplified EnvironmentUsers/ProgrammersQueries / Application ProgramsSoftware to Process Queries / ProgramsSoftware to Access Stored DataDBMS SoftwareDatabase SystemStored Database Definition(Metadata)StoredDatabase Catalogue , Data dictionary 4 Data Model, Schema and InstanceSchema A formal definition that fixes all the relevant featuresof those parts of the real world that are of interest to the users of the Database The schema of a db is held in the data dictionaryData Model A set of concepts that can be used to describe the structureof a Database .

2 The data types, relationships, constraints, semantics and operational behaviour Hides details of data storageStudent(studno,name,address)Cours e(courseno,lecturer)Student(123,Egger,Bo zen)Course(CS321,Nutt)Schema(in relational data model)Instance5 Relational model is goodfor: Large amounts of data and simple operations Limited navigation, touching only small numbers of relations/tablesDifficultapplications for relational model: VLSI design (CAD in general) CASE Graphical data Bill of materials, transitive closureALUCPUALUADDERADDERAFAADDERO ther Data Models6 Object Data ModelsWhere number of relations is large, relationships are complex Object Data Model Knowledge Data Model (= Objects + Deductive Rules)Object Data Model(Principles)1.

3 Complex Objects Nested Structure (pointers or references)2. Encapsulation, set of methods/access functions3. Object Identity4. Inheritance Defining new classes like old classesObject model: usually, objects are found via explicit query language in some Documents<addresses> <person> <name>Donald Duck</name> <tel>0471- 82 81 45 </tel> <tel>332- 82 88 283 Mouse</name> <tel>0473 42 61 14 </tel> </person> </addresses>8 XML TerminologyThe segment of an XML document between an opening and a corresponding closing tag is called an element<person> <name>Donald Duck</name> <tel>0471- 82 81 45</tel> <tel>332- 82 88 a sub-element ofnot an element9 XML Documents are Trees XML documents are abstractly modeled as trees.

4 As reflected by their nestingpersonnameemailteltelDonald Duck0471- 82 81 45332- 82 88 version=" " encoding="ISO-8859-1"?> <catalog> <cd country="UK"> <title>Dark Side of the Moon</title> <artist>Pink Floyd</artist> <price> </price> </cd> <cd country="UK"> <title>Space Oddity</title> <artist>David Bowie</artist> <price> </price> </cd> <cd country="USA"> <title>Aretha: Lady Soul</title> <artist>Aretha Franklin</artist> <price> </price> </cd> </catalog>An XML document11 Document Type Definition (DTD)DTDs specify the format of documents<!DOCTYPE catalog [<!ELEMENT catalog (cd*)> <!]

5 ELEMENTcd (title, artist, price)> <!ELEMENT title (#PCDATA)> <!ELEMENT artist (#PCDATA)> <!ELEMENT price (#PCDATA)> <!ATTLIST person country CDATA ID #IMPLIED>]>an arbitrary number of CDsa title, followed by anartist, followed by a pricetitle, artist, and pricecontain parsablecharacter dataA person element can havean (optional) country artist pricetitle artist pricetitle artist pricecountrycountryUKUKUSADark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha XML documentas a treeThe XML documentas a tree13 XPath.

6 An XML Query Language XPath expressions are evaluated over documents XPath operates on the abstract tree documentstructure Documents are trees with several types of nodes, such as elementnodes attributenodes textnodes14 XPath: Path Expressions areMain Element of Syntax / at the beginning of an XPathexpression represents the root of the document /between element names represents a parent-child relationship //represents an ancestor-descendent relationship @marks an attribute [condition]specifies a artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha.

7 Lady SoulPink FloydDavid Bowie Aretha the root element of the artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha child artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha descendant artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha [price<10]Condition on artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha represents any directed path in the document/ artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha.

8 Lady SoulPink FloydDavid Bowie Aretha ** represents any element name in the artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha */*What will the followingexpressions return?//*//*[price= ]//*[price= ]/*USA* represents any element name in the artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha @ marks artist pricetitle artist pricetitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha: Lady SoulPink FloydDavid Bowie Aretha [@country= UK ]@ marks artist pricetitle artisttitle artist pricecountrycountryUKUKDark Side of the MoonSpace Oddity Aretha.

9 Lady SoulPink FloydDavid Bowie Aretha would you write: The price of the cdswhose artist is David Bowie?25 Data ModelsHierarchical 60 s70's80's90 s00 sRelationalChoice for most applications todayObject ModelsKnowledge Bases, RulesNetwork Semistructured Data, XMLS emantic Web, RDF26 Sharing Multiple viewsof dataDatabase Management SystemDatabase27 Three Levels of Abstraction Manyexternal views Oneconceptual(= logical) schema Onephysical(= internal) schema Views describe how users see the data Conceptual schema defines logical structure Physical schema describes the files and indexes usedANSI/SPARC architecture for DBMSs (1978).

10 View 1 View 2 View 3 Conceptual SchemaPhysical Schemamappingsmapping28 Data Independence Logicaldata independence change the logical schemawithout having to change the external schemas Physicaldata independence change the internal schemawithout having to change the logical schemaChange the mapping, not the schema!DatabaseNew hardwareNew functionsNew usersNew storage techniquesLinkage to other databasesNew dataUser's viewChange in useChange in technology29 Database Languages Data Definition Language(DDL) Commands for setting up the schemaof a Database The process of designing a schema can be complex, may use a design methodology and/or tool Data Manipulation Language(DML) Commands to manipulate data in Database : RETRIEVE, INSERT, DELETE, MODIFY Also called query language 30 Host Languages C, C++, Fortran, Lisp, Java, Perl, Python.


Related search queries