Presentation on theme: "Database: A collection of related data [Elmasri]. A database represents some aspect of real world called “miniworld” [Elmasri] or “enterprise” [Ramakrishnan]."— Presentation transcript:
Database: A collection of related data [Elmasri]. A database represents some aspect of real world called “miniworld” [Elmasri] or “enterprise” [Ramakrishnan]. A database can be of any size and of varying complexity. It may be generated and maintained manually or using computers.
A few fundamental questions What data to store? How to describe this data? How to store this data? How to retrieve information from the data?
Data Models A data model is a collection of concepts for describing data. A schema is a description of a particular collection of data, using a given data model. Physical Schema Conceptual Schema View 1View 2View 3 The three-schema architecture External Schema Conceptual Schema Internal Schema
Conceptual schema: – Students (sid: string, name: string, login: string, age: integer, gpa:real) – Courses (cid: string, cname:string, credits:integer) – Enrolled (sid:string, cid:string, grade:string) Physical schema: – Relations stored as unordered files, heap files, or hashed files. – Index on first column of Students. Tree-based indexes or hash-based indexes can be used. External Schema (View): – Course_info(cid:string,enrollment:integer) Example of Schemas in Relational Data Model
Classification of Databases Network Databases (early 1960s); E.g., IDS, IDMS Hierarchical Databases (e.g., SABRE); E.g., IBM’s IMS Relational (1970) Databases (RDBMS); widely used Object-oriented Databases (OODBMS); E.g., ObjectStore, Poet. Object-relational Databases (ORDBMS); Deductive Databases Active Databases Real-time Databases Spatial Databases Temporal Databases Multimedia Databases Parallel and Distributed Databases By data model
Database Management System (DBMS): A software package designed to store and manage databases. Relational DBMSs: DB2, Informix, Oracle, Sybase, Microsoft Access, Microsoft SQL Server, FoxBase, Paradox, Teradata, MySQL, mSQL, etc.
Applications insulated from how data is structured and stored DBMS provides an abstract view, without exposing data representation and storage DBMS also allow users to manipulate the data in a convenient way Advantage of DBMS: Data Independence OS P … read/write DBMS A1 read/write OS vs. DMBS 1)Data unit (file vs table) 2)Data manipulation ::::....
Advantages of DBMS: Efficient Access Use indexes –Sophisticate techniques are used to ensure efficient store and retrieval of massive data Query optimization –rewrites query for a better response time using statistics maintained in the database management system Support extremely large databases –Beyond the limitation of the underlying OS
Advantages of DBMS: Reduce Application Development Time Do not need to write the database management software for each application Use standard query languages to access data such as SQL Use standard ways to write database applications –JDBC for Java language –ODBC –Perl DBI –PHP –ProC
Advantages of DBMS: Security & Integrity Secrecy: Users should not be able to see things they are not supposed to. –E.g., A student can’t see other students’ grades. Integrity: Users should not be able to modify things they are not supposed to. –E.g., Only instructors can assign grades. Availability: Users should be able to see and modify things they are allowed to.
Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are frequent, and relatively slow, it is important to keep CPU working on several user programs concurrently. Interleaving actions of different user programs can lead to inconsistency. DBMS ensures such problems don’t arise: users can pretend they are using a single-user system. Advantages of DBMS: Concurrency Control
Structure of a DBMS A typical DBMS has a layered architecture. The figure does not show the concurrency control and recovery components. This is one of several possible architectures; each system has its own variations. Query Optimization and Execution Relational Operators Files and Access Methods Buffer Management Disk Space Management DB These layers must consider concurrency control and recovery
Career Choices in Database Areas System analysts Project managers Database administrators Database application developers/testers Customer supports Consultants DBMS developers Database Researchers Database book authors Database software instructors