INTRO TO DBMS

DATA
IT IS A COLLECTION OF FACTS AND FIGURES OVER A PERIOD OF TIME FOR RETRIEVAL AT A LATER DATE.

INFORMATION
IT IS PROCESSED DATA TO SUPPORT CERTAIN DECISION MAKING FUNCTIONS.

DATABASE
A database is any collection of related data

A database is a persistent , logically coherent collection of inherently meaningful data , relevant to some aspect of the real world.

tax deductions  Databases touch all aspects of our lives . schedules Universities: registration. products. purchases Manufacturing: production.  Database Applications:        Banking: all transactions Airlines: reservations.DATABASE MANAGEMENT SYSTEM (DBMS) Collection of interrelated data  Set of programs to access the data  DBMS contains information about a particular enterprise  DBMS provides an environment that is both convenient and efficient to use. supply chain Human resources: employee records. grades Sales: customers. orders. salaries. inventory.

PURPOSE OF DATABASE SYSTEM  In the early days. account balance > 0) become part of program code  Hard to add new constraints or change existing ones  . database applications were built on top of file systems  Drawbacks of using file systems to store data:     Data redundancy and inconsistency  Multiple file formats.g. duplication of information in different files Need to write a new program to carry out each new task Difficulty in accessing data  Data isolation — multiple files and formats Integrity problems Integrity constraints (e.

transfer of funds from one account to another should either complete or not happen at all  Concurrent access by multiple users Concurrent accessed needed for performance  Uncontrolled concurrent accesses can lead to inconsistencies  E.) Atomicity of updates Failures may leave database in an inconsistent state with partial updates carried out  E.PURPOSE OF DATABASE SYSTEMS (CONT.)  Drawbacks   of using file systems (cont.g. two people reading a balance and updating it at the same time   Security problems  Database systems offer solutions to all the above problems .g.

COMPONENTS OF A DATABASE SYSTEM  Data  Hardware  Software  Users .

COMPONENTS OF A DATABASE SYSTEM Ranjit .

DBMS : A MULTILAYERED SYSTEM Ranjit .

SIMPLIFIED PICTURE OF A DATABASE SYSTEM COMPONENTS DATA HARDWARE DBMS DATABASE SOFTWARE USERS APPLICATION PROGRAMS END USERS .

WHAT DOES A DBMS DO Allow concurrency  Control security  Maintain data integrity  Provide for backup & recovery  Control redundancy  Allow data independence  Provide Non procedural query language  Perform automatic query optimisation  .

WHO INTERACTS WITH A DBMS System analysts  Database designers  Database administrators  Application developers  Users  .

bank tellers.DATABASE USERS Application programmers – interact with system through DML calls  Sophisticated users – form requests in a database query language  Specialized users – write specialized database applications that do not fit into the traditional data processing framework  Naïve users – invoke one of the permanent application programs that have been written previously   E.g. clerical staff Users are differentiated by the way they expect to interact with the system . people accessing database over the web.

 Retails stores . Rarely modified. statistics over a long period of time. geological companies etc Analytical databases often use data from operational databases . modify & maintain data on a daily basis. Reflects point in time snapshot of data Marketing companies . manufacturing companies etc  Ranjit  Analytical databases       Primarily used for OLAP To store and track historical & time dependent data Trends .TYPES OF DATABASES  Operational databases Used primarily for OLTP  Where need is to collect.  Dynamic ie changes continuously .

WHAT IS A DATA MODEL? A   notation for describing data or information  Description consists of 3 parts: Structure of the data Operations on the data Queries  Modifications   Constraints on the data 15 .

 Data Model Operations: Operations for specifying database retrievals and updates by referring to the concepts of the data model.DATA MODELS  Data Model: A set of concepts to describe the structure of a database. Operations on the data model may include basic operations and user-defined operations. and certain constraints that the database should obey. Slide 2-16 .

Other system based on this model: System 2k (SAS inc.) the first one to be implemented by Honeywell in 1964-65 (IDS System). INFORMIX).DBTG report of 1971). Adopted heavily due to the support by CODASYL (CODASYL .IDMS (Cullinet . The most popular model. Later implemented in a large variety of systems .F.HISTORY OF DATA MODELS  Hierarchical Data Model:  Implemented in a joint effort by IBM and North American Rockwell around 1965.  Network Model:   Relational Model:  Slide 2-17 .).now CA). SYBASE.P. Codd (IBM).). proposed in 1970 by E. VAX -DBMS (Digital Equipment Corp. DMS 1100 (Unisys). Resulted in the IMS family of systems. SQL Server. first commercial system in 1981-82. ORACLE. Now in several commercial products (DB2. IMAGE (H.

Started with Informix Universal Server. DB2.HISTORY OF DATA MODELS  Object-oriented Data Model(s):  Several models have been proposed for implementing in a database system. Exemplified in the latest versions of Oracle-10i. and SQL Server etc. Slide 2-18 . One set comprises models of persistent O-O Programming Languages such as C++  Object-Relational Models:  Most Recent Trend.

Tables are explicitly linked via a pointer or physical arrangement of records in the table.THE HIERARCHICAL DATABASE MODEL       Data structured hierarchically as an inverted tree A single table acts as the root of the inverted tree. Relationship is represented by parent/child. Other tables act as branches. Data is accessed starting from root and continuing down the tree. .

 Data can not be entered in child table which is not related to parent. person must know the complete structure. Which may lead to inconsistency.  .  Representing many to many relation requires redundant data.  To query this type of data .ADVANTAGES & DISADVANTAGES HIERARCHICAL MODEL Data retrieval is quick due to explicit links between the table structures.  Referential integrity is inbuilt and automatically enforced.  Can not support complex relations.

Supports one to many relationship. Record in owner node can exist without having any record in the member node. . User can access data from within the network while in Hierarchical data access has to start from the root. Structure is represented in terms of nodes and set structures.THE NETWORK DATABASE MODEL         Addresses some of the problems of hierarchical model. Set structure represents a relationship relating a pair of nodes together by using one node as an owner and the other node as member. Supports complex queries. Node represents a collection of records.

THE NETWORK DATABASE MODEL .

ONE TO MANY RELATIONSHIP IN NETWORK MODEL .

Data can be retrieved by SQL (structured query language). Categorises relationships as one to one . one to many and many to many. Stores data in relations known as tables. User need not know the physical structure of the database to retrieve values.THE RELATIONAL DATABASE MODEL          First conceived in 1969 by Dr Edgar F Codd Based on set theory and first order predicate logic. Each relation is composed of tuples (records) and attributes (Fields) Physical order of records is immaterial. . Each record in the table is identified by a field that contains unique value.

THE RELATIONAL DATABASE MODEL .

SOME TERMINOLOGY USED IN RELATIONAL MODEL  Relational DB is a collection of tables  Table is a collection of columns (attributes) that describe an entity Objects are stored as rows (tuples) within a table   Attribute or property is a characteristic or descriptor of an entity .

NVSK .

Entity Informal Equivalents Table Tuple Cardinality Attribute Degree Primary Key Row. Field No of Columns Unique Identifier Domain Set of Legal Values . Record No of rows Column.FORMAL & INFORMAL MAPPING OF TERMINOLOGY USED IN RELATIONAL MODEL Formal Relational Term Relation.

ADVANTAGES OF RELATIONAL DATABASE  Built in Multilevel Integrity     Field Level Record Level Table Level Primary key Logical & Physical data independence  Data consistency & accuracy  Easy data retrieval  .

. maintain . modify and manipulate a relational database.RDBMS  A software program which is used to create .

TERMINOLOGY USED IN RDBMS .

TERMINOLOGY IN RDBMS Used to express & define the special ideas and concepts of RDBMS  To express & define the database design process itself.  Four Categories  Value related  Structure related  Relationship related  Integrity related  .

 Static till modified  George Edleman 92883 05/16/96 95.DATA Values you store in the database.00 .

INFORMATION  Processed data to make it more meaningful Data is what you store and information is what you retrieve .

 Zero & Blank (Are they Null)  .NULL Null represents a missing or unknown value.

NULL  Any mathematical computation with NULL will always be NULL     (25 x 3) + 4 = 79 (Null x 3) + 4 = Null (25 x Null) + 4 = Null (25 x 3) + Null = Null .

EFFECT OF NULL ON OUTPUT .

STRUCTURE RELATED TERMS .

TABLE  Collection of similar records . .

 In case table represents an event . it represents something that occurs at a given point in time having characteristics which you wish to store.  Object characteristics can be stored in tables. place or thing.  .TABLE Table can represent Object or event  Object representation means thins which are tangible like person .

 Generally represents subjects such as city names . product codes etc. skill categories .VALIDATION TABLE Also known as look up tables.  .

 It is the smallest structure in the table which represents characteristics of the subject.  Types  Multipart (composite field) containing two or more distinct values.  Calculated field  .FIELD Fields are the structures that actually store data.  Multivalued contains multiple instances of the same type.  Contains one and only one value.

EXAMPLE : TYPES OF FIELDS .

 .RECORD Also known as tuple.  Represents a unique instance of the subject of a table.  Each record is identified by the unique value in the primary key.

VIEW A view is a virtual table composed of fields from one or more tables in the database.  Access refer them as saved queries.  .

 Can be used for data integrity.IMPORTANCE OF VIEWS Allow you to work with data from multiple tables simultaneously ( relationship is must for this purpose)  Enable you to prevent certain users from viewing or manipulating data in specific fields within a table. Such views aare known as data validation views.  .

 Every table must have a primary key.  Helpful in enforcing table level data integrity and helps establishing relationships with other tables.  Most common : Primary Key & Foreign Key  Primary key is a field or group of field that uniquely identifies each record within a table.KEYS Keys are special fields that play very specific role within a table.  Primary key which is composed of two or more fields is known as composite primary key.  Type of key determines the purpose.  .

PRIMARY & FOREIGN KEY

INDEX

An index is a structure RDBMS provides to improve data processing.  Can be based on any type of field.  Basically reorganization of records based on certain field or set of fields.

RELATIONSHIP RELATED TERMS

 Helps reduce redundant data and eliminate duplicate data.  Relationship can be established via a set of primary and foreign keys.  Enables to create multiple views.RELATIONSHIP A relationship exists between two tables if records of one table cane associated with records of the other table.  Relationship can also be established through a third table which is known as linking table or associate table.  .

RELATIONSHIP VIA PRIMARY & FOREIGN KEYS .

RELATIONSHIP VIA AN ASSOCIATE TABLE .

TYPES OF RELATIONSHIPS One to One Relationship  One to Many Relationship  Many to many Relationship  .

ONE TO ONE RELATIONSHIP One table serves as a parent and the other as a child Here both tables share the same primary key .

ONE TO MANY RELATIONSHIP  Relationship is established by primary & foreign keys  One record in parent relates to many records in the child while single record in the child can be related to only one record in the parent .

MANY TO MANY RELATIONSHIP  Unresolved many to many relationship  How to relate these tables : No field seems to be common .

MANY TO MANY RELATIONSHIP  Linking table is used to establish such relationship  Linking table is formed by taking the primary keys of both tables and forming a new table. .

. Example if child table can have a maximum of 10 and at least one record linked to parent then degree of participation id written as 1.PARTICIPATION IN A RELATIONSHIP  Type of Participation  Compulsory or Optional  Whether a record in the table A can exist without having a corresponding record in the table B  Degree of Participation   Degree of participation is established between table A & table B by indicating a minimum & maximum no of records in table B that can be linked to a single record in A.10.

INTEGRITY RELATED TERMS .

parent table Data type . description . & Display format Required value . Logical  General  field name . Physical . Each field specification has three types of elements  General. Length . & Default Value  Physical :   Logical  .FIELD SPECIFICATION  A field specification (domain) represents all the elements of a field. range of Values .

. Business rule level No duplicate records and field that identifies each record unique & never NULL. Relationship level .  Table Level ( Entity Integrity)   Field Level ( Domain Integrity)   Relationship Level ( Referential Integrity)  Ensures records in the table are synchronised whenever insert .DATA INTEGRITY  Refers to validity . modify & delete operations are performed Depending upon business rules data base design may change which also includes integrity constraints. consistency database .  and accuracy of the Table level integrity .  Business Related  . Field level . Valid . Four types. consistent & accurate values in each field.

NVSK .

Sign up to vote on this title
UsefulNot useful