Tài liệu Database Fundamentals by Robert J. Robbins docx

31 374 1
Tài liệu Database Fundamentals by Robert J. Robbins docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Database Fundamentals: 1File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Database Fundamentals Robert J. Robbins Johns Hopkins University rrobbins@gdb.org Database Fundamentals: 2File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins What is a Database? General: • A database is any collection of related data. Restrictive: • A database is a persistent, logically coherent collection of inherently meaningful data, relevant to some aspects of the real world. The portion of the real world relevant to the database is sometimes referred to as the universe of discourse or as the database miniworld. Whatever it is called, it must be well understood by the designers of the database. Database Fundamentals: 3File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins What is a Database Management System? A database management system (DBMS) is a collection of programs that enables users to create and maintain a database. According to the ANSI/SPARC DBMS Report (1977), a DBMS should be envisioned as a multi-layered system: Conceptual Schema Physical Database Internal Schema External View 1 • • • • •• • • • • External View n External Level (individual user views) Conceptual Level (Enterprise-wide view\) Internal Level (storage view) Storage Level (physical storage) Database Fundamentals: 4File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins What Does a DBMS Do? Database management systems provide several functions in addition to simple file management: • allow concurrency • control security • maintain data integrity • provide for backup and recovery • control redundancy • allow data independence • provide non-procedural query language • perform automatic query optimization Database Fundamentals: 5File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Who Interacts with a DBMS? Many different individuals are involved with a database management system over its life: • systems analysts • database designers • database administrators • application developers • users Database Fundamentals: 6File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Components of a Database System DML Processor Application Programs Direct User Queries Database Description Tables DDL Compiler Database Administrator Concurrent Access Tables Authorization Tables File Manager Database Manager Physical System Database Metadata Database System Catalog Database Fundamentals: 7File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Relational Database Model What is a relational database? • a database that treats all of its data as a collection of relations What is a relation? • a kind of set • a subset of a Cartesian product • an unordered set of ordered tuples Database Fundamentals: 8File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Basic Set Concepts any collection of distinct entities of any sort. SET a set of ordered pairs, produced by combining each element of one set with each element of another set. CARTESIAN PRODUCT a subset of a Cartesian productRELATION examples A = { 1,2,3,4,5,6 } B = { H,T } C = { R,B } D = { Grant, Sherman, Lee } example B x C = { <H,R>,<H,B>,<T,R>,<T,B> } example Q = { <H,R>,<H,B> } Note: Cartesian products may be generated by multiplying any number of sets together. The actual number of sets involved in a particular case is said to be the “ degree ” or “ arity ” of that Cartesian product. Note: Relations may be of any degree (arity). Database Fundamentals: 9File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Basic Set Concepts A set is usually indicated by including a comma- delimited list of the names its members within a pair of wavy brackets: R = { 1,2,3,4,5,6 } G = { Marshall, Eisenhower, Bradley } The members of a set are unordered . Two sets are considered equivalent if and only if they contain exactly the same members, without regard for the order in which the members are listed. R = { 1,2,3,4,5,6 } = { 3,2,1,6,4,5 } G = { Marshall, Eisenhower, Bradley } = { Bradley, Marshall, Eisenhower } Database Fundamentals: 10File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Basic Set Concepts Order must be maintained in ordered n-tuples. Two tuples are considered different if they contain the same members in a different order. S = < 2,4 > ≠≠ < 4,2 > C = < Marshall, Eisenhower, Bradley > ≠≠ < Bradley, Eisenhower, Marshall > An ordered double (or triple or quadruple or n- tuple) is usually indicated by including a comma- delimited list of the names its members within a pair of pointed brackets: S = < 2,4 > C = < Marshall, Eisenhower, Bradley > A set may consist of an unordered collection of ordered tuples. For example, we could imagine the set of all ordered pairs of integers, such that the first element is the square root of the second element. R = { <1,1>,< 2,4 >,<3,9> } As this ellipsis indicates, sets can be infinite in size. However, sets that are actually represented in a database must be finite. [...]... Conceptual Database (relational) Physical Database File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins External View n The entity-relationship approach (Chen, 1976) improved the mapping between the semantics of a database design and that portion of the real world being modeled with the data Codd’s relational model (1970) provided the first formal basis for database design Database Fundamentals: ... 1994, 1995 Robert Robbins Database Fundamentals: 29 E-R Data Model: Graphical Conventions Class hierarchies (“ISA” hierarchies) can be indicated as below: Person 1:n ISA 1:n 1:n 1:n Faculty 1:n Staff Student 1:n 1:n ISA ISA 1:n 1:n Tenured 1:n Untenured File: N_drive:\jhu\class\1995\db-fund.ppt 1:n 1:n 1:n Temporary Graduate © 1994, 1995 Robert Robbins 1:n Undergraduate 1:n Nondegree Database Fundamentals: ... File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Database Fundamentals: 22 The E-R Data Model Different needs for access and use of the database can be supported through different user views External View 1 External View n ••••• Logical data independence occurs here Conceptual Database Physical data independence occurs here Physical Database Definition and mapping written in data definition... relations Smith Robert L 1154 Elm Street Glendale MD 21200 Smith Judy F 1154 Elm Street Glendale MD 21200 Jones Greg G 765 Cedar Lane Towson MD 21232 Harris Lloyd K 2323 Maple Dr Towson MD 21232 • • • • • • Ziegler • • • Fred File: N_drive:\jhu\class\1995\db-fund.ppt • • • K • • • 7272 Cherry Ln © 1994, 1995 Robert Robbins • • • Baltimore • • • MD • • • 21208 Database Fundamentals: 15 Relations as a Database. .. language Implemented on physical devices, using a commercial database product File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Database Fundamentals: 23 The E-R Data Model Layers may be added to a conceptual design in order to increase the semantic richness available at the top design level External View 1 ••••• Conceptual Database (E-R) Although the E-R approach does not require... N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Database Fundamentals: 16 Relations as a Database An essential attribute of a relation is that every tuple must be unique This means that the values present in some individual attribute (or set of attributes) must always provide enough information to allow a unique identification of every tuple in the relation In a relational database, these identifying values... capture the semantics of the database domain If a commercial relational database system is used, mapping from a relational conceptual model to the physical database should be relatively straightforward Physical Database © 1994, 1995 Robert Robbins Database Fundamentals: 25 E-R Data Model: Graphical Conventions Sets of real-world entities are represented with named rectangles: Faculty Departments Students... One-to-many: (optional) Entity Set A File: N_drive:\jhu\class\1995\db-fund.ppt n 1:1 1:1 © 1994, 1995 Robert Robbins Database Fundamentals: 27 E-R Data Model: Examples Faculty and departments entities could be related by a many-to-many “member-of” relationship: Departments m member of n Faculty They could also be related by a one-to-one “chairman-of” relationship: Departments 1,1 chairman of 0,1 Faculty The “1,1”... include more useful manipulations: • outer join • outer union File: N_drive:\jhu\class\1995\db-fund.ppt © 1994, 1995 Robert Robbins Database Fundamentals: 20 Relational Database Normal Forms Considerable study has been made of the properties of relations as they affect the behavior of relational databases The results of these studies are captured in the definition of normal forms First Normal Form: • A relation... } © 1994, 1995 Robert Robbins Database Fundamentals: 11 Relation: Subset of a Cartesian Product Set R Set B 1 1 2 2 3 3 4 4 5 5 6 6 A Cartesian product of two sets can be generated by combining every member of one set with every member of the other set This results in a complete set of ordered pairs, . Database Fundamentals: 1File: N_drive:jhuclass1995db-fund.ppt © 1994, 1995 Robert Robbins Database Fundamentals Robert J. Robbins Johns Hopkins. University rrobbins@gdb.org Database Fundamentals: 2File: N_drive:jhuclass1995db-fund.ppt © 1994, 1995 Robert Robbins What is a Database? General: • A database

Ngày đăng: 20/02/2014, 05:21

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan