Sie sind auf Seite 1von 44


DBMS Introduction What is DBMS? A collection of software for organizing the information in a database that might contain routines for data input, verification, storage, retrieval, and combination .

What is RDBMS? A database management system (DBMS) with the ability to access data organized in tabular files that can be related to each other by a common field. An RDBMS has the capability to recombine the data items from different files, providing powerful tools for data usage.

What is DATA? A representation of facts, concepts, or instructions in a formalized manner suitable for communication, interpretation, or processing by humans or by automated means .

What is Information? Information is a term with many meanings depending on context, but is as a rule closely related to such concepts as meaning, knowledge, instruction, communication, representation, and mental stimulus.

What is Information Management System? IMS (Information Management System) is a joint hierarchical database and information management system

What is Data Abstraction? A data type with a private representation and a public set of operations. The C++ language uses the concept of classes to implement data abstraction.

DBMS Data Models The entity-relationship model The object oriented model Relational model Network model Hierarchical model

What is Entity Relationship Model in DBMS? In Data Modeling, an entity-relationship model (ERM) is a representation of structured data; entity-relationship modeling is the process of generating these models. The end-product of the modeling process is an entity-relationship diagram (ERD), a type of conceptual data model or semantic data model. The first stage of information system design uses these models to describe information needs or the type of information that is to be stored in a database during the requirements analysis. The Data Modeling Technique can be used to describe any ontology (i.e. an overview and classifications of used terms and their relationships) for a certain universe of discourse (i.e. area of interest).

Entity & Entity sets An Entity is an object that exists and is distinguishable from other objects. For instance, John Harris with S.I.N. 890-12-3456 is an entity, as he can be uniquely identified as one particular person in the universe. An entity may be concrete (a person or a book, for example) or abstract (like a holiday or a concept). An entity set is a set of entities of the same type (e.g., all persons having an account at a bank). Entity sets need not be disjoint. For example, the entity set employee (all employees of a bank) and the entity set customer (all customers of the bank) may have members in common.

Relationship sets Entity-relationship diagrams don't show single entities or single instances of relations. Rather, they show entity sets and relationship sets. Example: a particular song is an entity. The collection of all songs in a database is an entity set. The eaten relationship between a child and her lunch is a single relationship. The set of all such child-lunch relationships in a database is a relationship set.

Entity Relationship(E-R) Diagram in DBMS A graphical representation of the entities and the relationships between them.Entity relationship diagrams are a useful medium to achieve a common understanding of data among users and application developers. In data modeling, an entity-relationship model (ERM) is a representation of structured data; entity-relationship modeling is the process of generating these models. The end-product of the modeling process is an entity-relationship diagram (ERD), a type ofConceptual Data Model.

Object Oriented Model in DBMS Object DBMSs add database functionality to object programming languages. They bring much more than persistent storage of programming language objects. A major benefit of this approach is the unification of the application and database development into a seamless data model and language environment. As a result, applications require less code, use more natural data modeling, and code bases are easier to maintain.

Relationship Model in DBMS A branch of set theory that deals with logical relationships between sets. The Relational Model underlies OOA/D Class Models. In an OOA/D context relationships are much more abstract than in the Relational Data Model. In addition, the logical properties include behaviors as well as data.

Network Model in DBMS The popularity of the network data model coincided with the popularity of the hierarchical data model. Some data were more naturally modeled with more than one parent per child. So, the network model permitted the modeling of many-to-many relationships in data. The basic data modeling construct in the network model is the set construct. A set consists of an owner record type, a set name, and a member record type.

A hierarchical database model is a data model in which the data is organized into a tree-like structure. The structure allows representing information using parent/child relationships: each parent can have many children, but each child has only one parent (also known as a 1-tomany relationship). All attributes of a specific record are listed under an entity type. Example of an hierarchical model

In a database an entity type is the equivalent of a table. Each individual record is represented as a row, and each attribute as a column. Entity types are related to each other using 1:N mappings, also known as one-tomany relationships. This model is recognized as the first database model created by IBM in the 1960s.

What is DBMS Hierarchical Model? The hierarchical data model organizes data in a tree structure. There is a hierarchy of parent and child data segments. This structure implies that a record can have repeating information, generally in the child data segments. Data in a series of records, which have a set of field values attached to it. It collects all the instances of a specific record together as a record type.

Types of DBMS languages 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) 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) statements. Some examples: GRANT - gives user's access privileges to database REVOKE - withdraw access privileges given with the GRANT command

Transaction Control (TCL) Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions. Some examples: COMMIT - save work done SAVEPOINT - identify a point in a transaction to which you can later roll back ROLLBACK - restore database to original since the last COMMIT SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use

What is Database Administrator (DBA)? Database Administrators perform a critical role within an organization. Charged with understanding the processes and architecture of the Oracle or other database, they fine-tune the day-to-day performance that is the backbone of the organization's IT system. Their role is integral to the success of today's increasingly complex system environments and they are in high demand.

DBMS Types Distributed DBMS A Distributed Database Management System is a software system that permits the management of a distributed database and makes the distribution transparent to the users. A distributed database is a collection of multiple, logically interrelated databases distributed over a computer network. Sometimes "distributed database system" is used to refer jointly to the distributed database and the distributed DBMS.

Client server DBMS The Client--Server DBMS Model has emerged as the main paradigm in database computing. The Enhanced Client--Server architecture takes advantage of all the available client resources. However, when updates occur at the server, some of the client data managers may need to not only be notified about them but also obtain portions of the updates as well.

ORDBMS An object-relational database (ORD) or objectrelational database management system (ORDBMS) is a relational database management system that allows developers to integrate the database with their own custom data types and methods. The term object-relational database is sometimes used to describe external software products running over traditional DBMSs to provide similar features; these systems are more correctly referred to as objectrelational mapping systems.

OODBMS In an object oriented database, information is represented in the form of objects as used in ObjectOriented Programming. When database capabilities are combined with object programming language capabilities, the result is an object database management system (ODBMS). An ODBMS makes database objects appear as programming language objects in one or more object programming languages. An ODBMS extends the programming language with transparently persistent data, concurrency control, data recovery, associative queries, and other capabilities.

Database normalization DBMS Normalization is a technique for designing relational database tables. Tables can be normalized to varying extents. Database theory describes a table's degree of normalization in terms of normal forms of successively higher degrees of strictness. A table in third normal form (3NF), for example, is consequently in second normal form(2NF) as well; but the reverse is not always the case. . More highly normalized tables reduce data duplication and opportunities for various kinds of logical inconsistencies that could lead to loss of integrity of the database.

What is SQL And Why Should I Care? SQL, or Structured Query Language, is a language that is used to manipulate and report the data in relational databases. It can be pronounced either by its letters (EssQue-Ell) or as a word (See-quel). SQL is an open standard database language, supported by ANSI (American National Standards Institute). That means that SQL does not just work with Microsoft Access or even with just Microsoft products. Oracle, Sybase, Microsoft SQL Server, MySQL, IBM DB2, Microsoft Access, and Lotus Approach, and many others all support SQL. More than100 database management products, running on everything from PCs to mainframes, support SQL.

SQL provides three major kinds of functionality. First, SQL is the tool of choice for viewing information from a relational database. SQL doesn't just give you a simple list of the data. It also provides sophisticated tools to calculate from the data, summarize data, and consolidate data. Using table relationships, data can be combined from multiple tables in a number of ways. With a properly designed database, SQL can answer practically any question about the data. Second, SQL provides commands to manipulate the data in a relational database. Records can be added to a table. Records can be updated with new information. Records can be deleted.

Finally, SQL is a complete data definition language (DDL). The database itself can be created along with all tables, fields, primary keys, and relationships. SQL can also define users and set security permissions. In these labs we will just scratch the surface of how to view information with SQL. But it is nice to know that the language extends far enough to handle practically anything you want to do with a database.

SQL vs. QBE Not that SQL is the only way to manipulate a database. Most systems also have their own visual Query by Example (QBE) interface. Often the QBE interface is more user-friendly. Despite that fact there are at least three good reasons why anyone whose career will involve working with information systems would want to learn some SQL.

While QBE varies widely among databases systems, SQL, as an ANSI standard, varies only slightly. When you learn SQL for one database system, you have learned most of the SQL you need for any database system. Some queries cannot be done in QBE. For sophisticated sub-queries, unions, and other kinds of queries, SQL is the only tool in town.

For many kinds of jobs knowledge of SQL is an essential skill. Database administrators use SQL as the primary language for manipulating the database. Programmers use SQL to communicate with the database in their web programming or client-server programming applications. Even non-programmers use SQL. Many managers face the demands of querying a corporate database to get vital information. Though many kinds of user interfaces have been developed for that task, nearly all of them use either SQL concepts or SQL syntax.

QUEL is a relational database access language, similar in most ways to SQL. It was created as a part of the Ingres effort at University of California, Berkeley, based on Codd's earlier suggested. QUEL was used for a short time in most products based on the freelyavailable Ingres source code, most notably PostgreSQL. As Oracle and DB2 gained market share in the early 1980s, most companies then supporting QUEL moved to SQL instead.[citation needed] QUEL continues to be available as a part of the Ingres DBMS today[when?], although no QUEL-specific language enhancements have been added for many years[when?].

QUEL statements are always defined by tuple variables, which can be used to limit queries or return result sets. Consider this example, taken from the original Ingres paper: range of e is employee retrieve (comp = e.salary / (e.age - 18)) where = "Jones" e is a tuple, defining a set of data, in this case all the rows in the employee table that have the first name "Jones". An equivalent SQL statement is: select (e.salary / (e.age - 18)) as comp from employee as e where = "Jones"

QUEL is generally more "normalized" than SQL.[citation needed] Whereas every major SQL command has a format that is at least somewhat different from the others, in QUEL a single syntax is used for all commands.[citation needed] For instance, here is a sample of a simple session that creates a table, inserts a row into it, and then retrieves and modifies the data inside it and finally deletes the row that was added (assuming that name is a unique field).

create student(name = c10, age = i4, sex = c1, state = c2) range of s is student append to s (name = "philip", age = 17, sex = "m", state = "FL") retrieve (s.all) where s.state = "FL" replace s (age=s.age+1) retrieve (s.all) delete s where"philip"

Here is a similar set of SQL statements: create table student(name char(10), age int, sex char(1), state char(2)) insert into student (name, age, sex, state) values ("philip", 17, "m", "FL") select * from student where state = "FL" update student set age=age+1 select * from student delete from student where name="philip" Note that syntax varies significantly between commands, and that even similar commands like insert and update use different styles.

Query By Example (rep. QBE , French query by example ) is a type of user interface for searching in relational databases . The principle of a QBE interface is that the user has anexample search result expected - in the form of a matrix, and then submits it to the DBMS .It will search all the data corresponding to this example. Tables in the database are displayed on the screen, and the user can manipulate to create the example

With this system the result outweighs the means of implementation. With QBE, it is not for the user or the developer to learn a query language, but simply set a picture of the response you want to get to see include the data corresponding requested in the query. It was invented by Moshe Zloof on behalf of the company IBM in 1977 . He had some success with its introduction in the first version ofParadox (DOS 1.0) in 1985 . QBE is a language from the beginning Complete integrating relational division relational operation described in the relational algebra ofCodd that this is still not so simple in the most recent SQL standards (SQL: 2003). However QBE does not allow recursion in queries, while the normative version SQL: 1999 permits.

QBE query [ edit ] T_CLIENT_CLI == CLI_NUM ============= CLI_NOM ===== === | Check _join1! | Check | | | | T_COMMANDE_CDE == ===== CLI_NUM CDE_DATE ================= =========== CDE_MONTANT === | _join1 | 2000-01-01, 2000-03-31 | SUM <10000 | |||| SQL query [ edit ] SELECT CDE.CLI_NUM, CLI_NOMFROM T_CLIENT_CLI CLI LEFT OUTER JOIN T_COMMANDE_CDE CDE ON = CLI.CLI_NUM CDE.CLI_NUMWHERE BETWEEN CDE_DATE DATE'2000-01-01 'AND '2000-03-31'GROUP BY CDE.CLI_NUM, CLI_NOMHAVING SUM (CDE_MONTANT) <10000

Data abstraction Main article: Abstract data type Data abstraction enforces a clear separation between the abstract properties of a data type and the concrete details of its implementation. The abstract properties are those that are visible to client code that makes use of the data typethe interface to the data typewhile the concrete implementation is kept entirely private, and indeed can change, for example to incorporate efficiency improvements over time. The idea is that such changes are not supposed to have any impact on client code, since they involve no difference in the abstract behaviour.

For example, one could define an abstract data type called lookup table which uniquely associates keys with values, and in which values may be retrieved by specifying their corresponding keys. Such a lookup table may be implemented in various ways: as a hash table, a binary search tree, or even a simple linear list of (key:value) pairs. As far as client code is concerned, the abstract properties of the type are the same in each case. Of course, this all relies on getting the details of the interface right in the first place, since any changes there can have major impacts on client code. As one way to look at this: the interface forms a contract on agreed behaviour between the data type and client code; anything not spelled out in the contract is subject to change without notice.

Languages that implement data abstraction include Ada and Modula-2. Objectoriented languages are commonly claimed[by whom?] to offer data abstraction; however, their inheritance concept tends to put information in the interface that more properly belongs in the implementation; thus, changes to such information ends up impacting client code, leading directly to the Fragile binary interface problem.