SlideShare a Scribd company logo
Unit 2-Database Essentials
DR. V. NIRMALA
DEPARTMENT OF AI & DS
EASWARI ENGINEERING COLLEGE
Introduction
• A database-management system (DBMS) is a collection of interrelated data and a set of
programs to access those data.
• The collection of data, usually referred to as the database, contains information relevant to an
enterprise.
• The primary goal of a DBMS is to provide a way to store and retrieve database information that
is both convenient and efficient
• Database systems are designed to manage large bodies of information.
• In addition, the database system must ensure the safety of the information stored, despite
system crashes or attempts at unauthorized access. Because information is so important in most
organizations, computer scientists have developed a large body of concepts and techniques for
managing data.
Database-System Applications
1. Enterprise Information
Sales: For customer, product, and purchase information.
Accounting: For payments, receipts, account balances, assets and other accounting information.
Human resources: For information about employees, salaries, payroll taxes, and benefits, and for generation of paychecks.
Manufacturing: For management of the supply chain and for tracking production of items in factories, inventories of items in warehouses
and stores, and orders for items
2. Banking and Finance :
Banking: For customer information, accounts, loans, and banking transactions.
Credit card transactions: For purchases on credit cards and generation of monthly statements.
Finance: For storing information about holdings, sales, and purchases of financial instruments such as stocks and bonds; also for storing real-
time market data to enable online trading by customers and automated trading by the firm.
3. Universities: For student information, course registrations, and grades (in addition to standard enterprise information such as human
resources and accounting).
4. Airlines: For reservations and schedule information. Airlines were among the first to use databases in a geographically distributed manner.
5. Telecommunication: For keeping records of calls made, generating monthly bills, maintaining balances on prepaid calling cards, and
storing information about the communication networks
Purpose of Database Systems
• Earlier in 1960’s they used file processing system tog store, manage and retrieve the data.
• Needs the help of system programmer to run the application programs to modify, edit and retrieve
files.
•Keeping organizational information in a file-processing system has a number of major disadvantages:
• Data redundancy and inconsistency: Duplication of file (student basic inform) need high storage space, change
of data will not be reflected in all files(address change).
• Difficulty in accessing data (needs specific application program for each accessing of file)
• Data isolation. Because data are scattered in various files, and files may be in different formats, writing new
application programs to retrieve the appropriate data is difficult.
• Integrity problems:
• Atomicity Problem: It is difficult to ensure atomicity in a conventional file-processing system, it must happen in
its entirety or not at all (eg: transfer of fund)
• Security problems: Application programs are added to the file-processing system in an ad hoc manner,
enforcing such security constraints is difficult.
View of Data
Abstract view of the data.
That is, the system hides certain details of how the data are stored and
maintained
For the system to be usable, it must retrieve data efficiently. The need for
efficiency has led designers to use complex data structures to represent data in
the database. Since many database-system users are not computer trained,
developers hide the complexity from users through several levels of
abstraction, to simplify users’ interactions with the system
• Physical level. The lowest level of abstraction describes how the data are
actually stored. The physical level describes complex low-level data structures
in detail.
• Logical level. The next-higher level of abstraction describes what data are
stored in the database, and what relationships exist among those data. The
logical level thus describes the entire database in terms of a small number of
relatively simple structures.
• View level. The highest level of abstraction describes only part of the entire
database.
• The view level of abstraction exists to simplify their interaction with the system.
• The system may provide many views for the same database
View of Data…
• At the physical level, an instructor, department, or student record
can be described as a block of consecutive storage locations. The
compiler hides this level of detail from programmers. Similarly, the
database system hides many of the lowest-level storage details
from database programmers. Database administrators, on the
other hand, may be aware of certain details of the physical
organization of the data.
• At the logical level, each such record is described by a type
definition, as in the previous code segment, and the
interrelationship of these record types is defined as well.
Programmers using a programming language work at this level of
abstraction. Similarly, database administrators usually work at this
level of abstraction.
• Finally, at the view level, computer users see a set of application
programs that hide details of the data types. At the view level,
several views of the database are defined, and a database user
sees some or all of these views.
For example, we may describe a record as follows:
This code defines a new record type called instructor with four
fields. Each field has a name and a type associated with it.
A university organization may have several such record types,
including
• department, with fields dept name, building, and budget
• course, with fields course id, title, dept name, and credits
• student, with fields ID, name, dept name, and tot cred
Data Models
•Underlying the structure of a database is the data model: a collection of conceptual tools for describing data, data
relationships, data semantics, and consistency constraints.
•A data model provides a way to describe the design of a database at the physical, logical, and view levels
•The data models can be classified into four different categories:
1. Relational Model.
◦ The relational model uses a collection of tables to represent both data and the relationships among those data.
◦ Each table has multiple columns, and each column has a unique name.
◦ Tables are also known as relations.
◦ The relational model is an example of a record-based model.
◦ Record-based models are so named because the database is structured in fixed-format records of several types. Each table
contains records of a particular type.
◦ Each record type defines a fixed number of fields, or attributes.
◦ The columns of the table correspond to the attributes of the record type.
◦ The relational data model is the most widely used data model, and a vast majority of current database systems are based
on the relational model.
Data Models…
2. Entity-Relationship Model.
◦ The entity-relationship (E-R) data model uses a collection of basic objects, called entities, and relationships among these
objects.
◦ An entity is a “thing” or “object” in the real world that is distinguishable from other objects.
◦ For example, each person in a university is an entity. An entity has a set of properties, and the values for some set of
properties may uniquely identify an entity.
◦ For instance, a person may have a person id property whose value uniquely identifies that person.
3. Object-Based Data Model.
◦ Object-oriented programming (especially in Java, C++, or C#) has become the dominant software-development methodology.
This led to the development of an object-oriented data model that can be seen as extending the E-R model with notions of
encapsulation, methods (functions), and object identity.
◦ The object-relational data model combines features of the object-oriented data model and relational data model.
4. Semistructured Data Model.
◦ The semistructured data model permits the specification of data where individual data items of the same type may have
different sets of attributes.
◦ This is in contrast to the data models mentioned earlier, where every data item of a particular type must have the same set of
attributes.
◦ The Extensible Markup Language (XML) is widely used to represent semistructured data.
Database Languages
•A database system provides a data-definition language to specify the database schema and a
data-manipulation language to express database queries and updates.
•In practice, the data-definition and data-manipulation languages are not two separate
languages; instead they simply form parts of a single database language, such as the widely used
SQL language.
•Data-Manipulation Language
• A data-manipulation language (DML) is a language that enables users to access or manipulate data as
organized by the appropriate data model.
• The types of access are:
• Retrieval of information stored in the database
• Insertion of new information into the database
• Deletion of information from the database
• Modification of information stored in the database
Database Languages..
• There are basically two types:
• Procedural DMLs require a user to specify what data are needed and how to get those
data.
• Declarative DMLs (also referred to as nonprocedural DMLs) require a user to specify
what data are needed without specifying how to get those data.
• A query is a statement requesting the retrieval of information. The portion of a DML that involves information
retrieval is called a query language.
•Data-Definition Language
• We specify a database schema by a set of definitions expressed by a special language called a data-definition
language (DDL).
• The data values stored in the database must satisfy certain consistency constraints. For example, suppose the
university requires that the account balance of a department must never be negative. The DDL provides
facilities to specify such constraints. The database system checks these constraints every time the database is
updated.
Database Architecture
•The architecture of a database system is
greatly influenced by the underlying computer
system on which the database system runs.
Database systems can be centralized, or client-
server, where one server machine executes
work on behalf of multiple client machines.
•Database applications are usually partitioned
into two or three parts, as in Figure.
•In a two-tier architecture, the application
resides at the client machine, where it invokes
database system functionality at the server
machine through query language statements.
Database Architecture..
•In a three-tier architecture, the client machine
acts as merely a front end and does not
contain any direct database calls. Instead, the
client end communicates with an application
server, usually through a forms interface. The
application server in turn communicates with
a database system to access data.
•Three-tier applications are more appropriate
for large applications, and for applications that
run on the World Wide Web.
Relational Model
•Relational model can represent as a table with
columns and rows. Each row is known as a
tuple/ record. Each table of the column has a
name or attribute.
•A relational database consists of a collection of
tables, each of which is assigned a unique
name. For example, consider the instructor
table, which stores information about
instructors. The table has four column
headers: ID, name, dept name, and salary.
Each row of this table records information
about an instructor, consisting of the
instructor’s ID, name, dept name, and salary.
Relational Model..
• Similarly, the course table of Figure stores information about courses, consisting of a course
id, title, dept name, and credits, for each course. Note that each instructor is identified by the
value of the column ID, while each course is identified by the value of the column course id
• In general, a row in a table represents a relationship among a set of values. Since a table is a
collection of such relationships, there is a close correspondence between the concept of table
and the mathematical concept of relation, from which the relational data model takes its
name. In mathematical terminology, a tuple is simply a sequence (or list) of values. A
relationship between n values is represented mathematically by an n-tuple of values, i.e., a
tuple with n values, which corresponds to a row in a table.
• Thus, in the relational model the term relation is used to refer to a table, while the term tuple
is used to refer to a row. Similarly, the term attribute refers to a column of a table.
• Relational instance:
• We use the term relation instance to refer to a specific instance of a relation, i.e., containing a
specific set of rows. The instance of instructor shown has 12 tuples, corresponding to 12
instructors
• In the relational database system, the relational instance is represented by a finite set of tuples.
Relation instances do not have duplicate tuples
• Domain:
• For each attribute of a relation, there is a set of permitted values, called the domain of that
attribute.
• Thus, the domain of the salary attribute of the instructor relation is the set of all possible salary
values, while the domain of the name attribute is the set of all possible instructor names.
• It contains a set of atomic values that an attribute can take.
Ad

More Related Content

Similar to Unit 2 DATABASE ESSENTIALS.pptx (20)

Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).ppt
RAJULKUMARSUTHAR
 
Computer applications.pptx
Computer applications.pptxComputer applications.pptx
Computer applications.pptx
Emmanuel235416
 
System Analysis And Design
System Analysis And DesignSystem Analysis And Design
System Analysis And Design
Lijo Stalin
 
Database, Lecture-1.ppt
Database, Lecture-1.pptDatabase, Lecture-1.ppt
Database, Lecture-1.ppt
MatshushimaSumaya
 
Intro.pptx
Intro.pptxIntro.pptx
Intro.pptx
NithyasriA2
 
Introduction to Database System-WEEK2.pptx
Introduction to Database System-WEEK2.pptxIntroduction to Database System-WEEK2.pptx
Introduction to Database System-WEEK2.pptx
melissaguillermo
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
TOUSEEQHAIDER14
 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
Data concepts
Data conceptsData concepts
Data concepts
Sachidananda M H
 
Database Management system intro.pptx
Database  Management  system  intro.pptxDatabase  Management  system  intro.pptx
Database Management system intro.pptx
sivamathi12
 
9a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc29a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc2
Mukund Trivedi
 
DBMS
DBMS DBMS
DBMS
addisonabner
 
DATABASE MANAGEMENT SYSTEMS PPT .pptx
DATABASE MANAGEMENT SYSTEMS PPT    .pptxDATABASE MANAGEMENT SYSTEMS PPT    .pptx
DATABASE MANAGEMENT SYSTEMS PPT .pptx
YogeshGarg228050
 
database management systems for ug students
database management systems for ug studentsdatabase management systems for ug students
database management systems for ug students
veenashinde8
 
DBMS introduction
DBMS introductionDBMS introduction
DBMS introduction
BHARATH KUMAR
 
Arinda oktaviana 11353204810 vii lokal g
Arinda oktaviana 11353204810   vii lokal gArinda oktaviana 11353204810   vii lokal g
Arinda oktaviana 11353204810 vii lokal g
Arinda oktaviana
 
Unit1 dbms
Unit1 dbmsUnit1 dbms
Unit1 dbms
gowrivageesan87
 
DATABASE ADMINISTRATION: Identify Physical Database Requirements
DATABASE ADMINISTRATION: Identify Physical Database RequirementsDATABASE ADMINISTRATION: Identify Physical Database Requirements
DATABASE ADMINISTRATION: Identify Physical Database Requirements
birhanugirmay559
 
Database & Database Users
Database & Database UsersDatabase & Database Users
Database & Database Users
M.Zalmai Rahmani
 
Anshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management systemAnshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management system
anshjoshi7417
 
Computer applications.pptx
Computer applications.pptxComputer applications.pptx
Computer applications.pptx
Emmanuel235416
 
System Analysis And Design
System Analysis And DesignSystem Analysis And Design
System Analysis And Design
Lijo Stalin
 
Introduction to Database System-WEEK2.pptx
Introduction to Database System-WEEK2.pptxIntroduction to Database System-WEEK2.pptx
Introduction to Database System-WEEK2.pptx
melissaguillermo
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
TOUSEEQHAIDER14
 
Database Management system intro.pptx
Database  Management  system  intro.pptxDatabase  Management  system  intro.pptx
Database Management system intro.pptx
sivamathi12
 
9a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc29a797dbms chapter1 b.sc2
9a797dbms chapter1 b.sc2
Mukund Trivedi
 
DATABASE MANAGEMENT SYSTEMS PPT .pptx
DATABASE MANAGEMENT SYSTEMS PPT    .pptxDATABASE MANAGEMENT SYSTEMS PPT    .pptx
DATABASE MANAGEMENT SYSTEMS PPT .pptx
YogeshGarg228050
 
database management systems for ug students
database management systems for ug studentsdatabase management systems for ug students
database management systems for ug students
veenashinde8
 
Arinda oktaviana 11353204810 vii lokal g
Arinda oktaviana 11353204810   vii lokal gArinda oktaviana 11353204810   vii lokal g
Arinda oktaviana 11353204810 vii lokal g
Arinda oktaviana
 
DATABASE ADMINISTRATION: Identify Physical Database Requirements
DATABASE ADMINISTRATION: Identify Physical Database RequirementsDATABASE ADMINISTRATION: Identify Physical Database Requirements
DATABASE ADMINISTRATION: Identify Physical Database Requirements
birhanugirmay559
 
Anshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management systemAnshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management system
anshjoshi7417
 

More from Nirmalavenkatachalam (6)

Unit 3 ppt.pptx
Unit 3 ppt.pptxUnit 3 ppt.pptx
Unit 3 ppt.pptx
Nirmalavenkatachalam
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
Nirmalavenkatachalam
 
Divide and Conquer / Greedy Techniques
Divide and Conquer / Greedy TechniquesDivide and Conquer / Greedy Techniques
Divide and Conquer / Greedy Techniques
Nirmalavenkatachalam
 
DAA Unit 1.pdf
DAA Unit 1.pdfDAA Unit 1.pdf
DAA Unit 1.pdf
Nirmalavenkatachalam
 
EDA-Unit 1.pdf
EDA-Unit 1.pdfEDA-Unit 1.pdf
EDA-Unit 1.pdf
Nirmalavenkatachalam
 
Bayes Theorem.pdf
Bayes Theorem.pdfBayes Theorem.pdf
Bayes Theorem.pdf
Nirmalavenkatachalam
 
Ad

Recently uploaded (20)

QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Process Parameter Optimization for Minimizing Springback in Cold Drawing Proc...
Journal of Soft Computing in Civil Engineering
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Oil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdfOil-gas_Unconventional oil and gass_reseviours.pdf
Oil-gas_Unconventional oil and gass_reseviours.pdf
M7md3li2
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.Fort night presentation new0903 pdf.pdf.
Fort night presentation new0903 pdf.pdf.
anuragmk56
 
Ad

Unit 2 DATABASE ESSENTIALS.pptx

  • 1. Unit 2-Database Essentials DR. V. NIRMALA DEPARTMENT OF AI & DS EASWARI ENGINEERING COLLEGE
  • 2. Introduction • A database-management system (DBMS) is a collection of interrelated data and a set of programs to access those data. • The collection of data, usually referred to as the database, contains information relevant to an enterprise. • The primary goal of a DBMS is to provide a way to store and retrieve database information that is both convenient and efficient • Database systems are designed to manage large bodies of information. • In addition, the database system must ensure the safety of the information stored, despite system crashes or attempts at unauthorized access. Because information is so important in most organizations, computer scientists have developed a large body of concepts and techniques for managing data.
  • 3. Database-System Applications 1. Enterprise Information Sales: For customer, product, and purchase information. Accounting: For payments, receipts, account balances, assets and other accounting information. Human resources: For information about employees, salaries, payroll taxes, and benefits, and for generation of paychecks. Manufacturing: For management of the supply chain and for tracking production of items in factories, inventories of items in warehouses and stores, and orders for items 2. Banking and Finance : Banking: For customer information, accounts, loans, and banking transactions. Credit card transactions: For purchases on credit cards and generation of monthly statements. Finance: For storing information about holdings, sales, and purchases of financial instruments such as stocks and bonds; also for storing real- time market data to enable online trading by customers and automated trading by the firm. 3. Universities: For student information, course registrations, and grades (in addition to standard enterprise information such as human resources and accounting). 4. Airlines: For reservations and schedule information. Airlines were among the first to use databases in a geographically distributed manner. 5. Telecommunication: For keeping records of calls made, generating monthly bills, maintaining balances on prepaid calling cards, and storing information about the communication networks
  • 4. Purpose of Database Systems • Earlier in 1960’s they used file processing system tog store, manage and retrieve the data. • Needs the help of system programmer to run the application programs to modify, edit and retrieve files. •Keeping organizational information in a file-processing system has a number of major disadvantages: • Data redundancy and inconsistency: Duplication of file (student basic inform) need high storage space, change of data will not be reflected in all files(address change). • Difficulty in accessing data (needs specific application program for each accessing of file) • Data isolation. Because data are scattered in various files, and files may be in different formats, writing new application programs to retrieve the appropriate data is difficult. • Integrity problems: • Atomicity Problem: It is difficult to ensure atomicity in a conventional file-processing system, it must happen in its entirety or not at all (eg: transfer of fund) • Security problems: Application programs are added to the file-processing system in an ad hoc manner, enforcing such security constraints is difficult.
  • 5. View of Data Abstract view of the data. That is, the system hides certain details of how the data are stored and maintained For the system to be usable, it must retrieve data efficiently. The need for efficiency has led designers to use complex data structures to represent data in the database. Since many database-system users are not computer trained, developers hide the complexity from users through several levels of abstraction, to simplify users’ interactions with the system • Physical level. The lowest level of abstraction describes how the data are actually stored. The physical level describes complex low-level data structures in detail. • Logical level. The next-higher level of abstraction describes what data are stored in the database, and what relationships exist among those data. The logical level thus describes the entire database in terms of a small number of relatively simple structures. • View level. The highest level of abstraction describes only part of the entire database. • The view level of abstraction exists to simplify their interaction with the system. • The system may provide many views for the same database
  • 6. View of Data… • At the physical level, an instructor, department, or student record can be described as a block of consecutive storage locations. The compiler hides this level of detail from programmers. Similarly, the database system hides many of the lowest-level storage details from database programmers. Database administrators, on the other hand, may be aware of certain details of the physical organization of the data. • At the logical level, each such record is described by a type definition, as in the previous code segment, and the interrelationship of these record types is defined as well. Programmers using a programming language work at this level of abstraction. Similarly, database administrators usually work at this level of abstraction. • Finally, at the view level, computer users see a set of application programs that hide details of the data types. At the view level, several views of the database are defined, and a database user sees some or all of these views. For example, we may describe a record as follows: This code defines a new record type called instructor with four fields. Each field has a name and a type associated with it. A university organization may have several such record types, including • department, with fields dept name, building, and budget • course, with fields course id, title, dept name, and credits • student, with fields ID, name, dept name, and tot cred
  • 7. Data Models •Underlying the structure of a database is the data model: a collection of conceptual tools for describing data, data relationships, data semantics, and consistency constraints. •A data model provides a way to describe the design of a database at the physical, logical, and view levels •The data models can be classified into four different categories: 1. Relational Model. ◦ The relational model uses a collection of tables to represent both data and the relationships among those data. ◦ Each table has multiple columns, and each column has a unique name. ◦ Tables are also known as relations. ◦ The relational model is an example of a record-based model. ◦ Record-based models are so named because the database is structured in fixed-format records of several types. Each table contains records of a particular type. ◦ Each record type defines a fixed number of fields, or attributes. ◦ The columns of the table correspond to the attributes of the record type. ◦ The relational data model is the most widely used data model, and a vast majority of current database systems are based on the relational model.
  • 8. Data Models… 2. Entity-Relationship Model. ◦ The entity-relationship (E-R) data model uses a collection of basic objects, called entities, and relationships among these objects. ◦ An entity is a “thing” or “object” in the real world that is distinguishable from other objects. ◦ For example, each person in a university is an entity. An entity has a set of properties, and the values for some set of properties may uniquely identify an entity. ◦ For instance, a person may have a person id property whose value uniquely identifies that person. 3. Object-Based Data Model. ◦ Object-oriented programming (especially in Java, C++, or C#) has become the dominant software-development methodology. This led to the development of an object-oriented data model that can be seen as extending the E-R model with notions of encapsulation, methods (functions), and object identity. ◦ The object-relational data model combines features of the object-oriented data model and relational data model. 4. Semistructured Data Model. ◦ The semistructured data model permits the specification of data where individual data items of the same type may have different sets of attributes. ◦ This is in contrast to the data models mentioned earlier, where every data item of a particular type must have the same set of attributes. ◦ The Extensible Markup Language (XML) is widely used to represent semistructured data.
  • 9. Database Languages •A database system provides a data-definition language to specify the database schema and a data-manipulation language to express database queries and updates. •In practice, the data-definition and data-manipulation languages are not two separate languages; instead they simply form parts of a single database language, such as the widely used SQL language. •Data-Manipulation Language • A data-manipulation language (DML) is a language that enables users to access or manipulate data as organized by the appropriate data model. • The types of access are: • Retrieval of information stored in the database • Insertion of new information into the database • Deletion of information from the database • Modification of information stored in the database
  • 10. Database Languages.. • There are basically two types: • Procedural DMLs require a user to specify what data are needed and how to get those data. • Declarative DMLs (also referred to as nonprocedural DMLs) require a user to specify what data are needed without specifying how to get those data. • A query is a statement requesting the retrieval of information. The portion of a DML that involves information retrieval is called a query language. •Data-Definition Language • We specify a database schema by a set of definitions expressed by a special language called a data-definition language (DDL). • The data values stored in the database must satisfy certain consistency constraints. For example, suppose the university requires that the account balance of a department must never be negative. The DDL provides facilities to specify such constraints. The database system checks these constraints every time the database is updated.
  • 11. Database Architecture •The architecture of a database system is greatly influenced by the underlying computer system on which the database system runs. Database systems can be centralized, or client- server, where one server machine executes work on behalf of multiple client machines. •Database applications are usually partitioned into two or three parts, as in Figure. •In a two-tier architecture, the application resides at the client machine, where it invokes database system functionality at the server machine through query language statements.
  • 12. Database Architecture.. •In a three-tier architecture, the client machine acts as merely a front end and does not contain any direct database calls. Instead, the client end communicates with an application server, usually through a forms interface. The application server in turn communicates with a database system to access data. •Three-tier applications are more appropriate for large applications, and for applications that run on the World Wide Web.
  • 13. Relational Model •Relational model can represent as a table with columns and rows. Each row is known as a tuple/ record. Each table of the column has a name or attribute. •A relational database consists of a collection of tables, each of which is assigned a unique name. For example, consider the instructor table, which stores information about instructors. The table has four column headers: ID, name, dept name, and salary. Each row of this table records information about an instructor, consisting of the instructor’s ID, name, dept name, and salary.
  • 14. Relational Model.. • Similarly, the course table of Figure stores information about courses, consisting of a course id, title, dept name, and credits, for each course. Note that each instructor is identified by the value of the column ID, while each course is identified by the value of the column course id • In general, a row in a table represents a relationship among a set of values. Since a table is a collection of such relationships, there is a close correspondence between the concept of table and the mathematical concept of relation, from which the relational data model takes its name. In mathematical terminology, a tuple is simply a sequence (or list) of values. A relationship between n values is represented mathematically by an n-tuple of values, i.e., a tuple with n values, which corresponds to a row in a table. • Thus, in the relational model the term relation is used to refer to a table, while the term tuple is used to refer to a row. Similarly, the term attribute refers to a column of a table. • Relational instance: • We use the term relation instance to refer to a specific instance of a relation, i.e., containing a specific set of rows. The instance of instructor shown has 12 tuples, corresponding to 12 instructors • In the relational database system, the relational instance is represented by a finite set of tuples. Relation instances do not have duplicate tuples • Domain: • For each attribute of a relation, there is a set of permitted values, called the domain of that attribute. • Thus, the domain of the salary attribute of the instructor relation is the set of all possible salary values, while the domain of the name attribute is the set of all possible instructor names. • It contains a set of atomic values that an attribute can take.