Download presentation
Presentation is loading. Please wait.
1
Database Design and Development
Validation and Relationships
2
Starter Questions (back of jotter)
List the 5 attribute types for Database fields. Fill in the blank: a collection of records is called a ______. An _____ is a single person, place or thing.
3
Learning Intention I will learn about database field validation.
4
Attribute Size We can limit the amount of information a single attribute can store. For example, a text attribute might be maximum 20 characters in length.
5
Validation Validation is the process of checking that data entered into a system is of the correct type and structure There are 4 types of validation:
6
Validation (cont) Presence check - checks that data has been entered into the field – cannot be left blank Restricted choice – user given a list of options to choose from. e.g. drop down menu
7
Validation (cont) Field length check – specifies the number of characters – e.g. telephone number must be 11 characters long Range check – sets the range of values allowed. e.g. 0 to 100 inclusive
8
Practical Tasks DB Booklet - Practical Task 3
9
Success Criteria I can describe and add validation rules to a database.
10
Learning Intention I will learn about database table relationships.
11
Table Relationships Customer ID First Name Last Name Pet ID Pet Name
Type of Animal 2635 Brian Davies 789 Scruff Labrador 1293 Sue Towns 156 Phoebe Syrian Hamster 157 Jango 9735 Barry Grey 258 Killer English Bulldog 260 Psycho French Bulldog
12
Table Relationships Customer ID First Name Last Name Pet ID Pet Name
Type of Animal 2635 Brian Davies 789 Scruff Labrador 1293 Sue Towns 156 Phoebe Syrian Hamster 157 Jango 9735 Barry Grey 258 Killer English Bulldog 260 Psycho French Bulldog
13
Table Relationships Storing all the data in one table is called a flat-file database. Problems: repeated data slower to update (because of the repeated data) risk of errors when updating (update anomalies)
14
Table Relationships (cont)
Splitting one table into multiple tables solves these problems. A database with multiple related tables is called a Relational Database.
15
Table Relationships Customer ID First Name Last Name Pet ID Pet Name
Type of Animal 2635 Brian Davies 789 Scruff Labrador 1293 Sue Towns 156 Phoebe Syrian Hamster 157 Jango 9735 Barry Grey 258 Killer English Bulldog 260 Psycho French Bulldog
16
Table Relationships - Keys
Pets Pet ID Pet Name Type of Animal Customer ID 789 Scruff Labrador 2635 156 Phoebe Syrian Hamster 1293 157 Jango 258 Killer English Bulldog 9735 260 Psycho French Bulldog Customers Customer ID First Name Last Name 2635 Brian Davies 1293 Sue Towns 9735 Barry Grey
17
Table Relationships - Keys
A field used to link two tables is called a key field. It is called the primary key in the table in which the key field is unique (not repeated). It is called the foreign key in the other table.
18
Which key field is which?
Pets PK Pet ID Pet Name Type of Animal Customer ID 789 Scruff Labrador 2635 156 Phoebe Syrian Hamster 1293 157 Jango 258 Killer English Bulldog 9735 260 Psycho French Bulldog Customers FK Customer ID First Name Last Name 2635 Brian Davies 1293 Sue Towns 9735 Barry Grey PK
19
Pupils Database Example
20
Practical Tasks DB Booklet - Theory Tasks 1 & 2
DB Booklet - Practical Task 4 DB Booklet - Theory Task 3 DB Booklet - Practical Task 5
21
Practical Tasks DB Booklet - Theory Tasks 1 & 2
DB Booklet - Practical Task 4 DB Booklet - Theory Task 3 DB Booklet - Practical Task 5
22
Success Criteria I can create and describe relationships between tables in terms of the key fields.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.