Database Systems - Lec 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Database Systems

Lecture #1
Topic: Introduction to Database Management Systems
Instructor: Dr Ayesha Naseer
Course Learning Objectives
CS-220 Database Systems
Course Learning Outcomes (CLOs)
At the end of the course the students will be able to: PLOs BT Level*
1 Explain database architecture, relational database management systems based on 1
real-life databases. C2

2 Demonstrate database systems Conceptually, logically, and physically for real


world systems. 3 C3

3 Analyze the database anomalies and breaks down relations using Normalization 4 C4
rules.
4 Formulate SQL query to access data within the relational databases. 5 C3
5 Use structured Query Language (SQL) to manage database systems and 5
extracting data efficiently. P4
Course Material
Course Contents
Week/ Lec Topic CLOs

1. Introduction to Database Management CLO1


2. Introduction to Database Development CLO1
3. Conceptual Database Design (ERDs) CLO2
4. Developing Data Models for Business Databases CLO2
5. Converting ERDs to Relational Tables CLO2
6. Query Formulation with SQL (DDL) CLO2
7. Database systems Anomalies/Redundancy CLO3
8. Functional Dependencies/Canonical Cover of FDs CLO3
9. Normalization as designing/refining Tool CLO3
10. Nested Queries CLO2
Mid Exam
11. Aggregate Functions (Min, Max, Avg, Count, Sum)/Group by Having clauses CLO2
12. SQL Joins (Inner, Outer, Self) CLO2
13. Nested Queries with Joins CLO2
14. Introduction to T-SQL CLO2
15. SQL Stored Procedures CLO 2
16. SQL Triggers CLO2
17. Transaction Management CLO2
Final Exam
Assessments

3 X QUIZZES 3 X ASSIGNMENTS MID TERM EXAM FINAL EXAM LAB PROJECT


10% 10% 30% 50% 30%
Why Database Systems?
▪ Your life is dramatically affected by database technology. You come into contact with databases daily
basis through activities such as withdrawing cash using ATM, shopping at a supermarket, ordering
book online and registering for classes.
▪ The convenience of your life is partly due to proliferation of computerized databases and supporting
database technology.
▪ Database technology is not only improving the daily operations of organization but also the quality of
decision that affect our lives.
▪ Databases contain a flood of data about many aspects of our lives: consumer preferences,
telecommunications usage, credit history, television viewing habits, and so on. Database technology
helps to summarize this mass of data into useful information for decision making.
▪ Management uses information gleaned from databases to make long-range decisions such as
investing in plants and equipment, locating stores, adding new items to inventory, and entering new
businesses.
Data, Information, Knowledge
Data
known facts stored and recorded can include text, numbers, dates, plus images, sound, video, and other
complex objects
Information
Data presented in context (can be summarized data)
Data vs. Information Data that has been processed increasing the user's knowledge
Data is known and available; Information is processed and more useful
Information Systems
Databases exist as part of an information system.
Components of Information Systems
▪ A system is a set of related components that work together to accomplish some
objectives. Objectives are accomplished by interacting with the environment and
performing functions.
▪ An information system is like a physical system (such as the circulatory system)
except that an information system manipulates data rather than a physical object
like blood.
▪ An information system accepts data from its environment, processes data, and
produces output data for decision making.
Example of Information System for
Student Loan Processing

▪ Databases are essential components of many information systems.


▪ The role of a database is to provide long-term memory for an information system.
The long-term memory contains entities and relationships.
Database Characteristics
▪ Database is a collection of persistent data that can be shared and interrelated.
▪ Persistent means that data reside on stable storage such as a magnetic disk. For example,
organizations need to retain data about customers, suppliers, and inventory on stable
storage because these data are repetitively used. Persistency depends on relevance of
intended usage.
▪ Shared means that a database can have multiple uses and users. A database provides a
common memory for multiple functions in an organization. For example, a personnel
database can support payroll calculations, performance evaluations, government reporting
requirements, and so on. Many users can access a database at the same time. For example,
many customers can simultaneously make airline reservations.
▪ Interrelated means that data stored as separate units can be connected to provide a whole
picture. For example, a customer database relates customer data (name, a d d r e s s , . . . )
to order data (order number, order d a t e , . . . ) to facilitate order processing.
Simple Database Example to Depict Database Characteristics
Entity is a cluster of data usually about a single subject that can be accessed
together. An entity can denote a person, place, thing, or event. For example, a
personnel database contains entities such as employees, departments, and
skills as well as relationships showing employee assignments to departments,
skills possessed by employees, and salary history of employees. A typical
business database may have hundreds of entities and relationships.
Simple Database Example to Depict Database
Characteristics
Features of Database Management Systems
A database management system (DBMS) is a collection of components that
supports the creation, use, and maintenance of databases.
Features of Database Management Systems
1. Database Definition
To define a database, the entities and relationships must be specified. In most commercial DBMSs, tables
store collections of entities. A table has a heading row (first row) showing the column names and a body
(other rows) showing the contents of the table. Relationships indicate connections among tables. For
example, the relationship connecting the student table to the enrollment table shows the course offerings
taken by each student.

ER Assistant - ERD
UML - ERD
Features of Database Management Systems
2. Nonprocedural Access
The most important feature of a DBMS is the ability to answer queries. A query
is a request for data to answer a question. For example, the user may want to
know customers having large balances or products with strong sales in a
particular region.
Nonprocedural access allows users with limited computing skills to submit
queries. The user specifies the parts of a database to retrieve, not
implementation details of how retrieval occurs. Implementation details involve
coding complex procedures with loops.
Nonprocedural languages do not have looping statements (for, while, and so on)
because only the parts of a database to retrieve are specified.
Features of Database Management Systems
3. Procedural Language Interface
▪ Procedural Language Interface is a method to combine a nonprocedural language
such as SQL with a programming language.
▪ DBMSs provide the full capabilities of a programming language. For example JAVA
Script integrated with SQL Server/My SQL. Java script allows full customization of
database access, form processing, and report generation.
▪ Most commercial DBMSs have a procedural language interface. For example, Oracle
has the language PL/SQL and Microsoft SQL Server has the language Transact-SQL.
Features of Database Management Systems
4. Transaction processing
▪ Transaction processing enables a DBMS to process large volumes of repetitive work.
▪ A transaction is a unit of work that should be processed reliably without
interference from other users and without loss of data due to failures. Examples of
transactions are withdrawing cash at an ATM, making an airline reservation, and
registering for a course.
▪ A DBMS ensures that transactions are free of interference from other users, parts of
a transaction are not lost due to a failure, and transactions do not make the
database inconsistent.
Features of Database Management Systems
5. Database Tuning
▪ In addition to features provided directly by vendors of DBMSs, third-party software is
also available for many DBMSs.
▪ In most cases, third-party software extends the features available with the database
software. For example, many third-party vendors provide advanced database design
tools that extend the database definition and tuning capabilities provided by DBMSs.

Entity Relationship Diagram (ERD) for University Database


Summary of Features of DBMSs
Evolution of Database Technology
Architectures of DBMSs
▪ In order to develop conceptual understanding about internal organization of DBMSs,
this section describes two architectures or organizing frameworks.
▪ These architectures promote a conceptual understanding rather than indicate how
an actual DBMS is organized.
1. Data Independence and the Three Schema Architecture
2. Distributed Processing and the Client-Server Architecture
Data Independence and the Three Schema Architecture
The concept of data independence emerged to alleviate problems with program maintenance. Data
independence means that a database should have an identity separate from the applications
(computer programs, forms, and reports) that use it. The separate identity allows the database
definition to be changed without affecting related applications.
In the mid-1970s, the concept of data independence led to the proposal of the Three Schema
Architecture. The word schema as applied to databases means database description.
Data Independence and the Three Schema Architecture
The Three Schema Architecture includes three levels of database description. The
external level is the user level. Each group of users can have a separate external view
(or view for short) of a database tailored to the group's specific needs.
In contrast, the conceptual and internal schemas represent the entire database. The
conceptual schema defines the entities and relationships. For a business database,
the conceptual schema can be quite large, perhaps hundreds of entity types and
relationships. Like the conceptual schema, the internal schema represents the entire
database.
However, the internal schema represents the storage view of the database whereas
the conceptual schema represents the logical meaning of the database. The internal
schema defines files, collections of data on a storage device such as a hard disk. A file
can store one or more entities described in the conceptual schema.
University Database Example Depicting Differences among
Schema Levels

External Schema Conceptual Schema

Internal Schema
Distributed Processing and the Client-Server Architecture
▪ With the growing importance of network computing and the Internet, distributed
processing is becoming a crucial function of DBMSs. Distributed processing allows
geographically dispersed computers to cooperate when providing data access.
▪ Many DBMSs support distributed processing using a client-server architecture. A
client is a program that submits requests to a server. A server processes requests on
behalf of a client.
Career Opportunities Related to Database Application development
and database administration
▪ Because databases are pervasive, there are a variety of ways in which you may
interact with databases.
▪ The classification in following figure distinguishes between functional users who
interact with databases as part of their work and information systems professionals
who participate in designing and implementing databases. Each box in the hierarchy
represents a role that you may play. You may simultaneously play more than one
role.
Career Opportunities Related to Database Application development
and database administration
▪ Functional users can play a passive or an active role when interacting with databases.
▪ Indirect usage of a database is a passive role. An indirect user is given a report or some data extracted
from a database.
▪ A parametric user is more active than an indirect user. A parametric user requests existing forms or
reports using parameters, input values that change from usage to usage. For example, a parameter
may indicate a date range, sales territory, or department name.
▪ The power user is the most active. Because decision-making needs can be difficult to predict, ad hoc
or unplanned usage of a database is important. A power user is skilled enough to build a form or
report when needed.
▪ Information systems professionals interact with databases as part of developing an information
system.
▪ Analyst/programmers are responsible for collecting requirements, designing applications, and
implementing information systems.
▪ Database administrators assist both information systems professionals and functional users. Database
administrators have a variety of both technical and nontechnical responsibilities . Technical skills are
more detail-oriented; nontechnical responsibilities are more people-oriented.
▪ Information resource management is a response to the challenge of effectively utilizing information
technology. The goal of information resource management is to use information technology as a tool
for processing, distributing, and integrating information throughout an organization.
Database Development Process
Phases of Database development
1. Conceptual Data Modeling
The conceptual data modeling phase uses data requirements and produces entity relationship
diagrams (ERDs) for the conceptual schema and for each external schema. Data requirements can have
many formats such as interviews with users, documentation of existing systems, and proposed forms
and reports. The conceptual schema should represent all the requirements and formats.

ER Assistant - ERD UML - ERD


Phases of Database development
2. Logical Database Design
The logical database design phase transforms the conceptual data model into a format understandable
by a commercial DBMS. The logical design phase is not concerned with efficient implementation.
Rather, the logical design phase is concerned with refinements to the conceptual data model.
The logical database design phase consists of two refinement activities: conversion and normalization.
The conversion activity transforms ERDs into table designs using conversion rules. The normalization
activity removes redundancies in a table design using constraints or dependencies among columns.
Phases of Database development
4. physical Database Design
The physical database design phase, like the distributed database design phase, is
concerned with an efficient implementation. Unlike distributed database design,
physical database design is concerned with performance at one computer location
only. If a database is distributed, physical design decisions are necessary for each
location.
Skills in Database Development
As a database designer, you need two different kinds of skills as depicted in following Figure.
The conceptual data modeling and logical database design phases involve mostly soft skills.
Soft skills are qualitative, subjective, and people-oriented. Qualitative skills emphasize the
generation of feasible alternatives rather than the best alternatives.
Distributed database design and physical database design involve mostly hard skills. Hard
skills are quantitative, objective, and data intensive. A background in quantitative disciplines
such as statistics and operations management can be useful to understand mathematical
models used in these phases. Many of the decisions in these phases can be modeled
mathematically using an objective function and constraints.
Resources
▪ Chapter 1, Michael V. Mannion., Database Design, Application Development, and
Administration, , Mc Graw Hill Publishers, 3rd edition,
▪ Chapter 1, Avi Silberschatz, Henry F. Korth, S. Sudarshan, Database Systems
Concepts, Mc Graw Hill Publishers, 7th edition
▪ Chapter 1, Elmasri and Navathe. Fundamentals of Database Systems. Addison-
Wesley, 7th edition, 2007.

You might also like