Good database design will get you through poor
programming better than good programming will get you
through poor database design….
• A database system consists
• Data (the database)
• We focus mainly on the
• Database systems allow
DATABASE MANAGEMENT SYSTEMS
• A database management system (DBMS) is
software that permits an organization to centralize
data, manage them efficiently, and provide access
to the stored data by application programs.
• The DBMS relieves the programmer or end user
from the task of understanding where and how
the data are actually stored by separating the
logical and physical views of the data
• The logical view presents data as they would be
perceived by end users or business specialists,
whereas the physical view shows how data are
actually organized and structured on physical
• The database management software makes the
physical database available for different logical
views required by users
How a DBMS Solves the Problems of the Traditional
• A DBMS reduces data redundancy and
inconsistency by minimizing isolated files in which
the same data are repeated.
• The DBMS uncouples programs and data, enabling
data to stand on their own. Access and availability
of information will be increased and program
development and maintenance costs reduces.
• Relational databases represent data as two‐
dimensional tables (called relations).
• Tables may be referred to as files.
• Each table contains data on an entity and its
Relational Database Definitions
• Entity: Object, Concept or event (subject)
• Attribute: a Characteristic of an entity
• Row or Record: the specific characteristics of one
• Table: a collection of records
• Database: a collection of tables
• Tables represent entities
• Tables are always named in the singular, such as:
Vehicle, Order, Grade, etc.
• Tables in database jargon are “flat files”, dBase or
• Characteristics of an entity
• Vehicle (VIN, color, make, model, mileage)
• Student (SSN, Fname, Lname, Address)
• Fishing License (Type, Start_date, End_date)
• A View is an individual’s picture of a database. It
can be composed of many tables, unbeknownst to
• It’s a simplification of a complex data model
• It provides a measure of database security
• Views are useful, primarily for READ‐only users and are
not always safe for CREATE, UPDATE, and DELETE.
• Many applications today and in the future require
databases that can store and retrieve not only
structured numbers and characters but also
drawings, images, photographs, voice, and full‐
• DBMS designed for organizing structured data into
rows and columns are not well suited to handling
graphics based or multimedia applications.
• Object‐oriented databases are better suited
• for this purpose.
Find the names and street addresses of those
MovieStars who stay in the city “Columbus”:
where MovieStar.address.city = “Columbus”;
Databases in the Cloud
• Cloud computing providers offer database
management services, but these services typically
have less functionality than their on‐premises
• Primary customer base for cloud‐based data
management consists of Web focused start‐ups or
small to medium‐sized businesses looking for
database capabilities at a lower price than a
standard relational DBMS.
Data Model: What’s a model?
• A data model is a representation of reality
• It’s used to define the storage and manipulation of
a data base.
• Data Models have two components:
• Structure: the structure of the data stored within
• Operations: Facilities for manipulation of the data.
Capabilities of database
• DBMS includes capabilities and tools for organizing,
managing, and accessing the data in the database.
• The most important are its
• data definition language,
• data dictionary, and
• data manipulation language.
Structured Query Language
• The most prominent data manipulation language
today is Structured Query Language SQL.
• Data Definition Language (DDL) statements are used to
define the database structure or schema. Some examples:
• CREATE ‐ to create objects in the database
• ALTER ‐ alters the structure of the database
• DROP ‐ delete objects from the database
• TRUNCATE ‐ remove all records from a table, including all spaces
allocated for the records are removed
• COMMENT ‐ add comments to the data dictionary
• RENAME ‐ rename an object
• Data Manipulation Language (DML) statements are used for
managing data within schema objects. Some examples:
• SELECT ‐ retrieve data from the a database
• INSERT ‐ insert data into a table
• UPDATE ‐ updates existing data within a table
• DELETE ‐ deletes all records from a table, the space for the records
• CALL ‐ call a PL/SQL subprogram
• LOCK TABLE ‐ control concurrency
• Data Control Language (DCL) statements. Some examples:
• GRANT ‐ gives user's access privileges to database
• REVOKE ‐ withdraw access privileges given with the GRANT
• Refers to the most common Database Operations:
• Operations occur at all levels: Tables, Records,
Types of Keys
Serves as the row level addressing mechanism in the relational
It can be formed through the combination of several items.
A column or set of columns within a table that are required to
match those of a primary key of a second table.
These keys are used to form a RELATIONAL JOIN ‐ thereby
connecting row to row across the individual tables.
Relational Database Management System
Name Address Parcel #
John Smith 18 Lawyers Dr. 756554
T. Brown 14 Summers Tr. 887419
Parcel # Assessed Value
Constructing Join Relationships
• One‐to‐many relationships include the Primary Key
of the ‘one’ table and a Foreign Key (FK) in the
Other common terms
• Cardinality: one‐to‐one, one‐to‐many, many‐to‐
• Optionality: the relationship is either mandatory or
• Normalization: The process of structuring data to
minimize duplication and inconsistencies.
• The process usually involves breaking down a single
Table into two or more tables and defining
relationships between those tables.
• Normalization is usually done in stages, with each
stage applying more rigorous rules to the types of
information which can be stored in a table.
• End users
• Use the database system to
achieve some goal
• Application developers
• Write software to allow end
users to interface with the
• Database Administrator
• Designs & manages the
Common Functions of DBA
• Database Planning
• Standards, procedures, enforcement
• Requirements Gathering and Conceptual Design
• Logical Design
• Physical Design and Implementation
• Testing and Debugging
• Operations and Maintenance
• Training and Support
DBA Activity DBA Service
Organizing Policies, Procedures,
Testing Data Security, Privacy, Integrity
Monitoring Data backup and Recovery
Data Security, Privacy and Integrity
• User Access Management
• Define each user to the database
• Operating System Level
• Database Level
• Assign Passwords
• Define User Groups
• Assign Access Privileges
• Physical Access Control
• View Definitions
• Protect and Control the Scope of the Data that is accessible to a user
• DBMS utilities access control
• Limit the use of query and reporting tools
• DBMS usage Monitoring
• Audit Logs
(More difficult in distributed databases)
Data Backup and Recovery
• Disaster Management
• Periodic Data and Application Backups
• Proper Backup Identification
• Convenient and safe backup storage
• Physical protection of hardware and software
• Personal Access Control to the software of a database