Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.

Slides:



Advertisements
Similar presentations
Designing Tables in Microsoft Access By Ed Lance.
Advertisements

Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
MS-Access XP Lesson 2. Input Mask Property 1.Field : Phone No Data Type : Number Input Mask : Character 0 represent a single digit and phone.
 Microsoft Access is one of two primary database offering from Microsoft.  Access is a network/desktop-based database.  Advantage: It is easy to use.
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Management Information Systems MS Access 2003 By: Mr. Imdadullah Lecturer, Department of M.I.S. College of Business Administration, KSU.
Database Constraints. Database constraints are restrictions on the contents of the database or on database operations Database constraints provide a way.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Oracle Data Definition Language (DDL)
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Database Applications – Microsoft Access Lesson 2 Modifying a Table and Creating a Form 45 slides in presentation Accessibility check 9/14.
Microsoft Access 2000 Creating Tables and Relationships.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
Primary & Foreign Keys. PK & FK 1.Primary key is required 2.The PK must be unique 3.If the primary key from one table is related to a field in another.
Database Management System Lecture 6 The Relational Database Model – Keys, Integrity Rules.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Concepts of Database Management, Fifth Edition Chapter 4: The Relational Model 3: Advanced Topics.
Introduction to SQL Steve Perry
 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 ( )
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
Designing a Database (Part I) -Identify all fields needed to produce the required information -Group related fields into tables -Determine Each Table’s.
DBMS Spring 2014 Database Integrity Sources: Security in Computing, Pfleeger and Pfleeger, Prentice Hall, 2003 Lecture Slides, CSE6243, MSU, Rayford B.
CHƯƠNG 3 Finding, Filtering, and Formatting Data.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Database Systems Microsoft Access Practical #1 Creating Tables Nos 215.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
Using Microsoft Access 56:150 Information System Design.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms – Project 5.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Database Application Design and Data Integrity AIMS 3710 R. Nakatsu.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
Maintaining a Database Access Project 3. 2 What is Database Maintenance ?  Maintaining a database means modifying the data to keep it up-to-date. This.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Oracle 11g: SQL Chapter 4 Constraints.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/Programs/Microsoft Office/Microsoft Office.
Microsoft Office 2013: In Practice Chapter 2 Using Design View, Data Validation, and Relationships Copyright © 2014 by The McGraw-Hill Companies, Inc.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Aliya Farheen October 29,2015.
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/All Programs/Microsoft Office/Microsoft Office.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
Mr C Johnston ICT Teacher
Session 1 Module 1: Introduction to Data Integrity
Microsoft Access Prepared by the Academic Faculty Members of IT.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Constraints Advanced Database Systems Dr. AlaaEddin Almabhouh.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
DATA TYPES.
New Perspectives on Microsoft Access 2016
and Defining Table Relationships
Spreadsheets, Modelling & Databases
Designs for Data Integrity, validations, security and controls
Microsoft Access Validation Rules, Table Relationships And
Presentation transcript:

Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity

Objectives To identify the need for validation and verification Identify some of the built in constraints used in databases

Data validation & formatting When data is entered into a database it is important that it is entered consistently- this ensures that we can set up queries and macros for the users as easily as possible. Imagine a query that needed to work on all the possible ways someone could enter a date. in other words it must be entered in the same format. If you design and set up a database and enter all the data yourself this may not be a problem however this is unlikely to be the case in many organisations.

Formatting Data Formatting is the term used to control the appearance of your data. This formatting can also speed up data entry by filling in attribute values with default values such as today ’ s date or from other data already in the database. As the designer you need to decide where formatting can be used.

Examples Post codes Phone numbers Starting names with capital letters Number of digits after the decimal point Dates (eg 3/2/04 = 3 feb 2004)

Input masks This is a format that is applied when users enter data An input mask will ensure your user inputs data in the correct format. E.G Post code 1 or 2 letters (capitals) followed by up to 2 digits, a space, 1 digit then two letters (capital) LE1 4RT or LE11 5TY or L1 4GH

Validation rules You can set validation rules for an attribute. This ensures that values entered into the attribute are appropriate for that attribute. E.g. Date of birth to be before today ’ s date Members date of birth to be before (i.e. less than10 years old) Price of a product to be greater than £ 0 Salary to be less than £ 30,000

Setting up validation & formatting All of these are set up in Access for each attribute using the attribute property table

Format – short date Input mask / as spacers Caption ( name of field to appear on reports etc) Default value value that is automatically entered- user must overtype if different- set to today ’ s date Validation rule – date entered must be before or equal to today ’ s date Validation text- error message to be displayed if incorrect date entered Required - yes means a value must be entered

Caption Default date today’s date date in short date format In put mask shows the / as spacers Adding a new record to the table

If I try and remove the date and don’t put in a new date the required property comes into effect. I cant move to the next attribute until I have entered another date. I am going to add tomorrows date ( 27/10/04)

This date does not agree with the validation rule. The Validation text is shown as an error message.

Record level validation Sometimes you want to check that the value of an attribute compares with another attribute. E.G End date of agreement must be after start date.

Set up record level validation by opening the table in design view and selecting view for the main menu followed by properties This validation rule checks that the end date is after the start date This check is carried out when you move to the next record ( or row)

Constraints Primary Key Constraints The database will ensure that no row is added to a table that already has the same value for the key. For composite keys it is possible for one of the columns to contain duplicate values in the table but the combination of values must be unique

Referential Integrity Constraints Referential constraints are enforced using something called foreign keys. A foreign key is a key field of a table found in another table as a foreign key. This allows links to be made between the tables It allows us to reference other tables by enforcing the relationships between the entities

This arrangement tells us there is a relationship between student and course. The foreign key sets up the relationship Student Number Student Name Student Address Course No S1FrodoBag EndC1 S2ElrondRivendellC1 S3SamBag EndC1 Course NoCourse Name C1 C2 BIT Computing

Referential integrity The DBMS will check that when ever a value is entered into a foreign key there is a corresponding row in the table which contains the same value i.e. If we enter a course number in the student table there will be a row in the course table with that course number.

This works in several ways If we enter a new row in the student table the DBMS will check there is a corresponding record for the course no in the course table otherwise it will reject it. If we update the value of course no in the student table the DBMS will check there is a value for the course no in the course table otherwise it will reject it. When we try and delete a record from the course table it will reject the delete, If we are sure we wish the related records to be deleted we can set it up automatically to delete all the records in the student table which have that same value of course no – known as a cascade delete.

Using an example The relationship is between Classes and Tutor

See week 2 lab on how to add this in Access

Integrity constraints These are constraints to help the accuracy of the database- There is no way round them for the user Two types Not null – There must be a value for this attribute Check constraint - uses a simple logic statement to work out whether the value of an attribute is acceptable

Example of not null constraint Example of check constraint

Summary We have covered in this lecture Validation ( field and record level) Formatting and input masks Constraints Primary key constraints ( uniqueness) Referential constraints ( foreign Keys Integrity constraints ( not null and check constraints)

References Nat Mcbride- Introduction to Access 2000