1 U3O2: Structure & Role of Relational Databases Flat File Vs Relational Database Refer to the software as “database management system (DBMS)” –E.g. Access,

Slides:



Advertisements
Similar presentations
Organisation Of Data (1) Database Theory
Advertisements

BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
UNIVERSITY OF PALESTINE business computer application College of Business Instructor: Mr. Ahmed Abumosameh.
VCE IT Theory Slideshows - ITA By Mark Kelly McKinnon Secondary College Vceit.com Database Normalisation Version 1.
The Relational Database Model:
Accounting Databases Chapter 2 The Crossroads of Accounting & IT
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
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?
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
MELISSA PICO SUMMER 08 Data Storage & Retrieval: Access instead of Excel.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Relational Database Need to Knows. What is a database? Data - is just a pile of numbers or stats. A business "organises" the data to be meaningful and.
2.3 Organising Data for Effective Retrieval
Unit 18: Database Modelling
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
U3O2: Structure & Role of Relational Databases
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Concepts and Terminology Introduction to Database.
VCE IT Theory Slideshows - ITA By Mark Kelly McKinnon Secondary College Vceit.com Updated by Jenny Gielb Chisholm Institute of TAFE, Dandenong Database.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
MIS 301 Information Systems in Organizations Dave Salisbury ( )
DATABASE DESIGN USING MICROSOFT ACCESS. What is a Database?  DMS Database management system  Database Collection of data organized in a manner that.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
CORE 2: Information systems and Databases NORMALISING DATABASES.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
Information Systems Today (©2006 Prentice Hall) 3-1 CS3754 Class Note 12 Summery of Relational Database.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
1 n 1 n 1 1 n n Schema for part of a business application relational database.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms – Project 5.
IT Applications Theory Slideshows By Mark Kelly Vceit.com Last modified : 6 Dec 2013 Databases II: Structure, naming, data types, data formats.
Database collection of related information stored in an organized form Database program software tool for storage & retrieval of that information.
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
Databases.
Database: Relational Vs Flat File. Databases - Structure Flat file database, contains only one table Relational database, contains more than one table.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Database revision.
1 Technology in Action Chapter 11 Behind the Scenes: Databases and Information Systems Copyright © 2010 Pearson Education, Inc. Publishing as Prentice.
Relational Database. I. Relational Database 1. Introduction 2. Database Models 3. Relational Database 4. Entity-Relationship Models 5. RDB Design Principles.
Relational Databases. Relational database  data stored in tables  must put data into the correct tables  define relationship between tables  primary.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
IT Applications Theory Slideshows Databases II: Structure, Naming, data types, data formats.
Database Management Systems (DBMS)
Lesson 2: Designing a Database and Creating Tables.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
Flat Files Relational Databases
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
NORMALIZATION. What is Normalization  The process of effectively organizing data in a database  Two goals  To eliminate redundant data  Ensure data.
Database design Using Access 2007
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Sample Table Standard Notation Entity name in uppercase
Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.
N5 Databases Notes Information Systems Design & Development: Structures and links.
VCE IT Theory Slideshows
U3O2: Structure & Role of Relational Databases
Lesson 10 Databases.
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
Databases Chapter 9 Asfia Rahman.
GO! with Microsoft Office 2016
GO! with Microsoft Access 2016
Database Normalisation VCE IT Theory Slideshows - Informatics
Relational Database Model
Presentation transcript:

1 U3O2: Structure & Role of Relational Databases Flat File Vs Relational Database Refer to the software as “database management system (DBMS)” –E.g. Access, Filemaker, OpenOffice Base. Refer to the product created with the software as a “database”. –E.g. student records, music collection.

2 Structure & Role of Relational Databases A primary key: A field attached to each record in a database. The value of this key should be unique for each record in the database Egs. number plates on cars, TFN’s, student numbers. Form, a form allows an input screen to be formatted and linked to an underlying table or query. Query, to filter a set of data Report, formats the query data and enables summary statistics to be added Macros, carry out a set of predetermined tasks, eg. print

3 Structure & Role of Relational Databases Data Formats: text fixed decimal places Date Date/time Dollar, currency True/false, Boolean logic Data Types:Text, (string) String data types include a series of symbols or values, such as a character string (a sequence of characters) or a binary string ( a sequence of binary values)

4 Structure & Role of Relational Databases Data Types:

5 Q. So, what IS a relational database? Types of Databases A.A database with 2 or more related tables. A RDMS in addition to storing data stores data relationships between tables. A flat file database has a single table and often suffers from inefficient repetition of data. Normalisation is the process of removing this repetition by crafting relationships between tables.

6 Flat file NameDepartmentBossPhone SmithSalesBritney Lurgi JonesSalesBritney Lurgi LennonSalesBritney Lurgi SadeTransportTom Brick MasochTransportTom Brick STAFF TABLE NameDepartment SmithSales JonesSales LennonSales SadeTransport MasochTransport DEPARTMENTS TABLE DepartmentBossPhone SalesBritney Lurgi TransportTom Brick No unnecessary data repetition + Department info easily modified in one operation. Relational

7 Types of Relationships, connection between data One-to-one relationship: Eg. Airline’s passenger details: passengersSeats 1 Each passenger has only one seat and each seat can be assigned to only one passenger. A record in one table is connected to only one record in a second table.

8 Types of Relationships, connection between data One-to-many relationship: Eg. customer details & job quotation: The one supplier can provide MANY products, but each product comes from ONE supplier. Also, eg. several workers share single telephone extensions; each extension record is related to several employee’s records.

9 Types of Relationships, connection between data many-to-many relationship: Eg. Student details and subjects tables: Each student studies many subjects and each subject has many students studentssubjects

10 Advanced A multi-table real-life database such as a commercial system with tables for … –Client data –Supplier data –Inventory –Sales

Determining a RDBMS structure Need to determine which field in each database will be the Primary Key, a value which is unique for each record, eg. customer ID no) Foreign keys, fields are used to ensure that if you are entering data in one table, it already has a corresponding value in another Used to create relationships between tables Used to enforce referential integrity by ensuring relationships between tables remain consistent No uniqueness constraint for a foreign key 11

Determining a RDBMS structure Foreign keys: 12 The Book ID field in the customer table is a foreign key.

Determining a RDBMS structure Table Normalisation Table normalisation –Process of efficiently organising data in a database –Use of a set of rules to check for anomalies or deviations in data structure to ensure fields are in the correct tables –Process: Eliminates redundant data, (eg. storing the same data in more than one table); saves lots of storage space and speeds up data access Changes need only be made in one place rather than in many places. Ensures data dependencies make sense, (only storing related data in a table). 13

Determining a RDBMS structure Table Normalisation Table normalisation Changes need only be made in one place rather than in many places. Ensures data dependencies make sense, (only storing related data in a table). More powerful data access is possible 14

Determining a RDBMS structure Table Normalisation Table normalisation –There are six “normal forms”, each rule applied successively from –First normal form, (1NF). –Eliminated duplicative columns from same table –Only one value, not a list of values in cell –Create separate tables for each group of related data & identify each row with aunique primary key 15

Your turn… repair this! Customer IDNamePhone 111Fred Smith Mary Jones Tim Blogs

Repaired! Customer IDFirstNameSurname 111FredSmith 222MaryJones 333TimBlogs Now, customers can be sorted and searched by first name and/or surname separately. Also, the names can be used individually, like “Dear Fred” instead of “Dear Fred Smith”

Repair This! Product IDColourWeight A345Red4kg A568Blue300g B695White1.5kg

Repaired! Product IDColourWeight (g) A345Red4000 A568Blue300 B695White1500

Repair This! AlbumTrackLength Monster13:23 Monster24:12 Collapse into Now14:01

Repaired AlbumTrackLength (sec) Monster1203 Monster2252 Collapse into Now1241 Time notation like “3:23” represents two pieces of data – minutes and seconds – that mean nothing to a database Cannot be understood a database without serious text parsing Single “seconds” value can be sorted, searched, compared

Repair This! And address like “3 Fred St, Sale, 3586” has 3 pieces of data: street address, town, postcode. Customer ID Address Lake Rd, Mentone, /45 Richmond Lane, Richmond, Spring St, Melbourne, 3000

Repaired! Now each field can be searched & sorted and used individually (e.g. addressing envelopes) Customer ID StreetSuburbPostcode Lake RdMentone /45 Richmond LaneRichmond Spring StMelbourne3000

CUSTOMER Customer IDNamePhone 111Fred Smith Mary Jones (BH) (AH) 333Tim Blogs Repair this… it’s tricky!

Customer ID NamePhone1Phone2 111Fred Smith Mary Jones Tim Blogs First attempt… Problems: Trouble querying the table: “Which customer has phone # ?” Have to search more than 1 field… messy. Ugly. Can’t enforce validation rules to prevent duplicate phone #s Can’t enter three or more phone numbers Waste of space for all people with only 1 number

CUSTOMER NAME TABLE Customer ID Name 111Fred Smith 222Mary Jones 333Tim Blogs Second attempt… CUSTOMER PHONE TABLE Customer ID Phone Benefits: Unlimited phone numbers for everyone! No need to search multiple Phone fields No need to tear apart text from one field to extract a particular number All we need is a 1:many relationship between customer name table and customer phone table using the ID as the key field.

Determining a RDBMS structure Table Normalisation Table normalisation –Second Normal Form, (2NF) –Meet all requirements of the first normal form –Remove subsets of data that apply to multiple rows of a table and place them in separate tables –Following table doesn’t comply with 2Nf as if student changes form the occurrence of form would have to be updated for each subject. 27

Determining a RDBMS structure Table Normalisation Table normalisation –Second Normal Form, (2NF) Using 2 tables to create a 2NF structure 28

2NF – Second Normal Form Removes subsets of data that apply to multiple rows of a table and places them in separate tables. Creates relationships between these new tables and their predecessors using foreign keys.

2NF example CustomerIDGnameSnamePhone 111FredSmith MaryJones MaryJones IkeTurner If Mary Jones got married and changed her name, changes would need to be made in more than one record. If one change were missed, the integrity of the data would be damaged. Making multiple changes like this is also time-consuming and repetitious, thereby eating up storage space. Solution: Store names only once in a separate table, as in the phone number example before. Name changes now only need to be made once.

Solution CUSTOMER NAME TABLE Customer ID Name 111Fred Smith 222Mary Jones 333Tim Blogs CUSTOMER PHONE TABLE Customer ID Phone

Without NF2: flat fileWith NF2: relational Department data is only stored once. So: Less storage space required Department changes now only made once, not once for each worker in that dept!

2NF The table above is a problem. Let’s say {Model Full Name} is the primary key. The {Manufacturer Country} field is based on the {Manufacturer} field, and will need to be constantly updated if manufacturers change their location. To be properly 2NF, you’d need to do this…

2NF

Break the data into two tables

2NF Make the same key fields in each table

2NF Set up the relationship between the key fields in each table

Determining a RDBMS structure Table Normalisation Table normalisation –Third Normal Form, (3NF) –Meet all the requirements of the 2NF –Remove columns that are not dependent upon the primary key; every field in a table must relate directly to the primary key; eg. the Event is the key. The Year and Winner’s name are both directly related to the Event. If a competitor wins several events, data errors can appear if the date of birth is entered differently each time. –To correct this, two tables formed to comply with the 3NF. 38

Determining a RDBMS structure Table Normalisation Table normalisation; Third Normal Form, (3NF) 39

3NF FAIL Field name underlining indicates key fields. What is wrong with this table?

3NF FAIL Each attribute (‘field’) should be giving information about the key field (a particular tournament + year).

3NF FAIL But the DOB field is not describing the tournament – it’s describing the tournament’s winner.

3NF Now the two tables are 3NF, and update anomalies cannot occur (e.g. updating a DOB in one record but missing it in another record).