Sunteți pe pagina 1din 40

Introduction to

Databases

Faryal Saud
Lecturer
Department of Computer Science
FAST-NU, CFD Campus

CS203 Database Systems 1


Course Particulars

 Credit Hours:
- Four
 Course Structure:
- Three Lectures a week (Each of duration 1 hour).
- Lab class each week

CS203 Database Systems


Recommended Text/Reference
Books
 Fundamentals of Database Systems,
- 3rd Edition by Elmasri & Navathe
 Database System Concepts
- 3rd Edition by Abraham Silbershatz, Henery F. Korth, Sudarshan
 An introduction to Database Systems
- By C.J. Date

CS203 Database Systems


Evaluation and Grading
(Tentative)
Quizzes 10
Assignments 10
Mid Exam 1&2 30
Class Participation 10
Final Exam 40

CS203 Database Systems


Quizzes and Assignments
 Quizzes
- Frequent quizzes of duration 10-15 minutes will be taken.
- Students are required to attend the classes regularly and come
prepared in each class.
 Assignments
- No assignments will be accepted after due date.
- Programming assignments should be well documented.
- Students are “not” allowed to “copy” each other’s work. Any such
work would be marked zero.

CS203 Database Systems


Grading Policy

 All deadlines to be strictly followed


 After deadline, any submitted assignments/
Project Deliverable will be marked as zero
 Rechecking can be requested after grade
reporting, with in 2 days.

CS203 Database Systems


Programming Skills

• Front-End Development
• ASP.NET using C#/VB.Net, C++, PHP
• Back-End Development
• MS-Access, Oracle 9i or higher, MS SQL Server
• Documentation
• ER-Win, Visio, MS-Word

CS203 Database Systems 7


Types of Databases

• Flat Files
• Relational
• Object Relational
• Web Enabled (Online DBs)

CS203 Database Systems 8


Overview

Data: Known facts that can be recorded

Database: Collection of Integrated data


Typically models a real-world “enterprise”

DBMS: A software system designed to store,


manage, and facilitate access to databases.

CS203 Database Systems 9


Data vs. Information

• Data: Raw facts/Un-processed information


But they are building blocks for information

• Information: Data Processed to reveal its


meaning
Information is meaningful
In today’s world, accurate, relevant and timely
information is the key to good decision making
Good decision making is key to survival in
today’s competitive and global environment

CS203 Database Systems 10


Data and Information …
• Data: is known recorded facts which has specific meanings or
interpretation.
Example: the numbers 10.5, 22, and 119 are data

• Information: is a precise, understandable and specific


representation of data.
Example: The temperature of room 119 in building 22 is 10.5, is an information

• Knowledge: is something which is derived or inferred from


available information using some level of intelligence.
Example: Based on experience, the above information can be used to infer that
the room is quite cold and could cause some inconvenience if we work on that
room for a long period of time with out wearing warm clothes.

CS203 Database Systems 11


The Need

CS203 Database Systems 12


Files and Databases

• Files: A collection of records or documents


dealing with one organization, person, area, or
subject. It could either be:
Computer files
Manual files (Paper)
• Database: A collection of similar records with
relationships between records.
Statistical, Business Data

CS203 Database Systems 13


Database vs. File Systems

14
CS203 Database Systems
Database

A database is a collection of stored operational


data used by application systems of some
particular enterprise (C.J. Date)
• Paper Database
• Still contain a large portion of world's knowledge
• File Processing Systems
• Early batch processing of business data
• Database Management Systems (DBMS)
• Will cover in detail

CS203 Database Systems 15


File Processing Systems

Collection of application programs that performs


services for the end-users (e.g. Reports)
Each program defines and maintains its own data

CS203 Database Systems 16


File Processing Systems

CS203 Database Systems 17


-- File-Based Approach

User 1 Application
programs
Data

Data
Application
User 2 programs

CS203 Database Systems 18


Limitations of File-based
Approach
• Separation and isolation of data
Each program maintains its own set of data. Users of one program may be
unaware of potentially useful data held by other programs.

• Duplication of data
Same data is held by different programs. Wasted space and potentially
different values and/or different formats for the same item.

• Atomicity of updates
Failure may lead database to an inconsistent state with partial updates
carried out
E.g. Transfer of funds from one account to another should either be complete
or incomplete, or may be in in-between state

CS203 Database Systems 19


Limitations of File-based
Approach
• Data dependence
File structure is defined in the program code.

• Incompatible file formats


Programs are written in different languages, and so cannot easily access
each others files.

• Integrity Problems
Integrity constraints (e.g. account balance > 0) became “buried” in program
code rather than being stated explicitly
Hard to add new constraint or update existing one
File in the folder cannot keep such conditions

CS203 Database Systems 20


Limitations of File-based
Approach

• Fixed Queries/Proliferation of application


programs
Programs are written to satisfy particular functions. Any new requirement
needs a new program

• Data Redundancy and Inconsistency


Multiple file formats, and duplication of information in different files

• Difficulty in Accessing Data


Need to write a new program for accessing new data

CS203 Database Systems 21


Database Approach
• Overcomes problems associated with file-system
based approach
• Central repository of shared data
• The database holds not only the data but also a
description of the data.
Data dictionary, or metadata
A central location where data descriptions are stored
Data about data
Program-data independence

CS203 Database Systems 22


Advantages of the Database
Approach
• Program-data independence
• The separation of data descriptions from the application programs
that use the data
• Allows the data to change without changing the application programs
• No or Planned data redundancy
• Improved data consistency
• Improved data sharing
• Enforcement of standards

CS203 Database Systems 23


DBMS is a Package

CS203 Database Systems 24


Database Management System
(DBMS)
• DBMS is a software package that enables user to create
and maintain databases. It facilitates:
• Defining a database that involves specifying the data
types, structures, and constraints for the data to be
stored in the database.
• Constructing a database which is the process of
storing the data.
• Manipulating a database such as functions of
querying and sharing the database objects, updating
the database, and generating reports from the data.
• Database and DBMS software together constitute a
database system.
CS203 Database Systems 25
Examples DBMS

• Oracle
• IBM DB2
• Ingress
• Teradata
• MS SQL Server
• MySQL
• MS Access

CS203 Database Systems 26


Database Management System
(DBMS) Features
• A Software Package that enables users to
define, create, maintain, and control access to
the database.
• Data Definition Language (DDL)
• Data Manipulation Language (DML)
• Control access:
• Security, integrity, concurrent access, recovery, support
for data communication, etc.
• Utility services
• File import/export, monitoring facilities, code
generator, report writer, etc.
• Support Ad Hoc queries
CS203 Database Systems 27
DBMS Architecture

Form Processing & Report Processing Applications are build by using VB, DOT Net
or PHP programming. Reports can be developed using Crystal Reports tool.
Query Processing can be managed by using vendors SQL tool or 3rd party tools such
As TOAD, SQL Developer

CS203 Database Systems 28


Data Accessing using DBMS

2-tiers & 3-tiers Architectures

CS203 Database Systems 29


Database Management System
 A software system that is used to create, maintain, and provide
controlled access to user databases

Order Filing
System

Invoicing Central database


DBMS
System
Contains employee,
order, inventory,
pricing, and
Payroll
customer data
System

DBMS manages data resources like an operating system manages hardware resources

CS203 Database Systems 30


Database System Environment

31
CS203 Database Systems
DBMS Benefits

• Minimal data redundancy


• Consistency of data
• Integration of data
• Sharing of data
• Ease of application development
• Uniform security, privacy and integrity controls
• Data accessibility and responsiveness
• Reduced program maintenance
• Data independence

CS203 Database Systems 32


DBMS related Applications

• SQL
• Forms/ Reports
• Web/ Portal
• GUI Client-Server (VB, C++, Java, Mobile)
• SAP/ OracleApps
• BI Applications (SAS, OracleWarehousing)
• Case Tools (Toad Modeler, Enterprise
Architect, VISIO etc)

CS203 Database Systems 33


Components of DBMS
Environment

CS203 Database Systems 34


Components of DBMS
Environment
• Hardware
Can range from a PC to a network of computers
• Software
DBMS, operating system, network software (if necessary) and also
the application programs
• Data
Used by the organization and a description of this data called
schema

CS203 Database Systems 35


Components of DB
Environment …
• Procedures
Instructions and rules that should be applied to the design and use
of the database and DBMS
• People

CS203 Database Systems 36


Database Professionals
• Database implementers
• Build modules that go inside the DBMS
• Database application developers
• Build application that run on top of the DBMS, and are used by end-
users to interact with their data.
• Database Administrators
• Create database schema
• Maintain and tune the DBMS engine
• Maintain and tune the data in the DBMS
• Corporations need them

CS203 Database Systems 37


Roles/ Jobs in the Database
Environment
• Data Administrator (DA)
• Database Administrator (DBA)
• Database Designers (Logical and Physical)
• Applications Programmer
• Database Developer
• Database Analyst
• End users (Naive and sophisticated)

CS203 Database Systems 38


Forms & Reports

CS203 Database Systems 39


CS203 Database Systems 40

S-ar putea să vă placă și