Data Management: Database ApproachLecture: Dec. 09, 2009
DatabaseA database is a collection of interrelated data items that are managed as a single unit.An instance is a copy of the database software running in memory.Database model refers to the way in which a database organizes its data to pattern the real world.
Hierarchy of DataData is generally organized in a hierarchy that begins with the smallest piece of data used by computers (a bit) and progresses through the  hierarchy to a database.A bit(a binary digit) represents a circuit that is either on or off.A byte (8 bits) is an organized unit of bits which represents a character.A character  is the basic building block of information. Characters are put together to form a field.
Hierarchy of data (continued)A field is typically a name,  number, or combination of characters that describe s an aspect of a business object (e.g. an employee, a location, a truck) or activity (e.g. a sale). A A Record  is a collection of related data fields.A file/table is a collection of all related records.A database is a collection of related tables.
Hierarchy of DataFaculty tableDatabase(Schools Database)Student tableGrades tableTables/filesDickinson, Dave 	06-03-06Jackson, Jacob	06-03-06Mayville, Mat	10-03-06(Personal File)Records00136 Dickinson, Dave06-03-06(Record containing ID number, name, and hire date)FieldsDickinson(Last name field)Characters (Byte)100 0100(Letter F in ASCII)
FilesA file is a collection of related records that are stored as a single unit by an operating system.
Difference of Database from filesCharacteristics or properties that databases possess that ordinary files do not have:Management by a Database Management System (DBMS)Layers of data abstractionPhysical data independenceLogical data independence
The Database Management System (DBMS)A group of programs that manipulate the database and provide an interface between the database and the user of the database and other application programs.
DBMS ServicesMoving data to and from the physical data files as needed.Managing concurrent data access by multiple users, including provisions to prevent simultaneous updates from conflicting with one another.Managing transactions so that each transaction’s database changes are an all-or-nothing unit of work. In other words, if the transaction succeeds, all database changes made by it are recorded in the database; if the transaction fails, none of the changes it made are recorded in the database.
DBMS Services (continued)Support for a query language, which is a system of commands that a database user employs to retrieve data from the database.Provisions for backing up the database and recovering from failures.Security mechanisms to prevent unauthorized data access and modification.
Layers of Data AbstractionDatabases have the unique capability of presenting multiple users of the data with their own distinct views of that data while storing the underlying data only once, this are calledUser Views.A userin this context is any person or application that signs on to the database for the purpose of storing and/or retrieving data.An applicationis a set of computer programs designed to solve a particular business problem, such as an order-entry system, a payroll-processing system, or an accounting system.
Database layers of abstractionView 1View 2View nExternal LayerLogical Data IndependenceLogical LayerInternal Schema (Logical Schema)Physical Data IndependencePhysicalLayerDatabase FileDatabase FileDatabase FileDatabase FileDatabase File
The Physical LayerThe physical layer contains the data files that hold all the data for the database.a Database Administrator (DBA) handles the details of installing and configuring the database software and data files and making the database available to the database users.The DBMS works with the computer’s operating system to automatically manage the data files, including all file opening, closing, reading, and writing operations.
The Logical LayerThe logical layer or logical model is the first of two layers of abstraction in the database.The physical layer has a concrete existence in the operating system files, whereas the logical layer exists only as abstract data structures assembled from the physical layer as needed.The DBMS transforms the data in the data files into a common structure. Depending on the particular DBMS, this can be a set of two-dimensional tables, a hierarchical structure similar to a company’s organization chart, or some other structure.This layer is sometimes called the schema, a term used for the collection of all the data items stored in a particular database.
The External LayerThe external layer or external model is the second layer of abstraction in the database.This layer is composed of the user views discussed earlier, which are collectively called the subschema.This is the layer where users and application programs that access the database connect and issue queries against the database. Only the DBA deals with the physical and logical layers.
Physical Data IndependenceThe ability to alter the physical file structure of a database without disrupting existing users and processes.The measure, sometimes called the degree of physical data independence, is how much change can be made in the file system without impacting the logical layer.
The DBMS catalogThe DBMS catalog keeps track of where the objects are physically stored.Examples of physical changes that may be made in a data-independent manner:Moving a database data file from one device to another or one directory to anotherSplitting or combining database data filesRenaming database filesMoving a database object from one data file to anotherAdding new database objects or data files
Logical Data IndependenceThe ability to make changes to the logical layer without disrupting existing users and processes .As with physical data independence, there are degrees of logical data independence. It is important to understand that most logical changes also involve a physical change.Deletion of objects in the logical layer will cause anything that uses those objects to fail but should not affect anything else.
Logical Data IndependenceExamples of changes in the logical layer that can be safely made due to logical data independence:Adding a new database objectAdding data items to an existing objectAny change where a view can be placed in the external model that replaces (and processes the same as) the original object in the logical layer, such as combining or splitting existing objects
Data Entities, Attributes and KeysEntity – a generalized class of people, places, or things for which data is collected, stored and maintained.Attribute – a characteristic of an entity.Data item – the specific value of an attribute.Key – a field or a set of fields in a record that is used to identify the record.Primary key – a field or set of fields in a record that uniquely identifies the record.

Data Management

  • 1.
    Data Management: DatabaseApproachLecture: Dec. 09, 2009
  • 2.
    DatabaseA database isa collection of interrelated data items that are managed as a single unit.An instance is a copy of the database software running in memory.Database model refers to the way in which a database organizes its data to pattern the real world.
  • 3.
    Hierarchy of DataDatais generally organized in a hierarchy that begins with the smallest piece of data used by computers (a bit) and progresses through the hierarchy to a database.A bit(a binary digit) represents a circuit that is either on or off.A byte (8 bits) is an organized unit of bits which represents a character.A character is the basic building block of information. Characters are put together to form a field.
  • 4.
    Hierarchy of data(continued)A field is typically a name, number, or combination of characters that describe s an aspect of a business object (e.g. an employee, a location, a truck) or activity (e.g. a sale). A A Record is a collection of related data fields.A file/table is a collection of all related records.A database is a collection of related tables.
  • 5.
    Hierarchy of DataFacultytableDatabase(Schools Database)Student tableGrades tableTables/filesDickinson, Dave 06-03-06Jackson, Jacob 06-03-06Mayville, Mat 10-03-06(Personal File)Records00136 Dickinson, Dave06-03-06(Record containing ID number, name, and hire date)FieldsDickinson(Last name field)Characters (Byte)100 0100(Letter F in ASCII)
  • 6.
    FilesA file isa collection of related records that are stored as a single unit by an operating system.
  • 7.
    Difference of Databasefrom filesCharacteristics or properties that databases possess that ordinary files do not have:Management by a Database Management System (DBMS)Layers of data abstractionPhysical data independenceLogical data independence
  • 8.
    The Database ManagementSystem (DBMS)A group of programs that manipulate the database and provide an interface between the database and the user of the database and other application programs.
  • 9.
    DBMS ServicesMoving datato and from the physical data files as needed.Managing concurrent data access by multiple users, including provisions to prevent simultaneous updates from conflicting with one another.Managing transactions so that each transaction’s database changes are an all-or-nothing unit of work. In other words, if the transaction succeeds, all database changes made by it are recorded in the database; if the transaction fails, none of the changes it made are recorded in the database.
  • 10.
    DBMS Services (continued)Supportfor a query language, which is a system of commands that a database user employs to retrieve data from the database.Provisions for backing up the database and recovering from failures.Security mechanisms to prevent unauthorized data access and modification.
  • 11.
    Layers of DataAbstractionDatabases have the unique capability of presenting multiple users of the data with their own distinct views of that data while storing the underlying data only once, this are calledUser Views.A userin this context is any person or application that signs on to the database for the purpose of storing and/or retrieving data.An applicationis a set of computer programs designed to solve a particular business problem, such as an order-entry system, a payroll-processing system, or an accounting system.
  • 12.
    Database layers ofabstractionView 1View 2View nExternal LayerLogical Data IndependenceLogical LayerInternal Schema (Logical Schema)Physical Data IndependencePhysicalLayerDatabase FileDatabase FileDatabase FileDatabase FileDatabase File
  • 13.
    The Physical LayerThephysical layer contains the data files that hold all the data for the database.a Database Administrator (DBA) handles the details of installing and configuring the database software and data files and making the database available to the database users.The DBMS works with the computer’s operating system to automatically manage the data files, including all file opening, closing, reading, and writing operations.
  • 14.
    The Logical LayerThelogical layer or logical model is the first of two layers of abstraction in the database.The physical layer has a concrete existence in the operating system files, whereas the logical layer exists only as abstract data structures assembled from the physical layer as needed.The DBMS transforms the data in the data files into a common structure. Depending on the particular DBMS, this can be a set of two-dimensional tables, a hierarchical structure similar to a company’s organization chart, or some other structure.This layer is sometimes called the schema, a term used for the collection of all the data items stored in a particular database.
  • 15.
    The External LayerTheexternal layer or external model is the second layer of abstraction in the database.This layer is composed of the user views discussed earlier, which are collectively called the subschema.This is the layer where users and application programs that access the database connect and issue queries against the database. Only the DBA deals with the physical and logical layers.
  • 16.
    Physical Data IndependenceTheability to alter the physical file structure of a database without disrupting existing users and processes.The measure, sometimes called the degree of physical data independence, is how much change can be made in the file system without impacting the logical layer.
  • 17.
    The DBMS catalogTheDBMS catalog keeps track of where the objects are physically stored.Examples of physical changes that may be made in a data-independent manner:Moving a database data file from one device to another or one directory to anotherSplitting or combining database data filesRenaming database filesMoving a database object from one data file to anotherAdding new database objects or data files
  • 18.
    Logical Data IndependenceTheability to make changes to the logical layer without disrupting existing users and processes .As with physical data independence, there are degrees of logical data independence. It is important to understand that most logical changes also involve a physical change.Deletion of objects in the logical layer will cause anything that uses those objects to fail but should not affect anything else.
  • 19.
    Logical Data IndependenceExamplesof changes in the logical layer that can be safely made due to logical data independence:Adding a new database objectAdding data items to an existing objectAny change where a view can be placed in the external model that replaces (and processes the same as) the original object in the logical layer, such as combining or splitting existing objects
  • 20.
    Data Entities, Attributesand KeysEntity – a generalized class of people, places, or things for which data is collected, stored and maintained.Attribute – a characteristic of an entity.Data item – the specific value of an attribute.Key – a field or a set of fields in a record that is used to identify the record.Primary key – a field or set of fields in a record that uniquely identifies the record.

Editor's Notes

  • #5 PC database often refer to files as tables
  • #10 The DBMS provides all the basic services required to organize and maintain thedatabase, including the following:
  • #17 Prior to systems that offered data independence, even the slightest change to the way datawas stored required the programming staff to make changes to every computer programthat used the data, an expensive and time-consuming process.
  • #19 For example, you cannot add a new databaseobject (such as a table in a relational DBMS) without physically storing thedata somewhere; hence, there is a corresponding change in the physical layer.