LECTURE1: PRINCIPLES OF DATABASES Ref. Chapter1 Information Systems Department
Chapter1 - Objectives 2 Problems with file-based approach. Database concepts. Database Management System (DBMS). Major components of the DBMS environment. Users involved in the DBMS environment. Advantages and disadvantages of DBMS.
Introduction 3 Examples of Database Applications
File-Based Systems 4 Collection of application programs that perform services for the end users (e.g. reports). Each program defines and manages its own data.
File-Based Systems 5
Limitations of File-Based Approach 6 1. Separation and isolation of data Each program maintains its own set of data. Users of one program may be unaware of potentially useful data held by other programs. 2. Duplication of data Same data is held by different programs. Wasted space and potentially different values and/or different formats for the same item.
Limitations of File-Based Approach 7 3. Data dependence File structure is defined in the program code. Definition of data was embedded in application programs, rather than being stored separately and independently. 4. Incompatible file formats Programs are written in different languages, and so cannot easily access each other s files. Pearson Education 2009
Solution 8 DATABASE APPROACH
Database Approach 9 Main terms: Data Information Database Metadata /System Catalog / data Dictionary Entity Attribute Relationship Database Management System Database Application Program
Database Approach 10 Data: Known facts that can be recorded and have an implicit meaning. Ex: What does 3421 means? Notice there are different types of data numbers, strings, date, time Text, picture, audio, video, graphics
Database Approach 11 Data versus Information Data itself has no meaning without meta data which describes data For example : 1012674, 28761, 153 Does not give us any information, but knowing the meta data that explains data : Staff_ID, Phone Number, room number Staff_ID Phone Number room number 1012674 28761 153 Information : is the data you process in a manner that makes it meaningful. Data is what you store in database Information is what you retrieve from database
Database Approach 12 Database: Shared collection of logically related data and a description of this data, designed to meet the information needs of an organization. Metadata (system catalog/data dictionary): The description of the data, used to enable program data independence. Data: name city birth Metadata: name - string, length<10 Khaled Dammam 01/01/70 city string, length<15 Sara Abha 01/03/01 birth date, format DD/MM/YY Examples all data required for the management of student records in a university. all data required for the management of books and borrowers in a library.
Database Approach 13 Logically related data comprises entities, attributes, and relationships of an organization s information. Entity: a distinct object( a person, place, thing, event) in the organization that is to be represented in the database. Attribute: is a property that describes some aspect of the object that we wish to record. Relationship: is an association between entities.
Example of a Database 14 Mini-world: Some part of the real world about which data is stored in a database. Mini-world for the example: Part of a UNIVERSITY environment. Some mini-world entities: STUDENTs COURSEs SECTIONs (of COURSEs) Grade Report Prerequiests
15
16
Example of Database Requests 17 Based on the previous database: Retrieve the transcript a list of all courses and grades of Smith List the names of students who took the section of the Database course offered In fall 2008 and their grades in that section List the prerequisites of the Database
Example of a Database 18 Some mini-world relationships: SECTIONs are of specific COURSEs STUDENTs take SECTIONs COURSEs have prerequisite COURSEs INSTRUCTORs teach SECTIONs COURSEs are offered by DEPARTMENTs STUDENTs major in DEPARTMENTs
Database Management Systems 19 Database Management System (DBMS) A software system that enables users to create, maintain, and query the database Most DBMSs now have facilities that make data access fast, reliable, secure and easy Example DBMSs Oracle MS Access MySQL
Application programs 20 Database Application : is a collection of data and the programs that interacts with the database by issuing an appropriate request (typically an SQL statement) to the DBMS. built on top of DBMS to satisfy end users special requirements and preferences
Examples of Database Applications 21 Purchases from the supermarket PNU Student Registration PNU Library Saudi Airline Reservation Purchases using your credit card Booking a holiday at the travel agents Using the Internet
Database System 22 Database System: The DBMS software together with the data itself. Sometimes, the applications are also included. (DB + DBMSs + Application program) To manage large amounts of data Efficiently Reliably Securely conveniently
Database Approach 23
24
Main Characteristics of the Database Approach 25 1. Self-describing nature of a database system: A DBMS catalog stores the description of the database. The description is called (meta-data). This allows the DBMS software to work with different databases. 2. Insulation between programs and data: Called program-data independence. Allows changing data storage structures and operations without having to change the DBMS access programs (application program).
Main Characteristics of the Database Approach 26 3. Data Abstraction: A data model is used to hide storage details and present the users with a conceptual view of the database. 4. Support of multiple views of the data: Each user may see a different view of the database, which describes only the data of interest to that user.
Views 27 Allows each user to have his or her own view of the database. A view is essentially some subset of the database. Benefits: Reduce complexity Provide a level of security Present a consistent, unchanging picture of the structure of the database, even if the underlying database is changed
Main Characteristics of the Database Approach 28 5. Sharing of data and multiuser transaction processing : allowing a set of concurrent users to retrieve and to update the database. Transaction: executing program or process that includes one or more database accesses, such as reading or updating of DB record. Concurrency control within the DBMS guarantees that each transaction is correctly executed or completely aborted.
Components of DBMS Environment 29 1. Hardware Can range from a PC to a network of computers. 2. Software DBMS, operating system, network software (if necessary) and also the application programs. 3. Data 4. Procedures Instructions and rules that should be applied to the design and use of the database and DBMS. 5. People
Components of DBMS Environment 30
Roles in the Database Environment 31 Communicate Procedure Write DB Designer User Requirement Write System Analyst Application programmer Design Program Manage DBA Naïve End User Use App Program DBMS Use Sophisticated End User DB H/W
Roles in the Database Environment 32 System Analyst: Determine the user requirements and develop the system specifications. Database Designers: responsible for defining the content, the structure, the constraints, and functions or transactions against the database. Application Programmer Implement programs meet the end user needs. Test, debug, document, and maintain transactions.
Roles in the Database Environment 33 Database administrators: responsible for: authorizing access to the database. coordinating and monitoring the DB use. acquiring software, and hardware resources. monitoring efficiency of operations.
Roles in the Database Environment 34 End-users: they use the data for queries, reports and some of them actually update the database content. Categories of End-users: Naïve : (Queries / modifies data) - they make up a large section of the end-user population. - They use previously well-defined functions in the form of canned transactions against the database. - Examples: bank-tellers or reservation clerks. Sophisticated : Forms requests in a database query language.
Advantages of Using the Database Approach 35 Controlling redundancy in data storage and in development and maintenance efforts. Sharing of data among multiple users. Restricting unauthorized access to data.
Advantages of Using the Database Approach 36 Providing backup and recovery services. Providing multiple interfaces to different classes of users. Enforcing integrity constraints on the database.
Disadvantages of Database Approach 37 Complexity Cost of DBMS Additional hardware costs Performance Higher impact of a failure
References 39 Main Reference: Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. 5 th Edition, Addison-Wesley, 2009. Supplementary: Fundamentals of Database Systems", Ramez Elmasri, Shamkant B. Navathe, Addison Wesley, The Latest Edition.