* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Lecture # 10 - WordPress.com
Survey
Document related concepts
Transcript
Lecture # 10 Introduction To Database Systems Content Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Database ? Database: A database is simply an organized collection of related data, typically stored on disk, and accessible by possibly many concurrent users. Databases are generally separated into application areas. For example, one database may contain Human Resource (employee and payroll) data; another may contain sales data; another may contain accounting data; and so on. Databases are managed by a DBMS. An Example University Database: Data about students, faculty, courses, research laboratories, course registration/enrollment etc. Reflects the state of affairs of the academic aspects of the university. o oPurpose: To keep an accurate track of the academic activities of the university. Database Management System (DBMS) A Database Management System (DBMS) is a set of programs that manages any number of databases. A DBMS is responsible for: accessing data inserting, updating, and deleting data security integrity Database Management System (DBMS) A general purpose software system enabling: 1. 2. 3. 4. 5. Creation of large disk-resident databases. Posing of data retrieval queries in a standard manner. Retrieval of query results efficiently. Concurrent use of the system by a large number of users in a consistent manner. Guaranteed availability of data irrespective of system failures. View of Data In a database management system, a view is a way of portraying information in the database. This can be done by arranging the data items in a specific order, by highlighting certain items, or by showing only certain items. For any database, there are a number of possible views that may be specified. Databases with many items tend to have more possible views than databases with few items. Data Model Collection of conceptual tools to describe the database at a certain level of abstraction. Conceptual Data Model a high level description useful for requirements understanding. Representational Data Model describing the logical representation of data without giving details of physical representation. Physical Data Model description giving details about record formats, file structures etc. Data Definition Language- DDL Data definition Language (DDL) which is used to create, rename, alter, modify, drop, replace, and delete tables, Indexes, Views, and macros; show data; comment on database objects; and establish a default database. DDL is abbreviation of Data Definition Language. It is used to create and modify the structure of database objects in database. Data Definition Language- DDL DDL provides statements for the definition and description of entities. It enable you to perform the following operations: 1. 2. CREATE Define a new database, user, table, trigger, index, macro, view, depending on the object of the CREATE statement. DROP Remove a table, trigger, index, macro, view definition, depending on the object of the DROP statement Other data definitions allow you to perform the following function: ALTER Change a table, trigger or protection definition RENAME table triggers views and macros REPLACE macros, triggers or views DELETE database or users Data Definition Language- DDL Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples: CREATE - to create objects in the database ALTER - alters the structure of the database DROP - delete objects from the database TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed COMMENT - add comments to the data dictionary RENAME - rename an object Data Manipulation Language-DML Data manipulation Language (DML) which is used to add, delete, and revise data in existing tables or views. DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database. Data Manipulation Language-DML DML supports statements for manipulating and processing database values. It enable you to perform following operations: BEGIN and END which is a user_defined transaction in Teradata mode. COMMENT : which is a transaction in ANSI mode. INSERT : insert new rows into a table UPDATE : modifies data in one or more rows of a table. DELETE : removes a row from a table. Data Manipulation Language-DML Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples: SELECT - retrieve data from the a database INSERT - insert data into a table UPDATE - updates existing data within a table DELETE - deletes all records from a table, the space for the records remain MERGE - UPSERT operation (insert or update) CALL - call a PL/SQL or Java subprogram EXPLAIN PLAN - explain access path to data LOCK TABLE - control concurrency Data Control Language-DCL Data Control Language (DCL) which is used to control database security; establish privileges and revoke privileges. DCL is abbreviation of Data Control Language. It is used to create roles, permissions, and referential integrity as well it is used to control access to database by securing it. Data Control Language-DCL Data Control Language (DCL) statements. Some examples: 1. 2. GRANT - gives user's access privileges to database REVOKE - withdraw access privileges given with the GRANT command