Data vs. Information. Data vs. Information. Where We Are. FIT1004 Database Topic 1: Introduction

Similar documents
Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

ISM 318: Database Systems. Objectives. Database. Dr. Hamid R. Nemati

Chapter 1. Database Systems. Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel

Introduction. Chapter 1. Introducing the Database. Data vs. Information

CHAPTER 2 DATABASE MANAGEMENT SYSTEM AND SECURITY

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

Databases What the Specification Says

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

Chapter 1 - Database Systems

SQL Introduction Chapter 7, sections 1 & 4. Introduction to SQL. Introduction to SQL. Introduction to SQL

Study Notes for DB Design and Management Exam 1 (Chapters 1-2-3) record A collection of related (logically connected) fields.

CC414 Database Management Systems

Introduction to Databases

Chapter 1. Writing Basic. SQL Statements

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Database 10g Edition: All possible 10g features, either bundled or available at additional cost.

Displaying Data from Multiple Tables

1. INTRODUCTION TO RDBMS

æ A collection of interrelated and persistent data èusually referred to as the database èdbèè.

CIS 631 Database Management Systems Sample Final Exam

Overview of Database Management Systems

Chapter 2. Data Model. Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel


Displaying Data from Multiple Tables. Chapter 4

Database System Architecture & System Catalog Instructor: Mourad Benchikh Text Books: Elmasri & Navathe Chap. 17 Silberschatz & Korth Chap.

Producing Readable Output with SQL*Plus

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

Concepts of Database Management Seventh Edition. Chapter 7 DBMS Functions

Relational Database Basics Review

Fundamentals of Database Design

Introduction to Database Systems

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components

Oracle Database 10g: Introduction to SQL

BCA. Database Management System

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

Overview of Database Management

Data Models and Database Management Systems (DBMSs) Dr. Philip Cannata

The Entity-Relationship Model

Database Concepts. Database & Database Management System. Application examples. Application examples

- Eliminating redundant data - Ensuring data dependencies makes sense. ie:- data is stored logically

Files. Files. Files. Files. Files. File Organisation. What s it all about? What s in a file?

DATABASE DESIGN AND IMPLEMENTATION USING VISUAL BASIC

DATABASE INTRODUCTION

SQL, PL/SQL FALL Semester 2013

SQL Simple Queries. Chapter 3.1 V3.0. Napier University Dr Gordon Russell

TIM 50 - Business Information Systems

Database Management System

Basic Concepts of Database Systems

B.Com(Computers) II Year RELATIONAL DATABASE MANAGEMENT SYSTEM Unit- I

1 File Processing Systems

Answers to Review Questions

Week 1 Part 1: An Introduction to Database Systems. Databases and DBMSs. Why Use a DBMS? Why Study Databases??

Chapter 2 Database System Concepts and Architecture

SQL*Plus User s Guide and Reference

Core Syllabus. Version 2.6 B BUILD KNOWLEDGE AREA: DEVELOPMENT AND IMPLEMENTATION OF INFORMATION SYSTEMS. June 2006

COURSE NAME: Database Management. TOPIC: Database Design LECTURE 3. The Database System Life Cycle (DBLC) The database life cycle contains six phases;

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language:

Database Management Systems. Chapter 1

Foundations of Information Management

IT2304: Database Systems 1 (DBS 1)

COMP5138 Relational Database Management Systems. Databases are Everywhere!

DATABASE MANAGEMENT SYSTEM

Chapter 1: Introduction. Database Management System (DBMS)

B.Sc (Computer Science) Database Management Systems UNIT-V

Data Hierarchy. Traditional File based Approach. Hierarchy of Data for a Computer-Based File

2. Basic Relational Data Model

IT2305 Database Systems I (Compulsory)

not necessarily strictly sequential feedback loops exist, i.e. may need to revisit earlier stages during a later stage

Lesson 8: Introduction to Databases E-R Data Modeling

Types & Uses of Databases

5. CHANGING STRUCTURE AND DATA

Database IST400/600. Jian Qin. A collection of data? A computer system? Everything you collected for your group project?

Chapter 13 File and Database Systems

Chapter 13 File and Database Systems

Foundations of Business Intelligence: Databases and Information Management

Benefits of Normalisation in a Data Base - Part 1

AVOIDANCE OF CYCLICAL REFERENCE OF FOREIGN KEYS IN DATA MODELING USING THE ENTITY-RELATIONSHIP MODEL

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Figure Sample 3GL COBOL Program

Database Management. Chapter Objectives

Database Design Methodology

ECS 165A: Introduction to Database Systems

7. Databases and Database Management Systems

Chapter 1 Databases and Database Users

Database Management. Technology Briefing. Modern organizations are said to be drowning in data but starving for information p.


Oracle Database: SQL and PL/SQL Fundamentals NEW

Chapter 3. Database Environment - Objectives. Multi-user DBMS Architectures. Teleprocessing. File-Server

DATABASE SYSTEM CONCEPTS AND ARCHITECTURE CHAPTER 2

Procedural Extension to SQL using Triggers. SS Chung

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. Introduction to Databases. Why databases? Why not use XML?

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 1 Outline

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ:

Subqueries Chapter 6

Oracle/SQL Tutorial 1

Object Oriented Databases. OOAD Fall 2012 Arjun Gopalakrishna Bhavya Udayashankar

DATABASE MANAGEMENT SYSTEMS

The first time through running an Ad Hoc query or Stored Procedure, SQL Server will go through each of the following steps.

Relational Algebra. Query Languages Review. Operators. Select (σ), Project (π), Union ( ), Difference (-), Join: Natural (*) and Theta ( )

Transcription:

FIT1004 Database Topic 1: Introduction Learning Objectives: Data, Database, DBMS Understand the motivation for the Database Approach The Database System Environment Objectives of Database Technology DBMS Functions DB Models Relational Database Model References: Rob, P. & Coronel, C., Database Systems, 7 th Edition, Chapter 1, Chapter 2 - Sections 2.1, 2.3, 2.4 Data vs. Information Data are raw facts. Facts concerning people, places, events, or other objects/concepts. Data by itself is useless unless it is some how aggregated, organised and prepared in a form convenient for decision making or other organisational activities. Data that is processed to reveal their meaning becomes information, eg. total sales per quarter A lack of data leads to inadequate information and thus illinformed decisions and business failure. Data is a valuable corporate resource which needs adequate integrity and security controls. Data management is a discipline that focuses on the proper generation, storage and retrieval of data www.infotech.monash.edu.au/fit1004/ 3 Where We Are Data vs. Information Introduction to Database Systems The Relational Model Database Lifecycle Conceptual Design Logical Design Normalisation Physical Design Implementation SQL (DML) SQL (DDL & DCL) Transaction Management Database Administration Data Warehousing & Data Mining 2 4

Database and DBMS Traditional File Systems A database is a shared integrated computer structure that houses a collection of: end user data Metadata, or data about data, through which the data is integrated and managed A database management system (DBMS) is a collection of programs that manages the database structure and controls access to the data stored in the database contains a query language 5 Requests for information (reports) required a DP specialist to write programs for the department that required the report File systems developed to address needs Data was organized in the files according to expected use - led to islands of information To retrieve data required extensive programming in third-generation language (3GL), this was time consuming and made ad hoc queries impossible Often the same data was stored in many different locations, eg. agent details occurred in both the CUSTOMER and AGENT files 7 Traditional File Systems Traditional File Systems Databases are often contrasted to traditional file systems though they are now rarely used. But as the problems that existed were the impetus for the development of the Database Concept it is worth noting some of these. In the past as new applications were written they used existing files or created a new file for their use. Sometimes several existing files need to be sorted and merged to obtain the new file. Often several files contained the same information stored in different ways. In other words, there would be redundant and possibly inconsistent data. Example of an insurance company file Problems: Requires extensive programming in third-generation language (3GL) Data and structural dependence Data redundancy 6 8

Traditional File Systems Traditional File Systems Data Dependence Changes in file s data characteristics requires modification of data access programs Must tell program what to do and how Makes file systems cumbersome from a programming and data management views Structural Dependence Change in file structure requires modification of related programs Data Redundancy Different and conflicting versions of same data Results of uncontrolled data redundancy > Data anomalies Modification, Insertion, Deletion Applications were often considered in relative isolation. Data that should have been together was not. The potential for flexible enquiry and reporting was limited. All validations were in the programs. Procedures were required for backup and recovery. All programmers had access to all records. There was limited concurrent access. 9 11 Traditional File Systems Database Systems Data Redundancy (cont) Data inconsistency > Lack of data integrity File Terminology Field > group of characters with specific meaning Record > logically connected fields that describe a person, place, or thing File > collection of related records Consists of logically related data stored in a single repository Provides advantages over file system management approach Eliminates inconsistency, data anomalies, data dependency, and structural dependency problems Stores data structures, relationships, and access paths The centralised control of data means that for many applications the data already exists. The data is no longer related by application programs, but by the structure defined in the database. 10 12

Database vs. File Systems Objectives of Database Technology Data Independence Minimal Data Redundancy Increased Data Sharing Improved Data Quality Improved Security of Data Improved Access to Data Reduced Program Maintenance Inter-relate data thru the model 13 15 The Database System Environment Data Independence Is the property of being able to change the logical or physical structure of data without requiring changes to application programs that manipulate that data Data is stored independently of the programs The degree to which descriptions of data are embedded in application programs. Can the database structure be changed with no impact on programs? Role of the database catalog or dictionary. Maintenance costs are high! 14 16

Logical vs Physical Data Independence Sharing of Data Application Program Local Views Logical Data Independence GLOBAL LOGICAL DATABASE DESCRIPTION Physical Files Physical Data Independence 17 The DBMS should support multiple concurrent users of the same data and ensure that the data remains consistent at all times. TX 1 Part 2 QOH 10 TX 2 Part 2 QOH 10 QOH=QOH+10 Part 2 QOH 20 Part 2 QOH 5 Part 2 QOH 10 QOH=QOH-5 19 Minimal Data Redundancy Minimise the duplication of data data stored in more than one location CUSTOMER CNbr, CName, CAddress INVOICE InvNbr, InvDate, CNbr, InvTotal, CAddress CUSTOMER CNbr, CName, CAddress, Last_InvNbr, Last_InvDate INVOICE InvNbr, InvDate, CNbr, InvTotal CUSTOMER CNbr, CName, CAddress, CBalance INVOICE InvNbr, InvDate, CNbr, InvTotal 18 Sharing of Data To avoid concurrency problems, transactions must be made logically serial. One common technique used is record locking. That is, a transaction can lock a record, preventing update by another transaction, until the update has completed. Trans 1 Xlock(P1) Read P1 (20) QOH = QOH + 15 Write P1 (35) Unlock Part # QOH P1 20 Part # QOH P1 35 Part # QOH P1 25 Trans 2 Attempt to Lock Wait for Trans 1 Read P1 (35) QOH = QOH - 10 Write P1 (25) 20

Data Integrity Easy Access to Data A condition in which given data always yield the same result Validation or integrity rules should be defined and automatically invoked at run time by the DBMS regardless of the source of update i.e. application program, web page or query language. Significant variation exists among DBMSs in the level of support for data integrity. ANSI/ISO suggest that 100% of all enterprise rules should be held in the conceptual schema, and specifically none in application programs. An area of significant development during the 1990's. 21 Objects and data in the database can be created, modified and accessed by executing structured query language (SQL) statements SQL provides easy access to data 20 READ #1, CUSTNO, NAME, BAL 30 IF END #1 GO TO 80 40 IF BAL > 200 50 PRINT CUSTNO, NAME, BAL 60 ENDIF 70 etc SELECT CUSTNO, NAME, BAL FROM CUST WHERE BAL > 200; 23 Security Data Access Using SQL Protecting data against accidental or intentional use by unauthorised users Each user requires identification with a user-id and password. Users can be limited in the data they can see and what actions they can perform on that data. The DBMS encrypts and decrypts data as it is stored and retrieved. Many DBMS now provide data value sensitive security. Views are often used to limit user s access to data SQL statement is entered SQL> SQL> SELECT SELECT loc loc 2 2 FROM FROM dept; dept; Data is displayed LOCATION ---------------------------- NEW YORK CHICAGO BOSTON Statement is sent to database Database 22 24

Overview of SQL Overview of SQL DDL Data Definition Language the language component of a DBMS that is used to describe the logical, and sometimes physical, structure of a database is used to specify the conceptual and internal schemas for the database DML Data Manipulation Language a language component of a DBMS that is used to access and modify the contents (data) of a database 25 DML (cont) UPDATE > modify column values DELETE > delete rows of data Data Control COMMIT > commit changes to the database ROLLBACK > rollback (undo) changes Data Security GRANT > grant access privileges to users REVOKE > remove access privileges 27 Overview of SQL DBMS Functions DDL the SQL commands for data definition are CREATE, ALTER, DROP CREATE TABLE > define table ALTER TABLE > add new columns or modify existing columns DROP TABLE > delete table DML the SQL commands for data manipulation are SELECT, INSERT, UPDATE, DELETE SELECT > retrieve data from table INSERT > add a single row or copy rows from other table(s) 26 Data dictionary management stores the definitions of data and their relationships (metadata) in a data dictionary; any changes made are automatically recorded in the data dictionary. creates a security system and enforces security within that system. Data storage management creates and manages the complex structures required for data storage. Data transformation and presentation transforms entered data to conform to the data structures that are required to store the data 28

DBMS Functions Database Models Security management creates a security system and enforces security within that system. Multi-user access control creates complex structures that allow multiple-user access to the data. Backup and recovery management performs backup and data recovery procedures to ensure data safety. Collection of logical constructs used to represent data structure and relationships within the database Conceptual models: logical nature of data representation Implementation models: emphasis on how the data are represented in the database Relationships in Conceptual Models One-to-one (1:1) One-to-many (1:M) Many-to-many (M:N) Implementation Database Models Hierarchical Network Relational 29 31 DBMS Functions Database Models Data integrity management promotes and enforces integrity rules to eliminate data integrity problems Database language and application programming interfaces provides access to the data via utility programs and from programming languages interfaces. Database communication interfaces provides end-user access to data within a computer network environment. 30 Hierachical Logically represented by an upside down tree > Each parent can have many children > Each child has only one parent Network Each record can have multiple parents > Composed of sets > Each set has owner record and member record > Member may have several owners Relational Perceived by user as a collection of tables for data storage Tables are a series of row/column intersections Tables related by sharing common entity characteristic(s) 32

Relational Database Model Relational Database Management System Advantages Structural independence Improved conceptual simplicity Easier database design, implementation, management, and use Ad hoc query capability with SQL Powerful database management system Disadvantages Substantial hardware and system software overhead Poor design and implementation is made easy May promote islands of information problems User tables Server Data dictionary 33 35 Definition of a Relational Database A relational database is a collection of relations or two-dimensional tables. Table Name: EMP EMPNO ENAME JOB DEPTNO 7839 KING PRESIDENT 10 7698 BLAKE MANAGER 30 7782 CLARK MANAGER 10 10 7566 JONES MANAGER 20 Database Table Name: DEPT DEPTNO DNAME LOC 10 10 ACCOUNTING NEW YORK 20 20 RESEARCH DALLAS 30 30 SALES CHICAGO 40 40 OPERATIONS BOSTON 1 Relational Database Terminology 2 3 4 EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 6 ------------- ------------ --------------------- -------- ---------------- ----------- -------------- ----------- 7839 KING PRESIDENT 17-NOV-81 5000 10 7698 BLAKE MANAGER 7839 01-MAY-81 2850 30 7782 CLARK MANAGER 7839 09-JUN-81 2450 10 7566 JONES MANAGER 7839 02-APR-81 2975 20 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 7900 JAMES CLERK 7698 03-DEC-81 950 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 7902 FORD ANALYST 7566 03-DEC-81 3000 20 7369 SMITH CLERK 7902 17-DEC-80 800 20 7788 SCOTT ANALYST 7566 09-DEC-82 3000 20 7876 ADAMS CLERK 7788 12-JAN-83 1100 20 7934 MILLER CLERK 7782 23-JAN-82 1300 10 5 34 36

Relational Database Terminology Relation a named collection of attributes Tuple the collection of values that compose one row of a relation Attribute a named characteristic or property of an entity Properties of Relations the tuples of a relation have no ordering (top to bottom) the attibutes of a relation have no ordering (left to right) the entries in the table (attributes) are single valued Each row of data in a table is uniquely identified by a primary key (PK). Table Name: EMP Relating Multiple Tables You can logically relate data from multiple tables using foreign keys (FK). EMPNO ENAME JOB DEPTNO 7839 KING PRESIDENT 10 7698 BLAKE MANAGER 30 7782 CLARK MANAGER 10 7566 JONES MANAGER 20 Table Name: DEPT DEPTNO DNAME LOC 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON The degree of a relation is the number of attributes in that relation The cardinality is the number of tuples in the relation 37 Primary key Foreign key Primary key 39 Relational Database Terminology Summary Relationships between entities are supported by attributes which are common to both entities Primary Key an attribute or attributes that uniquely identify a record instance or tuple in a relation Foreign Key an attribute or combination of attributes of one relation R2 whose values are required to match those of the PK of relation R1, where R1 and R2 are not necessarily distinct a FK and the corresponding PK should be defined on the same domain 38 Information is derived from data, which are usually stored in a database A DBMS is software that implements and manages a database Databases were developed to address the weaknesses of file systems A DBMS presents to the user a single data repository that promotes data sharing Enforces data integrity, eliminates redundancy and promotes data security 40