Database Concepts.

Slides:



Advertisements
Similar presentations
DATA MODELS A collection of conceptual tools for describing data, data relationships, data semantics, and consistency constraints. Provide a way to describe.
Advertisements

The Hierarchical Model
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
Database Systems: Design, Implementation, and Management Tenth Edition
1 Introduction to Database Management Systems Lila Rao Graham.
Database Design and Introduction to SQL
The Relational Database Model
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
1 Introduction to databases concepts CCIS – IS department Level 4.
DATABASE MANAGEMENT SYSTEMS BASIC CONCEPTS 1. What is a database? A database is a collection of data which can be used: alone, or alone, or combined /
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
Concepts and Terminology Introduction to Database.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Prof. Sujata Rao Introduction to Computers & MIS Data Base Concepts Lesson 8.
DBSQL 3-1 Copyright © Genetic Computer School 2009 Chapter 3 Relational Database Model.
Chapter 2 Adapted from Silberschatz, et al. CHECK SLIDE 16.
Copyright © Curt Hill The Relational Model of Database Basic organization and terms.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
Levels of Abstraction (Views of Data ) Physical level: describes how a record (e.g., customer) is stored. Logical level: describes data stored in database,
3 1 Database Systems The Relational Database Model.
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Databases and Database User ch1 Define Database? A database is a collection of related data.1 By data, we mean known facts that can be recorded and that.
COP Introduction to Database Structures
Databases and DBMSs Todd S. Bacastow January
Introduction to DBMS Purpose of Database Systems View of Data
- The most common types of data models.
Database Systems: Design, Implementation, and Management Tenth Edition
Logical Database Design and the Rational Model
Understanding Data Storage
Datab ase Systems Week 1 by Zohaib Jan.
Introduction to Database Management Systems
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Database Systems: Design, Implementation, and Management Tenth Edition
Data Models.
Chapter 4 Relational Model Characteristics
CIS 207 The Relational Database Model
Lecture 2 The Relational Model
DATABASE CONCEPT Class XI Presented by : Dinesh Patel PGT [Comp. Sc.]
CSCI-100 Introduction to Computing
Chapter 4 Relational Databases
Normalization Referential Integrity
Chapter 3 The Relational Model.
Database.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Databases.
Primary key Introduction Introduction: A primary key, also called a primary keyword, is a key in a relational database that is unique for each record.
The Relational Model Transparencies
Database solutions Chosen aspects of the relational model Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology.
Database Systems Instructor Name: Lecture-3.
Introduction to DBMS Purpose of Database Systems View of Data
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
The Relational Database Model
Chapter 4 The Relational Model Pearson Education © 2009.
DATABASE Purpose of database
Database Systems: Design, Implementation, and Management
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Chapter 3 The Relational Model
Presentation transcript:

Database Concepts

Introduction Database: A Database is a collection of interrelated data. Database System: It is basically a computer based record keeping system.

PURPOSE OF DATABASES Database reduce the data redundancy. (Duplication of data is known as DATA REDUNDANCY) Databases can control data inconsistency. (An inconsistent Database will provide incorrect or Conflicting information) Databases facilitate sharing of data. Database enforce standards. Databases can ensure data Security. Integrity can be maintained through databases.

Various levels of Data Abstraction in a Database System View 1 View 2 View 3 Conceptual Level Physical Level

1) Internal Level (Physical Level) This level Describes how the data is actually stored on the storage medium.At this level complex low-level data structures are described in details.

2) Conceptual Level This level describes WHAT data are actually stored in the database. It also describes the relationships existing among data. At this level, the database is described logically in terms of simple data-structures.

3) External Level (View Level) This level is concerned with the way the data is viewed by the individual users. Only a part of the database relevant to the user(s) is provided to them through this level.

DATA INDEPENDENCE Since the databases keep on growing, there may be frequent changes at times. This should not lead to the redesigning and reimplementation of the database. The concept of data independence proves beneficial in such a context. The ability to modify a scheme definition in one level without affecting a scheme definition in the next higher level is called DATA INDEPENDENCE.

There are two levels of Data Independence Physical Data Independence : It refers to the ability to modify the scheme followed at the Physical level without affecting the scheme followed at the Conceptual level. Logical Data Independence : It refers to the ability to modify the scheme followed at the Conceptual level without affecting the scheme followed at the View level.

DATA MODELS Relational Data Model Network Data Model A Data Model is a collection of conceptual tools for describing data, data relationships, data semantics etc. Relational Data Model Network Data Model Hierarchical Data Model

Relational Data Model It represents data and relationships among data by a collection of tables known as relations, each of which has a number of columns with unique names.

Relational Data Model

Network Data Model The Network Model represents data by collection of Records and relationships among data are represented by links which can be viewed as pointers.

Network Data Model

Hierarchical Data Model The Hierarchical Data Model is similar to the network model in the sense that data and relationships among data are represented by records and links respectively. It differs from the Network model, in that the records are organised as collection of TREES rather than arbitrary graphs.

Hierarchical Data Model

TERMINOLOGY Relation : A Table Tuple : The rows of Tables (Relations) Different terms used in the Relational Model are: Relation : A Table Tuple : The rows of Tables (Relations) Attributes : The columns of Tables (Relations) Degree : The number of attributes in a relation. Cardinality: The number of tuples (rows) in a relation.

VIEW Views are like windows through which we can view desired information that is actually stored in a base table A view is a (Virtual) table that does not really exist in its own right but is instead derived from one or more existing base tables.

KEYS Primary Key: A Primary Key is a set of one or more attributes that can uniquely identify tuples within the relation Candidate Key: All attribute combinations inside a relation that can serve as Primary key are Candidate Keys as they are candidates for the Primary key position.

Alternate Key: A candidate key that is not the Primary key is called an Alternate Key. Foreign Key: A non-key attribute, whose values are derived from the primary key of some other table, is known as Foreign-key in its current table.

Relational Algebra

Notation Projection Selection Union Intersection Cartesian product

Selection SQL Result Relational algebra salary < 200(E) The same table E (for EMPLOYEE) as above. SQL Result Relational algebra select * from E where salary < 200 salary < 200(E) nr name salary 1 John 100 7 Tom 100 select * from E where salary < 200 and nr >= 7 salary < 200 and nr >= 7(E) nr name salary 7 Tom 100 Note that the select operation in relational algebra has nothing to do with the SQL keyword select. Selection in relational algebra returns those tuples in a relation that fulfil a condition, while the SQL keyword select means "here comes an SQL statement".

nr name salary SQL Result Relational algebra Projection Example: The table E (for EMPLOYEE) nr name salary 1 John 100 5 Sarah 300 7 Tom 100 SQL Result Relational algebra select salary from E salary salary(E) 100 300 select nr, salary from E nr, salary(E) nr salary 1 100 5 300 7 100 Note that there are no duplicate rows in the result.

UNION Rollno Name Age Rollno Name Age Rollno Name Age Song Drama 13 Kush 15 2 Maya 15 17 Swati 14 10 Rishabh 15 13 Kush 15 The result of Drama U Song will be Rollno Name Age 2 Maya 15 10 Rishabh 15 13 Kush 15 17 Swati 14

SET DIFFERENCE OPERATION Song Drama Rollno Name Age Rollno Name Age 13 Kush 15 2 Maya 15 17 Swati 14 10 Rishabh 15 13 Kush 15 The result of Drama - Song will be Rollno Name Age 17 Swati 14

SET INTERSECTION OPERATION Song Drama Rollno Name Age Rollno Name Age 2 Maya 15 13 Kush 15 10 Rishabh 14 17 Swati 14 13 Kush 15 The result of Drama Song will be Rollno Name Age 13 Kush 15

Prepared by CH. Venugopala Rao PGT (Computer Science) KV, Gill Nagar Chennai