0% found this document useful (0 votes)
37 views

Lecture Notes 1.0 Introduction To Databases

Uploaded by

huzaifa40894089
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Lecture Notes 1.0 Introduction To Databases

Uploaded by

huzaifa40894089
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Introduction to Database

Database Management Systems


Instructor: Maryam Munawar
Outline
• Database definition
• DBMS
• Database application
• Limitation of file based system
• Advantages of DB
• Disadvantages of DB
• Database components
• Database users
Definitions
• Data:
Recorded facts and figures.
• Information:
Processed data.
• Database:
A collection of related data.
OR
A collection of data arranged for ease and speed of search and retrieval.
Database System
• Database:
A very large, integrated collection of data.
• Models a real-world enterprise
• Entity is a distinct object (e.g., teams, games)
• Attribute is the property that describes the entity (e.g., teams has team_id, team_name,
no_of_players)
• Relationship is an association between entries (e.g., The Forty-Niners are playing in The
Superbowl)
• DBMS (Database management system)
DBMS (Database management System)
• The software that manages and controls access to the database.
• It provides users with
• Data definition language (DDL)
• Data manipulation language (DML)
• Data control language (DCL)
• DRL/DQL - Data Retrieval Language / Data Query Language
• TCL - Transaction Control Language
• It provides controlled access to the database.

• Examples
MySQL, PostgreSQL, Microsoft Access, SQL Server, Oracle etc.
Data Definition Language (DDL)
Data Definition Language (DDL) or Schema Definition Language statements are used to
define the database structure or schema.
• CREATE - create an object in the database
• ALTER - alter the structure of an object in the database
• DROP - destroy an object from the database
• TRUNCATE - remove all records from a table; the space allocated for the records is also
released
• COMMENT - add comments to the data dictionary
• RENAME - rename an object in the database
Data Manipulation Language (DML)
Data Manipulation Language (DML) statements are used for managing data within schema
objects.
• INSERT - insert data into a table
• UPDATE - update existing data in a table
• DELETE - delete record(s) from a table, the space for the records remains there.
• MERGE - UPSERT operation (insert or update)
• CALL - call a SQL or Java subprogram
• EXPLAIN PLAN - explain access path to Data
• LOCK TABLE - control concurrency
Data Retrieval Language / Data Query
Language (DRL/DQL)
• SELECT - retrieve data from the a database
Data Control Language (DCL)
Data Control Language (DCL) statements. Some examples:
• GRANT - gives user's access privileges to database
• REVOKE - withdraw access privileges given with the GRANT command
Transaction Control (TCL)
Transaction Control (TCL) statements are used to manage the changes made by
DML statements. It allows statements to be grouped together into logical
transactions.
• COMMIT - save work done
• SAVEPOINT - identify a point in a transaction to which you can later roll Back
• ROLLBACK - restore database to original since the last COMMIT
• SET TRANSACTION - Change transaction options like isolation level and
what rollback segment to use
Database Applications
• Where we use database?
• Answer is everywhere.
• Banking
• Airlines
• Sales
• Universities
• Manufacturing
• Web-based services
Search query
Search place
Traditional File-Based Systems

• A collection of application programs that perform services for the end-users such as the production
of reports. Each program defines and manages its own data.
Limitations of file-based system

• Separated and Isolated Data


• Data redundancy
• Data inconsistency
• Data dependence
• Fixed queries
Database Approach
Library Examination Registration
Library Examination Registration
Applications Applications Applications

Database
Management
System

Database and DBMS


were emerged as a
University new approach.
Students
Database
Integrated Database Environment
DATABASE DBMS APPLICATION
OUTPUT

Individual
Student
Schedules
Student
Scheduling

Class
Student Data DBMS Lists
Class Data
Faculty Data
Enroll Data

Faculty Final
Scheduling Faculty
Schedules

Paychecks &
Paystubs

Payroll

Payroll
Report
Interactive
Users
Advantages of database

• Data sharing
• Controlled redundancy
• Data consistency
• Data independence
• Improved data integrity
• Data dictionary – Meta data
• Better data accessibility
Disadvantages of Databases

• Complexity
• Higher hardware costs
• Higher programming costs
• High conversion costs
• Increased vulnerability
• More difficult recovery
Components of the DBMS Environment

• Hardware
• Software
• Data
• People
Database Users

• End users • Database Administrator


• Use the database (DBA)
system to achieve • Designs & manages
some goal the database system
• Application developers • Database systems
• Write software to allow programmer
end users to interface • Writes the database
with the database software itself
system
Why Study Database?
• Databases are useful
• Many computing applications deal with large amounts of information
• Database systems give a set of tools for storing, searching and managing this
information
• Databases in CS
• Databases are a ‘core topic’ in computer science
• DBMS encompasses much of CS in a practical discipline
Reference
• Database systems: A Practical Approach to Design, Implementation, And Management, Connolly,
T. M. & Begg, C. E., 6th Edition (2015), Pearsons.

You might also like