CSC.
222 - Database Systems
Prof. Dr. Muhammad Saleem Vighio
Department of Computer Science,
Quaid-e-Awam University, Nawabshah.
August 15, 2023
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 1 / 32
Lecture 1 - Introduction
Course introduction
Basic concepts
I Database
I Database management system
I Database types
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 2 / 32
Course introduction
Course credit hours (C.Hs)
I Theory - 3 C.Hs (45 lecture hours)
I Practical - 1 C.H (45 lecture hours)
Text books
I Fundamentals of Database Systems, R. Elmasri and S. B. Navathe, 5th ed.
I Fundamentals of Database Management Systems, M. I. Gillenson, 2nd ed.
Reference books
I Database System, T. Connolly and C. Begg, 4th edition
I An Introduction to Database Systems, C.J. Date, 8th edition
I Database System Concepts, A. Silberschatz, H. F. Korth & S. Suarshan, 6th
edition
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 3 / 32
Course Introduction
Tools
I Microsoft SQL server
I Visual studio (C#)
Networking laboratory
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 4 / 32
Course Introduction
Teaching plan
I 20% sessional work
F 2 Tests (tentatively after 12th and 35th lectures)
F Assignments
I 20% mid-semester
I 60% final examination
Database project (2 students per group)
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 5 / 32
Course Introduction
Lecture slides/announcements/results can be found at course page
I https://saleem.quest.edu.pk
Video tutorials
I https://www.youtube.com/channel/UCdk4CzdpDzFX7k96ODIIRSg
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 6 / 32
During the Lectures
Be punctual and arrive in time
Concentrate on the lecture
Remain active and interactive
Switch off your mobile phones
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 7 / 32
What is data?
Known facts that can be recorded and have an implicit meaning.
I e.g., name, age, address, etc.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 8 / 32
History of data management
People have been interested in data for at least the past 12,000 years.
Non-computer, primitive methods of data storage and handling.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 9 / 32
History of data management
Shepherds kept track of their flocks with pebbles.
A primitive but legitimate example of data storage and retrieval.
Source: Gillenson, M. I., Fundamentals of Database Management Systems
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 10 / 32
History of data management
Dating back to 8500 B.C., unearthed clay tokens or “counters” may
have been used for record keeping in primitive forms of accounting.
Scholars believe that clay tokens were used to express numerical
quantities of goods. They occur in two sizes (larger and smaller), a
difference that may have been used as a means of counting and
manipulating quantities.
Source: Gillenson, M. I., Fundamentals of Database Management Systems
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 11 / 32
History of data management
With time, different kinds of data were kept
I calendars, census data, surveys, land ownership records, marriage
records, records of donations, family trees, etc.
Source: Gillenson, M. I., Fundamentals of Database Management Systems
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 12 / 32
Importance of data
Data has become indispensable to every kind of modern business and
government organization.
I important resource for making policies, decisions, and future predictions
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 13 / 32
Voluminous data
The volume of data that the companies and organization maintain is
increasing massively.
I Walmart estimates its data warehouse contains hundreds of terabytes
(trillions of characters) of data.
I In March 2023, around 2.4 billion (2,400,000,000) visitor visited
Amazon.com.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 14 / 32
Problems in Managing Data
Difficult to store and to provide efficient, accurate access to data.
Additional issues include:
I data security,
I data privacy,
I backup and recovery,
I consistency and accuracy, etc.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 15 / 32
What is a Database?
an organized collection of related data stored and accessed
electronically.
I e.g., Train reservation system, NBP online banking, Instagram, etc.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 16 / 32
Unorganised Data
Unorganized student data
18
21bscs45
Suk
Saleem
Hyd
21bscs20
Kashif
Faheem
18
21bscs40
19
Khi
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 17 / 32
Organized Data
Organized student data
id name age loc
21bscs20 Saleem 19 Hyd
21bscs40 Faheem 18 Khi
21bscs45 Kashif 18 Suk
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 18 / 32
Non-related and Related Data
Return the names of students who earned grade B.
Student Enrolled
id Name C. No Grade
11 Areeba CS20 A
Assets Assets
22 Hamza CS21 B
33 Halar CS22 B
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 19 / 32
Non-related and Related Data
Return the names of students who earned grade B.
Student Enrolled
id Name id C. No Grade
11 Areeba 11 CS20 A
Assets Assets
22 Hamza 22 CS21 B
33 Halar 33 CS22 B
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 20 / 32
Types of Database and Applications
Traditional database applications
I Store textual or numeric information
Multimedia database
I Store images, audio clips, and video streams digitally
Geographic information systems
I Store and analyze maps, weather data, and satellite images
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 21 / 32
Types of Database and Applications
Data warehouses and online analytical processing (OLAP) systems
I Extract and analyze useful business information from very large
databases
I Support decision making
Real-time and active database technology
I Control industrial and manufacturing processes
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 22 / 32
Types of Database and Applications
More recent examples
I Mobile database
F Stored by the mobile device, e.g., list of contacts, price information,
distance travelled, or any other information
I Cloud database
F Database built to run on a cloud environment, e.g., Google Drive,
Dropbox, Slack, etc.
I Big data storages
F Apache Hadoop, Spotify, Splunk, etc.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 23 / 32
Database operations
a database can be created (or defined), constructed, manipulated,
and shared.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 24 / 32
Database operations
Defining a database refers to specifying the data types, structures,
and constraints of the data to be stored.
I create table Persons (PersonID int primary key,
FirstName varchar(255), Address text);
PersonId FirstName City
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 25 / 32
Database operations
Constructing the database is the process of storing the data on some
storage medium that is controlled by the DBMS.
PersonID FirstName City
101 Fahad Hyd
102 Saima N.Shah
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 26 / 32
Database operations
Manipulating involves querying and updating the database miniworld
and generating reports.
I return names of students who earned grade A in database
I update location of Ali from Nawabshah to Hyderabad
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 27 / 32
Database operations
Sharing allows multiple users and programs to access the database
simultaneously.
I e.g., Google, Facebook, NBP database provide sharing facility
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 28 / 32
What is a database management system?
A software tool to facilitate the creation and management of the
database. A DBMS serves as an interface between an end-user and a
database, allowing users to create, read, update, and delete data in
the database.
source:https://www.techopedia.com/
SQL server, MySQL, MS-Access, MongoDB, PostG, Oracle are a few
examples of database management system software.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 29 / 32
Components of DBMS
Source:https://www.bmc.com/
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 30 / 32
DBMS Types
Relational: RDBMSs allow data to be stored and retrieved in the
format of tables. All the tables in the RDBMS are associated with
each other and relations are established using primary and foreign
keys. Structured query language (SQL) is used to interact with
relational databases. Microsoft SQL, MySQL, and Oracle are some
popular examples of relational DBMSs.
Document database management systems (DoDBMS or NoSQL):
DoDBMSs are non-tabular databases and store data differently than
relational tables. DoDBMSs store data in the form of documents
(similar to JavaScript Object Notation), key-values, wide-columns,
and graphs. MongoDB query language (MQL) is used for database
operations. MongoDB, Azure Cosmos are some popular examples of
DoDBMS.
Other DBMS types include Object oriented, Hierarchical, Network
databases.
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 31 / 32
Resources
Lecture slides/announcements/results can be found at course page
I https://saleem.quest.edu.pk
Video tutorials
I https://www.youtube.com/channel/UCdk4CzdpDzFX7k96ODIIRSg
SQL queries
I https://www.w3schools.com/sql/
Prof. Dr. Muhammad Saleem Vighio CSC.222 - Database Systems 32 / 32