* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download MIS515.6b
Open Database Connectivity wikipedia , lookup
Relational algebra wikipedia , lookup
Ingres (database) wikipedia , lookup
Concurrency control wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
ContactPoint wikipedia , lookup
Clusterpoint wikipedia , lookup
Versant Object Database wikipedia , lookup
Meltem Özturan misprivate.boun.edu.tr/ozturan/mis515 1 2 1 Designing Databases A database is an integrated collection of stored data that is centrally managed and controlled. Database management system is a systems software that manages and controls access to a database. A database consists of two related stores of infomation; 1.Physical data store : The storage area used by a database management system to store the raw bits and bytes of a database 2.Schema : Contains additional information about the data stored in the physical data store including; 1. 2. 3. Access and content controls Relationships among data elements and groups of data elements Details of physical data store organization 3 Designing Databases A DBMS has four key components; 1. An application program interface (API) 2. A query interface 3. An administrative interface 4. An underlying set of data access programs and subroutines 4 2 Database Models DBMSs have evolved through a number of stages since their introduction. The most significant change has been the type of model used to represent and access the content of the physical data store. Four such model types have been widely used; 1.Hierarchical 2.Network 3.Relational * 4.Object-oriented * 5 Database Models •Hierarchical : Represents data using sets of records organized into a hierarchy •Network :Groups data elements into sets of records but allows those records to be organized into more flexible network structures •Relational : Stores data in tables •Object-oriented : Stores data as objects or class instances 6 3 Relational Model A relational database management system (RDBMS) is a DBMS that stores data in tables . Table : A two-dimensional data sturucture containing rows and columns; also called a relation Row : The portion of a table containing data that describe one netity, relationship, or objcet; also called a tuple or record Field : A column of a relational database table; also called an attribute 7 Relational Model Field Value : The data value stored in a single cell of a relational database table; also called an attribute value or data element Key : A field that contains a value that is unique within each row of a relational database table Primary Key : A key used to uniquely identify a row of a relational database table Foreign Key : A field value stored in one relational database table that also exits as a primary key value, in another relational database table 8 4 Relational Model Designing Relational Databases 1. Create table for each entity 2. Choose a primary key for ecah table (invent one, if necessary) 3. Add foreign keys to represent one-to-many relationships 4. Create new tables to represent many-to-many relationships 5. Define referential integrity constraints (a consistent relational database state in which every foreign key value also exists as a primary key value) 9 Relational Model Designing Relational Databases 6. Evaluate schema quality and make necessary improvements • Uniqueness of table rows and primary keys • Lack of redundant data Normalization : A process that ensures relational database schema quality by minimizing data redundancy • 7. Ease of implementing future data model changes Choose appropriate data types and value restrictions (if necessary) for each field 10 5 Object-Oriented Model An object database management system (ODBMS) is a DBMS that stores data as objects or class instances Object Definition Language (ODL) is a standard object database descripion language for describing the structure and content of an object database. 11 Object-Oriented Model Designing Object Databases 1. Determine which classes require persistent storage 2. Define persistent classes 3. Represent relationships among persistent classes 4. Choose appropriate data types and value restrictions (if necessary) for each field 12 6 Object-Oriented Model Representing Classes Objects can be classified into two broad types for purposes of data management; Transient object : An object that doesn’t need to store any attribute values between instantiations or method invocations Persistent object : An object that must store one or more attribute values between instantiations or method invocations An object database schema includes a definition for each class that requires persistent storage. ODL class definitions can derive from the corresponding UML class diagram. 13 Object-Oriented Model Representing Relationships Each object stored within an ODBMS is automatically assigned a unique object identifier. Object identifers are used to relate objects of one class to objects of another class. An ODBMS represents relationships by storing the identifier of one object within related objects. The ODBMS uses attributes containing object identifiers to find objects that are realted to other objects. The process of extracting an object identifier from one object and using it to access another object is called navigation. 14 7 Object-Oriented Model Representing Relationships The keyword relationship is used to declare a relationship between one class and another. (one-to-one, one-to-many, many-to-many) An association class is a class that represents a relationship and stores the attributes of that relationship. Generalization relationships show a generalization hierarchy from the class diagram. Key attributes are not required in an object database since referential integrity is implemented with object identifiers, however they are useful in guaranteeing unique object content and providing a means of querying database contents. 15 Hybrid Object-Relational Model Hybrid object-relational model is a relational database management system used to store object attributes and relationships. It is also called hybrid DBMS and mixes elements of both the relational and OO approaches. 16 8