Sei sulla pagina 1di 24

Network Model

In 1971, conference on Data Systems Language (CODASYL) defined N/W Model Based on Mathematical Set Theory Permits Modeling of Many-to-many Relationship in data

Basic Modeling construct is Set Set contains Owner Record type, a Set Name, a member Record Type member Record Type achieves Many to many Relation Owner Record type may be member of Owner in another set Data Model is Simple N/W Links and Intersections record Types may exist and sets between them Complete N/W of Relationship is represented by several pair wise sets In Each set some Record Types are Owner and one or more record types are Members Usually set defines 1:M relationship, 1:1 also permitted
Copyright SevenPeaks Academy

DATABASE LANGUAGES
Data Definition Language (DDL) DDL is to Specify the Database Schema, Create, destroy database and database object, Storage Structure, access method statements Commands for Data Administrators Provides facility of Constraints like integrity constraints, domain constarints Data Manipulation Language (DML) /Query Language DML to express database queries and updates Allows the users to manipulate data as organized by appropriate data model Used to retrieve, Insert, & modify database information Two types: 1. Procedural & 2. Non Procedural Procedural DML: What data r needed and how to get that data.

Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

DML
DML to express database queries and updates Allows the users to manipulate data as organized by appropriate data model Used to retrieve, Insert, & modify database information Two types: 1. Procedural & 2. Non Procedural Procedural DML: What data r needed and how to get that data Used to transfer cause data between a run unit & database It relies on the host language for framework to provide procedural activities required to manipulate. Basic DML Commands are: SELECT SELECT * INSERT UPDATE DELETE MERGE

Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

DCL

Domain Constraints: * Domain-Set of Possible Values for each attribute associated with an entity set. * Specify important constraints that each instance of relation must satisfy Referential Integrity: Property of data which, when satisfied, requires every value of one attribute(column) of relation (table) to exists as a value of another attribute in a different (or the same) relation (Table) Assertions: Condition that database must always satisfy e.g. Domain Constraint and Referential Integrity Authorization: Read Authorization Insert Authorization Update Authorization Delete Authorization DDL Commands: CREATE DATABASE & TABLE USE ALTER ADD DROP DATABASE & TABLE
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

DATABASE DESIGN
Process of producing a detailed data model of Database contains all logical and physical design choices and Physical storage parameter Fully attributed data model contains detailed attributes for each entity. Design carried out by 1. find the relationship between different Data elements, 2. Superimpose a logical structure upon data on the basis of these relationship To design information s/m that is based in database, the conceptual data model is mapped to logical data model (relational model); this in turn mapped to a physical model during physical design. Both of these stages are referred as Physical Design.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Entity-Relationship Model
This model is used during Requirement Analysis stage of Information System Design. Entity - a thing which is recognized as being capable of an independent existence & uniquely identified. E.g. Car, house etc. It can be set as noun Relationship - How two or more entities r related to one another. It can be set as Verb, linking two or more nouns. E.g. an owns relationship between Company and a computer, a performs relationship between an artist and a song. Attributes Entity and Relationship can both have attributes. E.g. An employee entity might have an Employee Id. attribute Proved relationship may have a Date attribute Every Entity must have a minimal set of uniquely identified attributes, called Entitys Primary Key Continue.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Entity-Relationship Model
Diagrammatic conventions are used called Entity Relationship Diagrams (ERDs) Entity Set -> Rectangles Relationship Set -> Diamonds Attributes -> Ovals connected with Lines If Entity set participates in a relationship set, they are connected with a line. ERDs dont show single entities or single instance of relations. Continue
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Entity-Relationship Model

cardinality constraints expressed by ERDs

A Double line : A participation constraints i.e. totality or surjectivity: Relationship Set An arrow from entity set to relationship set : A key -> Diamonds constraint, i.e. injectivity A thick line indicates both, i.e. Attributes -> bijective Ovals connected with An underlined name of an attribute indicates that is a key Lines
Entity Set -> Rectangles
Copyright SevenPeaks Academy

Normalization
Normalization: Normalization is the process of efficiently organizing data in a database. There are two goals of Normalization process: 1. Eliminating Redundant Data 2. Ensuring data dependencies make sense There are five normal forms through which we can normalize the database. These forms are as following: 1. First Normal Form or 1NF 2. Second Normal Form or 2NF 3. Third Normal Form or 3NF 4. Fourth Normal Form or 4NF 5. Fifth Normal Form or 5NF

Out of these five normal forms only first three are used in practical. 4NF used occasionally and 5NF is used very rarely.
Continue.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Normalization
First Normal Form (1NF) : First normal forms (1NF) sets the very basic rules for an organized database: 1. Eliminate duplicate columns from the Same Table 2. Create Separate table for each group of related data and identify each row with the unique column or set of columns (the primary key) Second Normal Form (2NF): Second Normal Form (2NF) further addresses the concept of removing the duplicate data. This can be achieved by following techniques, 1. Meet all requirement s of 1NF 2. Remove subsets of Data that apply to multiple rows of a table and place them in separate tables 3. Create relationship between these new tables and their predecessors through the use of Foreign Key
Copyright SevenPeaks Academy

Continue.

Copyright SevenPeaks Academy

Normalization
Third Normal Form (3NF) : 3NF goes one step further; 1. Meet all requirement s of 2NF 2. Remove columns that are not dependent upon the primary key Fourth Normal Form (4NF) : Meet all requirement s of 3NF A Relation is in 4NF if it has no multi-valued dependencies. Normalization guidelines are cumulative. For the database to be in 2NF, it must full fill criteria of 1NF
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Data Storage and Querying


DS Partitioned in to modules with each of the separate Responsibilities. Functional Components of DS are partitioned into Storage Manager (SM) and Query Processor Components (QP) SM is imp as database requires a large amt of space for Storing data. QP is imp as it helps DS to simplify and allows the system to access data
Continue.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Data Storage and Querying Storage Manager (SM)


Storage Manager (SM): Provide the interface between: 1. file Manager 2. Buffer Manager 3. Data Integrity Manager 4. Transaction Manager. File Manager: To Manage Disk Space for the Storage and Data Structure used for Storing information. Buffer Manager: Fetching data from Disk Storage into main memory and decides what data are to be cached in to memory Data Integrity Manager: Check the Integrity Constraints, & authority of users to access the data. Transaction Manager: ensures that database remains in a consistent and in the correct state. Continue.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Data Storage and Querying Storage Manager


SM implements several data structures as a part of the Physical system implementation: Some of them are File System, Data Dictionary, Indices File System: Stores data itself Data Dictionary: Stores metadata of Database i.e. Structure of Database in particular Schema Indices: Used to provide fast access to database.
Continue.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Data Storage and Querying Query Processor:


1. 2. 3. Query Processor Components are: DDL Interpreter DML Compiler Query Evaluation Engine

DDL Interpreter: 1. Interprates DDL Statements and records defn in the data dictionary. DML Compiler: 1. Translates DML Statemt in a query Language into a evaluation plan and performs query Optimization. 2. Evaluation plan consists of Low-Level instructions that the Query Evaluation Engine understand. 3. DML Compiler Also performs Query Optimization by picking the lowest cost evaluation plan among the alternatives Query Evaluation Engine: Executes the low level instructions generated by DML Compiler.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Transaction Management (TM) in DBMS


A Database Transaction Management ideally guarantees ACID property Ensures Data integrity i.e. avoid Concurrent user access to data or Faults tolerance. Through TM, DBMS maintain integrity by not allowing more than one user to update same record at the Same time. (Integrity Constraints) Through TM, DBMS can help to prevent duplicate record via Unique Index Constraint (Unique key Constraints) Transaction Processing allows multiple individual operatns to be linked together a single, individual trann. It ensures that either all operatn in a transaction are completed without error or none of then are.
Continue.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Transaction Management (TM) in DBMS


If some opertn are completed but error occur when others are attempted, the transaction processing system Roll Back all of the operation of the transaction (including successful one also) If all operations of Transactions are completed successfully, the transaction is committed by the system and all changes to the database are made permanent, and this transaction cant rollback. Transaction Processing guards against H/W and S/W errors that might leave a transaction partially completed Transactions are processed in a strict Chronological Order. i.e. if n+1th transaction deals with the same portion of database as nth transaction dealing, transaction n+1 will not begin until transaction n is committed.
Copyright SevenPeaks Academy

Continue.

Copyright SevenPeaks Academy

Transaction Management (TM) in DBMS


Before any transaction is committed, all other transaction affecting the same part of the Database must also be committed. Transaction Management component ensure that the database remains in a consistent state despite system failure and transaction failures. Questions: Why Transaction Management is important in DBMS and how we are achieving it in DBMS?
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Data Mining and Analysis


Data Mining is a process of extracting patterns for Data The related terms are data dredging, data fishing, & data snooping. Four tasks of data Mining: 1. Clustering 2. Classification 3. Regression 4. Association Rule Learning
Continue.
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Data Mining and Analysis


Clustering: Task of discovering Groups and structures in data that r in some way or another Similar, without know structure of database. Classification: Task of generalizing known structure to apply to new data. Regression: Attempt to find a function which models the data with the least error. Association Rule Learning: Searches for relationship between variables.

Question: What is mean by Data Mining and what are the tasks of Data Mining?
Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Database Architecture:
Simple User User Application Interface Write Application Program Application Programmer User Query Tools Sophisticated User(Analyser) User Administration tools Database Administrator

Compiler and Linker

DML Query

DDL Interpreter

Application Program Object Code

DML Compiler and Organizer

Query Evaluation engine


Query Processor

Buffer Manager

File Manager Authorization & Integrity Manager Transaction Manager Storage Manager

Data Dictionary Data Indices Statistical Data Disk Package

Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

The architecture of Database system in depends on the underlying Computer System on which the database is running. Accordingly the architecture is divided into: 1. Centralized 2. Client-Server 3. Parallel 4. Distributed Two-tier Architecture: * Application is partitioned into components that resides on client machine * Client Machine directly invoke database system at server level through Query Language Statemt.
Continue.
Copyright SevenPeaks Academy

Database Architecture

Copyright SevenPeaks Academy

Database Architecture

Three-Tier Architecture: * Client Machine acts as merely a front-end and does not contain any direct call. * Usually the client end communicates with the application server through forms interface
User Application
T w o T i e r
A r c h i t e c t u r e

User Client
Application Client

Application Server

Database System

Server

T h r e e T i e r

Database System

A r c h i t e c t u r e

Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Database Users and Administrators


Database User: * Four Types: 1. Nave Users (simple User) 2. Application Programmer 3. Sophisticated Users 4. Specialized Users

Copyright SevenPeaks Academy

Copyright SevenPeaks Academy

Potrebbero piacerti anche