Mr C Johnston ICT Teacher

Slides:



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

Designing MS-Access Tables
Creating Tables Unit 9 - Databases.
Session 2Introduction to Database Technology Data Types and Table Creation.
Database Design Week 10.
Guidelines for Setting Field Properties Each field has a number of properties, such as its name and data type, that you can set when you define the field.
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
 Microsoft Access is one of two primary database offering from Microsoft.  Access is a network/desktop-based database.  Advantage: It is easy to use.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Database Design Concepts Info1408
Access Lecture 1 Database Overview and Creating Tables Create an Employee Table.
Database Design IST 7-10 Presented by Miss Egan and Miss Richards.
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.
Tables. Any database must contain one or more tables, because that’s where the data is stored. For any table there are two views provided: Datasheet view.
Data Types and Field Properties 5.01 Understand database tables used in business.
Database terms Mr. Brunton.
Oracle Data Definition Language (DDL)
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.
BIS121 IT for Business Application Lecture 8 – Database (Part I)
Driving School Database
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
44220: Database Design & Implementation Implementing Physical Domains Ian Perry Room: C49 Tel Ext.: 7287
Designing a Database (Part I) -Identify all fields needed to produce the required information -Group related fields into tables -Determine Each Table’s.
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Complete theory from last lesson… Put today’s date in the front of your book Read pages 46 and 47 of the textbook…
Chapter 5: Data Types (2013) Revision Candidates should be able to know: Identify different data types? Key terms: File, record, field and key field Database.
GCSE Computing#BristolMet Session Objectives# 20 MUST describe a database and discuss the legal implications of storing personal information SHOULD explain.
5 5 Data types Logical/Boolean Has only two alternatives: Yes or no, on or off true or false Text/Alphanumeric Refers to all letters and numbers and other.
G045 Lecture 09 ERD Diagrams (Entity Relationship Diagrams) Mr C Johnston ICT Teacher
System Development Lifecycle Verification and Validation.
DAY 22: MICROSOFT ACCESS – REVIEW Akhila Kondai November 04, 2013.
© Relational Databases. © Entities Data is stored in tables. Each table is concerned with one entity An entity is a.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
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.
Databases (2) Lesson Objective: Understand the purpose of DBMS. Understand data types, queries, forms and reports. Learning Outcome: Make a data table.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
IE 423 – Design of Decision Support Systems Database development – Building Tables
Handling Many to Many Relationships. 2 Handling Many:Many Relationships Aims: To explain why M:M relationships cannot be implemented in relational database.
Advanced Web 2012 Lecture 3 Sean Costain What is a Database? Sean Costain 2012 A database is a structured way of dealing with structured information.
# 1# 1 Creating Tables, Setting Constraints, and Datatypes What is a constraint and why do we use it? What is a datatype? What does CHAR mean? CS 105.
Relational Databases. Relational database  data stored in tables  must put data into the correct tables  define relationship between tables  primary.
44220: Database Design & Implementation Review & Assignment 2 Ian Perry Room: C41C Tel Ext.: 7287
IT Applications Theory Slideshows Databases II: Structure, Naming, data types, data formats.
44220: Database Design & Implementation Implementing Physical Domains Ian Perry Room: C41C Tel Ext.: 7287
Verification & Validation. Batch processing In a batch processing system, documents such as sales orders are collected into batches of typically 50 documents.
G040: Lecture 11 Interactive Booking Form Briefing Notes Mr C Johnston ICT Teacher
Study Opportunities1 Database table quiz What is your name?
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Description and exemplification use of a Data Dictionary. A data dictionary is a catalogue of all data items in a system. The data dictionary stores details.
Microsoft Access Prepared by the Academic Faculty Members of IT.
Normalisation Unit 6: Databases. Just to recap  What is an Entity  What is an Attribute?
G057 - Lecture 05 From Scenario To Design Mr C Johnston ICT Teacher
MICROSFTACCESS tables. DATA TYPES Field TypeWhat It Holds Short Text Text up to 255 characters long (including spaces and punctuation). Use a Text field,
Input, Output and Processing.. What data needs to be input into the system? Identify the sources – i.e. where does the data come from? What is the volume.
To play, start slide show and click on circle Access 1 Access 2 Access 3 Access 4 Access Access
2b. Create an Access Database Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis with Spreadsheets 1.
BTEC NCF IT Unit 02 Creating Systems to Manage Information Lesson 05 – Data Types Mr C Johnston.
DATA TYPES.
Creating a database table
Databases Chapter 9 Asfia Rahman.
Unit 16 – Database Systems
Types of data This presentation differentiates between ICT professional and end users.
BTEC NCF IT Unit 02 Creating Systems to Manage Information Lesson 05 – Data Types Mr C Johnston.
Objectives TO UNDERSTAND THAT CAPTURING DATA IS VALIDATED AND VERIFIED TO CHECK THAT IT IS REASONABLE AND CORRECT.
Data Types & File Size Calculations
Designing data capture forms
Oracle Data Definition Language (DDL)
Database Theory.
ICT Database Lesson 2 Designing a Database.
Presentation transcript:

Mr C Johnston ICT Teacher www.computechedu.co.uk G057 - Lecture 04 From Entity to Table Mr C Johnston ICT Teacher www.computechedu.co.uk

Session Objectives Revise terms from last session, Understand how to construct database tables, Understand that each attribute needs a data-type, Know different types of validation rules which can be applied to attributes to ensure that data remains of the correct type, Know correct methods of documenting tables within a database and its attributes.

Revision of Terms An entity is a person, place or object More commonly in English its know as a noun E.g a student at college could be an entity Entities have attributes E.g a student has a name, address, phone number etc. Each entity needs a unique identifier if it is to be used in a relational database – this is known as a primary key in database land!

Revision of Terms Entities have relationships with one another There are three types of relationships One to One, One to Many, Many to Many One to Many relationships are the only type allowed - the other two types need resolving Relationships between entities are shown in an Entity Relationship Diagram (ERD) This forms one component of the Logical Data Model (LDM)

Constructing Database Tables A database table is made up of a set of entities Each database table needs a name We normally use the name given to the entity It should be written in capitals Tables need attributes, which are found during the process of normalisation Each attribute needs a data type and some form of validation.

Attribute Data Types Attributes must be one of the following data types: Text or String, Numeric, Date and Time, Currency, Boolean or Logical, AutoNumber. Data types have different sizes to choose from – you need to pick an appropriate size as well as data type for each attribute, Some common sizes for each data type are given on the next few slides.

Attribute Data Types Text or String: Number: Consists of a sequence of any characters, Limited to 255 characters, For longer text requirements you can use a memo data type. Number: Byte: 0 to 255 Integer: -32,768 to 32,768 Long Integer: 2,147,483,648 to 2,147,483,647 Single: small decimal numbers (7dp) Double: medium decimal numbers (15dp) Decimal: large decimal numbers (28dp)

Attribute Data Types Date and Time General Date – 19/06/1994 17:34:23 Long Date – 19 June 1994 Medium Date – 19 – JUN - 94 Short Date – 19/06/1994 Long Time – 17:34:23 Medium Time – 05:34 PM Short Time – 17:34

Attribute Data Types Currency Boolean / Logical Offers more precision for storing prices Boolean / Logical True, False On, Off Yes, No

Using The Correct Data Types You must ensure that the correct data type is chosen for an attribute The larger the maximum value the more memory in the database is taken up E.g phone numbers don’t need to be calculated with so can be stored as text

The Data Dictionary The data dictionary (DD) is a table used to document entities, A data dictionary along with an ERD makes up a logical data model (LDM) A data dictionary for a student may look like: Entity Key Attribute Data type Size Validation STUDENT Primary Foreign StudentID Title First Name Second Name CityID Post Code DOB ApplicationDate AutoNumber Text Number Date/Time Auto 4chars 15chars 20chars Long Integer 8chars Short date

Topic Exercise For each of the scenarios last week identify attributes for each entity and produce a Data Dictionary. Compile both the ERD and DD into single page LDM for each scenario. Create a LDM for customers wishing to book a ferry crossing. Each crossing runs serveral times a time and has one ferry assigned to it. A ferry could be responsible for more than one crossing.

Ensuring Data Correctness Keeping data integral is part of the job which the DBMS plays There are two methods to do this: Validation Ensuring data is within the right context Access provides lots of methods for this Verification Ensuring data is correct Access doesn’t provide any methods for this

Methods of Validation Format check Presence check Range check Now() is a function which gives the current system date and time… useful for constructing validation rules, queries, forms and reports in Access. Other useful functions include: Date() which only gives the date and Time() which just gives the time. Methods of Validation Format check Usually controlled by the data type and size selected e.g. If [price] field was set as an integer it would not work properly as the prices entered would have to be whole numbers!! Presence check Is the field allowed to be left empty or must the user enter something e.g. [surname] - required = yes, [email] – required = no Range check What are the range of numerical values allowed to be entered e.g. [price] - >= 0 AND <=1000, [order] >= Now() If customers have to be over 18: [DOB] <= (Date()-6754) 6754 is number of days old you would be if 18. So we take this away from current date to check the DOB is allowed. 6754 is calculated by: 365 days a year * 18 years + 4 extra days for leap years

Methods of Validation Picture check / Input mask List of valid values Constructing input masks can be tricky – L is for mandatory letters (A-Z), ? is for optional letter (A-Z), 0 is for mandatory numbers (0-9), 9 is for optional numbers (0-9). For full details see: http://office.microsoft.com/en-us/access-help/control-data-entry-formats-with-input-masks-HA010096452.aspx Methods of Validation Picture check / Input mask Used to check if the data entered looks like a defined pattern of text and numerical characters. Suitable for post codes (can be awkward) and phone numbers e.g. [postCode] – LL0 0LL (allows CV1 5NL but B1 5NL and CV10 5NL not allowed!!) [phoneNumber] – (00000) 000000 (allows 02476 123123 and 07957 123123) List of valid values Limit the values to only those on a defined list of from another table e.g. [gender] - “male” or “female”, [carID] – looked up from CAR Default values Used to suggest a value for a field which is common or default e.g. [city] – default = coventry [orderDateTime] – default = now()

Data Dictionary With Validation Validation Text – a friendly message which alters the user if a validation method has been broken and tips on how to solve the error Data Dictionary With Validation For each field within your data dictionary think about which validation rule could be added – remember to add a validation text column to record any planned validation text. Entity Key Attribute Data type Size Validation STUDENT Primary Foreign StudentID Title First Name Second Name CityID Post Code DOB ApplicationDate AutoNumber Text Number Date/Time Auto 4chars 15chars 20chars Long Integer 8chars Short date Required = yes “Mr” OR “Mrs” OR “Miss” OR “Ms” Looked up in [city] <=date()-5478 Default Value = now() >=Date()

Topic Exercise For each of the data dictionaries you have created add some validation rules to each entity.