Database Management Concepts

Slides:



Advertisements
Similar presentations
Relational Databases Chapter 4.
Advertisements

Introduction to Databases Transparencies
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Databases and Database Management Systems
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
IST Databases and DBMSs Todd S. Bacastow January 2005.
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
2.3 Organising Data for Effective Retrieval
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
DATABASE MANAGEMENT SYSTEMS BASIC CONCEPTS 1. What is a database? A database is a collection of data which can be used: alone, or alone, or combined /
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Database Technical Session By: Prof. Adarsh Patel.
Introduction: Databases and Database Users
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Chapter 7: Database Systems Succeeding with Technology: Second Edition.
Databases and Statistical Databases Session 4 Mark Viney Australian Bureau of Statistics 5 June 2007.
I Information Systems Technology Ross Malaga 4 "Part I Understanding Information Systems Technology" Copyright © 2005 Prentice Hall, Inc. 4-1 DATABASE.
Instructor: Dema Alorini Database Fundamentals IS 422 Section: 7|1.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Database Systems DBMS Environment Data Abstraction.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Database and Information Management Chapter 9 – Computers: Understanding Technology, 3 rd edition.
Flat Files Relational Databases
UNIVERSITI TENAGA NASIONAL “Generates Professionals” MODULE 5 : Part 1 INTRODUCTION TO DATABASE.
Chapter 3: Relational Databases
© 2017 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
Fundamental of Database Systems
Introduction to Databases Transparencies
Introduction to Databases Transparencies
Databases and DBMSs Todd S. Bacastow January
Database Development Lifecycle
Lesson 10 Databases.
Database Management.
Datab ase Systems Week 1 by Zohaib Jan.
Databases Chapter 16.
Database Management:.
Information Systems Today: Managing in the Digital World
Database Management System
Introduction To Database Systems
Introduction to Databases
Introduction to Databases Transparencies
Introduction to Databases
Introduction to Databases
Information Systems Database Management
Chapter 4 Relational Databases
Database Management  .
Databases and Information Management
What is a Database and Why Use One?
Introduction to Database Management System
Basic Concepts in Data Management
Introduction to Databases
MANAGING DATA RESOURCES
Databases and Information Management
Flat Files & Relational Databases
Computer Science Projects Database Theory / Prototypes
Introduction to Databases
Introduction to Databases
Database Design Hacettepe University
Chapter 9: Database Systems
Introduction to Databases Transparencies
DATABASE TECHNOLOGIES
DATABASE Purpose of database
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Presentation transcript:

Database Management Concepts A2 Computing 3.9 Databases F453

Key Points Flat & Relational Entity Relationships Normalisation Primary, Secondary, Foreign Keys Data Consistency Data Integrity Data Redundancy DBMS Data Dictionary DDL DML SQL

Database Terminology A database is… A collection of data/tables/records Table names are also known as ENTITIES A record is… A collection of completed fields about a particular entity. A row in a database. TUPLE A field is…. Part of a record containing one specific data item. Eg. Name, Address, DOB, Genre ATTRIBUTE

Primary and Foreign Key A Primary Key is a Unique Identifier within a table. Foreign key is a field in one table which is also the primary key of another table. Foreign keys are used to establish a relationship between the main table and other subsidiary tables.

Secondary Key A field that is unique to that record that isn’t the primary key, but it could be. Eg… EmployeeID, Name, NINumber, PhoneNo Primary Key Secondary Key

Flat File Databases FirstName Surname ContactNo DateOfBirth Cost InstructorName John Hainsworth 01474 678456 25/05/1989 25 20 Hansworth 15 Tony Hodson 01474 212394 07/09/1984 Mike Setvenson 01474 665498 15/11/1990 Denton Sharon Hart 22/04/1985 Richard Ellis 01474 151884 12/08/1988 Muller Lucie Harris 01474 908 123 14/12/1990 Beccy Lock 01474 505783 03/06/1984 Omar Ibqual 01474 689236 05/07/1991 Gareth Jones 01474 889322 26/06/1985 Seb 01474 255873 21/06/1986 10 Harries

Problems with Flatfile Databases Duplicate records Spelling mistakes could be made If John changed his telephone number, it would have to be changed 3 times

Redundancy and Integrity Data Redundancy Unnecessary duplication of data Data Integrity The consistency of data How correct it is

Relationships One to one An instructor teaches a course One to many An instructor teaches more than one course Many to many Activity Instructor Activity Instructor Activity Instructor

Normalisation Breaks things down to smallest possible units 1st Normal Form 2nd Normal Form 3rd Normal Form

Problems with Data Redundancy and Integrity Un-normalised StudentID Forename Surname ActivityID Activity Instructor 100012 David Jackson 1 4 3 Riding Windsurfing Climbing Susie Holman Jim Jackson David Smith 100011 Susie Thomas 100014 Jerry Kilmer 2 Windsurding 4x4 Driving Tom Wilson 100016 Lisa Terry Data is un-normalised. Problems with Data Redundancy and Integrity

1st Normal Form No repeating attributes Still has Data Redundancy Primary Key StudentID Forename Surname ActivityID 100012 David Jackson 1 4 3 100011 Susie Thomas 100014 Jerry Kilmer 2 100016 Lisa Terry Foreign Key ActivityID Activity Instructor 1 Riding Susie Holman 2 4x4 Driving Tom Wilson 3 Climbing David Smith 4 Windsurfing Jim Jackson No repeating attributes Still has Data Redundancy Repeating Student Names Primary Key

2nd Normal Form Use Link Table StudentID Forename Surname 100012 David Jackson 100011 Susie Thomas 100014 Jerry Kilmer 100016 Lisa Terry ActivityID Activity Instructor 1 Riding Susie Holman 2 4x4 Driving Tom Wilson 3 Climbing David Smith 4 Windsurfing Jim Jackson StudentID ActivityID 100012 1 3 100014 2 100016 Use Link Table

3rd Normal Form StudentID Forename Surname 100012 David Jackson 100011 Susie Thomas 100014 Jerry Kilmer 100016 Lisa Terry ActivityID Activity InstructorID 1 Riding 2 4x4 Driving 3 Climbing 4 Windsurfing Booking ID StudentID ActivityID 1 100012 2 3 100014 4 100016 InstructorID Instructor 1 Susie Holman 2 Tom Wilson 3 David Smith 4 Jim Jackson

Entity Relationship Diagram 3NF 3NF – Never have a Many to Many Relationship No repeating data fields (aside from primary and foreign keys) Student Booking Activity Instructor

Database Management System DBMS Separates the physical data and the user interface that accesses the data Many different employees accessing the same data via a server Allows program-data independence

Problems with Sharing Data Many users access the same data file Concurrent Access What if 2 users are trying to edit the same data item simultaneously? Database Management System Record Locking

DBMS example DBMS is a ‘layer’ of software that operates between the data and the applications that access the data

Role of DBMS Software that acts as an interface between user and database Allows the definition / creation / maintenance / manipulation of the database Creation and maintenance of the data dictionary Backup and recovery Security

Software used to control access to data DBMS Database Management System provides an interface between the data and the user Software used to control access to data

Three levels of DBMS External Conceptual Internal The users view of the data. The complexities of the data are hidden from the user so this view is the front-end. Conceptual The entities, structure, attributes and relationships. Internal This describes how the data is stored physically and how it will be accessed.

Advantages & Disadvantages of DBMS Security Data Independence The data is independent from the programs and applications that interact with it Data is easily shared and distributed Disadvantages Expensive Closely monitor security System failure

Items in Data Dictionary A file containing descriptions of data in database used by database managers when altering database structure names of tables characteristics of data (e.g. length, data type) relationships between data identifies primary keys identifies foreign keys defines access rights

Data definition language (DDL) DDL is the language used to control the structure of the database (Schema) It is used to create new entities, attributes, keys and relationships. Create and manage Data Dictionary Access Rights Create Database Create Table PrimaryKey = PupilID

DDL Example

Common DDL commands

Data Manipulation Language - DML Allows control and modification and manipulation of Data Insert Delete Amend Update Retrieve SQL - Query

DDL controls the data structure and DML controls the actual data DDL & DML DDL controls the data structure and DML controls the actual data

Structured Query Language (SQL) SQL is a 4th generation programming language that is used to create databases and insert, update and extract data Syntax gives a command word that tells system what operation to carry out instructions to tell system what parts of database to carry operation out on SQL is a DDL and a DML because it allows applications to query a database as well as inserting & updating data

Structured Query Language Query a database using the following SQL commands: SELECT FROM WHERE ORDER BY

SQL Example Consider the table FORM To delete 7C from the table: DELETE FROM Form WHERE Formname = ‘7C’ To insert a new row: INSERT INTO Form VALUES (‘7E’, ‘Mr Post’, 205) 205 doesn’t need quotes because it is numeric Formname Formteacher Formroom 7A Mr Brown 102 7B Mr Collins 301 7C Miss Jones 107 7D Mrs Smith 201

To create SQL reports Formname Formteacher Formroom 7A Mr Brown 102 7B Mr Collins 301 7C Miss Jones 107 7D Mrs Smith 201 7E Mr Post 205 SELECT * FROM Form WHERE Formteacher = “Mrs Smith” This gives: 7D Mrs Smith 201 SELECT Formroom from Form WHERE Formteacher = “Mrs Smith” This gives: 201 SELECT Formname FROM Form Where Formroom < 200 What does this do?