SlideShare a Scribd company logo
1 of 16
SEIYUN UNIVERSITY
College of Applied Science – CS department
Instructor: Dr. Mazin Md. Alkathiri
Information technology Department
Faculty of Applied Sciences
Seiyun University – Yemen
Jan 2024
SEIYUN UNIVERSITY
College of Applied Science – CS department
2
SEIYUN UNIVERSITY
College of Applied Science – CS department
•What is a database ?
•Boring answer
• A structured collection of data
Example: A telephone directory
•Insightful answer
• A data-centered mirror of an organization’s business
processes
Structure of data reflects organizational processes
Content of data reflects organization’s history
3
Database
SEIYUN UNIVERSITY
College of Applied Science – CS department
• Is a computerized system that enables users to create and maintain
a database.
• The DBMS is a general-purpose software system that facilitates the
processes of
• defining,
• constructing,
• manipulating,
• and sharing databases among various users and applications.
• An application program accesses the database by sending queries
or requests for data to the DBMS.
Database Management System (DBMS)
4
SEIYUN UNIVERSITY
College of Applied Science – CS department
Database Applications:
• Banking: all transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Manufacturing: production, inventory, orders, supply chain
• Human resources: employee records, salaries, tax deductions
Databases touch all aspects of our lives
5
SEIYUN UNIVERSITY
College of Applied Science – CS department
• In the early days, database applications were built on top of file systems
• Drawbacks of using file systems to store data:
1. Data redundancy and inconsistency
• Multiple file formats, duplication of information in different files
2. Difficulty in accessing data
• Need to write a new program to carry out each new task
3. Data isolation — multiple files and formats
4. Integrity problems
• Integrity constraints (e.g. account balance > 0) become part of program code
• Hard to add new constraints or change existing ones
Purpose of Database System
6
SEIYUN UNIVERSITY
College of Applied Science – CS department
5. Atomicity of updates
• Failures may leave database in an inconsistent state with partial updates carried out
• E.g. transfer of funds from one account to another should either complete or not
happen at all
6. Concurrent access by multiple users
• Concurrent accessed needed for performance
• Uncontrolled concurrent accesses can lead to inconsistencies
• E.g. two people reading a balance and updating it at the same time
7. Security problems
• Database systems offer solutions to all the above problems
Purpose of Database Systems (Cont.)
7
SEIYUN UNIVERSITY
College of Applied Science – CS department
• Database systems comprise complex data-structures.
• In order to make the system efficient in terms of retrieval of data, and reduce
complexity, developers use abstraction i.e. hide irrelevant details from the users.
• There are mainly 3 levels of data abstraction:
1. Physical level: describes how a record (e.g., customer) is stored.
2. Logical level: describes data stored in database, and the relationships among the data.
type customer = record
name : string;
street : string;
city : integer;
end;
3. View level: application programs hide details of data types. Views can also hide
information (e.g., salary) for security purposes.
Levels of Abstraction
8
SEIYUN UNIVERSITY
College of Applied Science – CS department
• An architecture for a database system
View of Data
9
SEIYUN UNIVERSITY
College of Applied Science – CS department
• An entity represents a real-world object or concept,
• such as an employee or a project from the mini-world that is described in the
database.
• An attribute represents some property of interest that further describes an entity,
• such as the employee’s name or salary.
• A relationship among two or more entities represents an association among the
entities,
• for example, a works-on relationship between an employee and a project.
• Other examples:
 Customer - Orders - Product(s)
 Order - Serviced by - Employee
entities, attributes, and relationships
10
SEIYUN UNIVERSITY
College of Applied Science – CS department
• A relational DB supports storage of data as a set of inter-related tables
 Each table stores data about a set of Entities
 Each table row is a record about one such Entity
 Each record column is a field specifying an attribute of this Entity
 Each record has a field that acts as a unique identifier of an entity
 Relationships among entities are specified by referring to this unique
identifier from other tables
Relational Databases
11
SEIYUN UNIVERSITY
College of Applied Science – CS department
A Sample Relational Database
12
SEIYUN UNIVERSITY
College of Applied Science – CS department
DBMS Languages
13
SEIYUN UNIVERSITY
College of Applied Science – CS department
Data Definition Language (DDL)
• Specification notation for defining the database schema
• E.g.
create table account (
account-number char(10),
balance integer)
• DDL compiler generates a set of tables stored in a data dictionary
• Data dictionary contains metadata (i.e., data about data)
• database schema
SEIYUN UNIVERSITY
College of Applied Science – CS department
Data Manipulation Language (DML)
• Language for accessing and manipulating the data organized by the
appropriate data model
• retrieval, insertion, deletion, and modification of the data.
• DML also known as query language
• Two classes of languages
• Procedural – user specifies what data is required and how to get those data
• FORTRAN, COBOL, ALGOL, are examples of Procedural languges
• Nonprocedural – user specifies what data is required without specifying how to
get those data
• SQL is the most widely used query language
SEIYUN UNIVERSITY
College of Applied Science – CS department
SQL
• SQL: widely used non-procedural language
• E.g. find the name of the customer with customer-id 192-83-7465
select customer.customer-name
from customer
where customer.customer-id = ‘192-83-7465’
• E.g. find the balances of all accounts held by the customer with customer-id 192-83-7465
select account.balance
from depositor, account
where depositor.customer-id = ‘192-83-7465’ and
depositor.account-number = account.account-number
• Application programs generally access databases through one of
• Language extensions to allow embedded SQL
• Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a database

More Related Content

Similar to ESSENTIAL of (CS/IT/IS) class 06 (database)

Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEMDatabase Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEMmoronfolabukunmi
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbmsranjana dalwani
 
Education Data Warehouse System
Education Data Warehouse SystemEducation Data Warehouse System
Education Data Warehouse Systemdaniyalqureshi712
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdfTOUSEEQHAIDER14
 
Introduction to Database system
Introduction to Database systemIntroduction to Database system
Introduction to Database systemPutu Sundika
 
PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...
PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...
PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...AbhiGrover10
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Dios Kurniawan
 
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteRaj vardhan
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra
 
Module 1 - Chapter1.pptx
Module 1 - Chapter1.pptxModule 1 - Chapter1.pptx
Module 1 - Chapter1.pptxSoniaDevi15
 

Similar to ESSENTIAL of (CS/IT/IS) class 06 (database) (20)

Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEMDatabase Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
Database Systems(DBS) Or DATABASE MANAGEMENT SYSTEM
 
Database part1-
Database part1-Database part1-
Database part1-
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbms
 
1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf
 
Education Data Warehouse System
Education Data Warehouse SystemEducation Data Warehouse System
Education Data Warehouse System
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
 
Introduction to Database system
Introduction to Database systemIntroduction to Database system
Introduction to Database system
 
PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...
PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...
PPT Lecture 1.1 and 1.2(Database concepts and database system architecture) (...
 
Database Systems - Lecture Week 1
Database Systems - Lecture Week 1Database Systems - Lecture Week 1
Database Systems - Lecture Week 1
 
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 Complete
 
unit 1.pdf
unit 1.pdfunit 1.pdf
unit 1.pdf
 
Database & Database Users
Database & Database UsersDatabase & Database Users
Database & Database Users
 
Unit1 dbms
Unit1 dbmsUnit1 dbms
Unit1 dbms
 
Dbms_class _14
Dbms_class _14Dbms_class _14
Dbms_class _14
 
6846222.pdf
6846222.pdf6846222.pdf
6846222.pdf
 
DBMS
DBMS DBMS
DBMS
 
Ch1_Intro-95(1).ppt
Ch1_Intro-95(1).pptCh1_Intro-95(1).ppt
Ch1_Intro-95(1).ppt
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnetUtsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra : Introduction to Database and managemnet
 
Module 1 - Chapter1.pptx
Module 1 - Chapter1.pptxModule 1 - Chapter1.pptx
Module 1 - Chapter1.pptx
 

More from Dr. Mazin Mohamed alkathiri

ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)Dr. Mazin Mohamed alkathiri
 
Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BAdvance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BDr. Mazin Mohamed alkathiri
 
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)Dr. Mazin Mohamed alkathiri
 
Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Dr. Mazin Mohamed alkathiri
 

More from Dr. Mazin Mohamed alkathiri (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Advance Mobile Application Development class 05
Advance Mobile Application Development class 05Advance Mobile Application Development class 05
Advance Mobile Application Development class 05
 
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
ESSENTIAL of (CS/IT/IS) class 05 (Software concepts)
 
OS-operating systems- ch03
OS-operating systems- ch03OS-operating systems- ch03
OS-operating systems- ch03
 
OS-operating systems - ch02 - part-2-2024
OS-operating systems - ch02 - part-2-2024OS-operating systems - ch02 - part-2-2024
OS-operating systems - ch02 - part-2-2024
 
Advance Mobile Application Development class 04
Advance Mobile Application Development class 04Advance Mobile Application Development class 04
Advance Mobile Application Development class 04
 
Advance Mobile Application Development class 03
Advance Mobile Application Development class 03Advance Mobile Application Development class 03
Advance Mobile Application Development class 03
 
Advance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-BAdvance Mobile Application Development class 02-B
Advance Mobile Application Development class 02-B
 
OS-ch02-part-1-2024.ppt
OS-ch02-part-1-2024.pptOS-ch02-part-1-2024.ppt
OS-ch02-part-1-2024.ppt
 
Advance Mobile Application Development class 02
Advance Mobile Application Development class 02Advance Mobile Application Development class 02
Advance Mobile Application Development class 02
 
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
 
Advance Mobile Application Development class 01
Advance Mobile Application Development class 01Advance Mobile Application Development class 01
Advance Mobile Application Development class 01
 
ESSENTIAL of (CS/IT/IS) class 02 (HCI)
ESSENTIAL of (CS/IT/IS) class 02 (HCI)ESSENTIAL of (CS/IT/IS) class 02 (HCI)
ESSENTIAL of (CS/IT/IS) class 02 (HCI)
 
Seminar
SeminarSeminar
Seminar
 
ESSENTIAL of (CS/IT/IS)
ESSENTIAL of (CS/IT/IS)ESSENTIAL of (CS/IT/IS)
ESSENTIAL of (CS/IT/IS)
 
OS-ch01-2024.ppt
OS-ch01-2024.pptOS-ch01-2024.ppt
OS-ch01-2024.ppt
 
Mobile Application Development class 008
Mobile Application Development class 008Mobile Application Development class 008
Mobile Application Development class 008
 
Academic Writing (Punctuation ) class 06
Academic Writing (Punctuation ) class 06Academic Writing (Punctuation ) class 06
Academic Writing (Punctuation ) class 06
 
Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07Academic Writing (Technical report writing ) class 07
Academic Writing (Technical report writing ) class 07
 

Recently uploaded

Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

ESSENTIAL of (CS/IT/IS) class 06 (database)

  • 1. SEIYUN UNIVERSITY College of Applied Science – CS department Instructor: Dr. Mazin Md. Alkathiri Information technology Department Faculty of Applied Sciences Seiyun University – Yemen Jan 2024
  • 2. SEIYUN UNIVERSITY College of Applied Science – CS department 2
  • 3. SEIYUN UNIVERSITY College of Applied Science – CS department •What is a database ? •Boring answer • A structured collection of data Example: A telephone directory •Insightful answer • A data-centered mirror of an organization’s business processes Structure of data reflects organizational processes Content of data reflects organization’s history 3 Database
  • 4. SEIYUN UNIVERSITY College of Applied Science – CS department • Is a computerized system that enables users to create and maintain a database. • The DBMS is a general-purpose software system that facilitates the processes of • defining, • constructing, • manipulating, • and sharing databases among various users and applications. • An application program accesses the database by sending queries or requests for data to the DBMS. Database Management System (DBMS) 4
  • 5. SEIYUN UNIVERSITY College of Applied Science – CS department Database Applications: • Banking: all transactions • Airlines: reservations, schedules • Universities: registration, grades • Sales: customers, products, purchases • Manufacturing: production, inventory, orders, supply chain • Human resources: employee records, salaries, tax deductions Databases touch all aspects of our lives 5
  • 6. SEIYUN UNIVERSITY College of Applied Science – CS department • In the early days, database applications were built on top of file systems • Drawbacks of using file systems to store data: 1. Data redundancy and inconsistency • Multiple file formats, duplication of information in different files 2. Difficulty in accessing data • Need to write a new program to carry out each new task 3. Data isolation — multiple files and formats 4. Integrity problems • Integrity constraints (e.g. account balance > 0) become part of program code • Hard to add new constraints or change existing ones Purpose of Database System 6
  • 7. SEIYUN UNIVERSITY College of Applied Science – CS department 5. Atomicity of updates • Failures may leave database in an inconsistent state with partial updates carried out • E.g. transfer of funds from one account to another should either complete or not happen at all 6. Concurrent access by multiple users • Concurrent accessed needed for performance • Uncontrolled concurrent accesses can lead to inconsistencies • E.g. two people reading a balance and updating it at the same time 7. Security problems • Database systems offer solutions to all the above problems Purpose of Database Systems (Cont.) 7
  • 8. SEIYUN UNIVERSITY College of Applied Science – CS department • Database systems comprise complex data-structures. • In order to make the system efficient in terms of retrieval of data, and reduce complexity, developers use abstraction i.e. hide irrelevant details from the users. • There are mainly 3 levels of data abstraction: 1. Physical level: describes how a record (e.g., customer) is stored. 2. Logical level: describes data stored in database, and the relationships among the data. type customer = record name : string; street : string; city : integer; end; 3. View level: application programs hide details of data types. Views can also hide information (e.g., salary) for security purposes. Levels of Abstraction 8
  • 9. SEIYUN UNIVERSITY College of Applied Science – CS department • An architecture for a database system View of Data 9
  • 10. SEIYUN UNIVERSITY College of Applied Science – CS department • An entity represents a real-world object or concept, • such as an employee or a project from the mini-world that is described in the database. • An attribute represents some property of interest that further describes an entity, • such as the employee’s name or salary. • A relationship among two or more entities represents an association among the entities, • for example, a works-on relationship between an employee and a project. • Other examples:  Customer - Orders - Product(s)  Order - Serviced by - Employee entities, attributes, and relationships 10
  • 11. SEIYUN UNIVERSITY College of Applied Science – CS department • A relational DB supports storage of data as a set of inter-related tables  Each table stores data about a set of Entities  Each table row is a record about one such Entity  Each record column is a field specifying an attribute of this Entity  Each record has a field that acts as a unique identifier of an entity  Relationships among entities are specified by referring to this unique identifier from other tables Relational Databases 11
  • 12. SEIYUN UNIVERSITY College of Applied Science – CS department A Sample Relational Database 12
  • 13. SEIYUN UNIVERSITY College of Applied Science – CS department DBMS Languages 13
  • 14. SEIYUN UNIVERSITY College of Applied Science – CS department Data Definition Language (DDL) • Specification notation for defining the database schema • E.g. create table account ( account-number char(10), balance integer) • DDL compiler generates a set of tables stored in a data dictionary • Data dictionary contains metadata (i.e., data about data) • database schema
  • 15. SEIYUN UNIVERSITY College of Applied Science – CS department Data Manipulation Language (DML) • Language for accessing and manipulating the data organized by the appropriate data model • retrieval, insertion, deletion, and modification of the data. • DML also known as query language • Two classes of languages • Procedural – user specifies what data is required and how to get those data • FORTRAN, COBOL, ALGOL, are examples of Procedural languges • Nonprocedural – user specifies what data is required without specifying how to get those data • SQL is the most widely used query language
  • 16. SEIYUN UNIVERSITY College of Applied Science – CS department SQL • SQL: widely used non-procedural language • E.g. find the name of the customer with customer-id 192-83-7465 select customer.customer-name from customer where customer.customer-id = ‘192-83-7465’ • E.g. find the balances of all accounts held by the customer with customer-id 192-83-7465 select account.balance from depositor, account where depositor.customer-id = ‘192-83-7465’ and depositor.account-number = account.account-number • Application programs generally access databases through one of • Language extensions to allow embedded SQL • Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a database