Data Models, Schemas, and Instances Data abstraction Suppression of details of data organization and storage Highlighting of the essential features for an improved understanding of data
Data Models, Schemas, and Instances (cont'd.) Data model Collection of concepts that describe the structure of a database Provides means to achieve data abstraction Basic operations • Specify retrievals and updates on the database the dynamic aspect or behavior of a database application. • This allows the database designer to specify a set of valid user-defined operations that are allowed on the database objects. An example of a user-defined operation could be COMPUTE_GPA, which can be applied to a STUDENT object.
Categories of Data Models • High-level or conceptual data models: • Close to the way many users perceive data • Representational (implementation) data models: • Between conceptual model and physical model • Easily understood by end users • hide many details of data storage on disk but can be implemented on a computer system directly • Low-level or physical data models: • provide concepts that describe the details of how data is stored on the computer storage media, typically magnetic disks. • Concepts provided by physical data models are generally meant for computer specialists, not for end users
High-level or conceptual data models • Entity • Represents a real-world object or concept • Attribute • Represents some property of interest • Further describes an entity
• Relationship among two or more entities
• Represents an association among the entities • Example: “Entity-Relationship model”
Categories of Data Models (cont'd.) Relational data model Representational (implementation) data models used most frequently in traditional commercial DBMSs Represent data by using record structures and hence are sometimes called record-based data models.
Categories of Data Models (cont'd.) • Physical data models • Describe how data is stored as files in the computer by representing information such as record formats, record orderings, and access paths • Access path • Structure that makes the search for particular database records efficient • Index • Example of an access path • Allows direct access to data using an index term or a keyword
Schemas, Instances, and Database State • Database schema • Description of a database which is specified during database design. • is not expected to change frequently • Schema diagram • Displayed schema • The diagram displays the structure of each record type but not the actual instances of records. • Schema construct • Each object in the schema such as STUDENT or COURSE • Database state or snapshot • Data in database at a particular moment in time
Database Schema vs. Database State • Database State: • Refers to the content of a database at a moment in time. The actual data stored in a database at a particular moment in time. This includes the collection of all the data in the database. Also called database instance (or occurrence or snapshot). • The term instance is also applied to individual database components, e.g. record instance, table instance • Initial Database State: • Refers to the database state when it is initially loaded into the system. • Every time an update operation is applied to the database, we get another database state • Valid State: • A state that satisfies the structure and constraints of the database. Slide 2- 14
Three-Schema Architecture and Data Independence • The goal of the three-schema architecture is to separate the user applications from the physical database. • Internal level • Describes physical storage structure of the database. • The internal schema uses a physical data model and describes the complete details of data storage and access paths for the database. • Conceptual level • has a conceptual schema • Describes structure of the whole database for a community of users • The conceptual schema hides the details of physical storage structures and concentrates on describing entities, data types, relationships, user operations, and constraints. • External or view level • Describes part of the database that a particular user group is interested in and hides the rest of the database from that user group.
Three-Schema Architecture Mappings among schema levels are needed to transform requests and data. Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution. Data extracted from the internal DBMS level is reformatted to match the user’s external view (e.g. formatting the results of an SQL query for display in a Web page) Slide 2- 20
Data Independence • Capacity to change the schema at one level of a database system • Without having to change the schema at the next higher level • Types: • Logical data independence is the capacity to change the conceptual schema without having to change external schemas or application programs • Physical data independence is the capacity to change the internal schema without having to change the conceptual schema. Hence, the external schemas need not be changed as well.
[FREE PDF sample] (Ebook) Learn PHP 8: Using MySQL, JavaScript, CSS3, and HTML5 by Steve Prettyman ISBN 9781484262399, 9781484262405, 1484262395, 1484262409 ebooks