
Database Design & Development Revision
Presentation
•
Computers
•
3rd Grade
•
Practice Problem
•
Easy
Tracy Mutter
Used 2+ times
FREE Resource
13 Slides • 23 Questions
1
Database Design & Development
National 5 Computing Science
2
Analysis
At the analysis stage of developing a database, you must identify end-
user and functional requirements
End-user requirements describe tasks that a user of the database
would want to carry out
Functional requirements describe what must be created or coded in the
database
3
Multiple Choice
Is the following is an end-user requirement or a functional requirement?
When a new pupil joins the school, all their details and subjects must be added to the timetable
End-User Requirement
Functional Requirement
4
Multiple Choice
Is the following is an end-user requirement or a functional requirement?
Different tables are required to store details of all subjects, sets, classes and pupils
End-User Requirement
Functional Requirement
5
Design
Two tools/tasks from the design stage are:
Data Dictionary - a plan to describe all the attributes to be created in each entity
Entity-Relationship Diagram - to show the connection and
relationship between two entities joined with a primary and foreign key
6
Multiple Choice
There are five attribute types we need to know for data stored in a database field
Which of the following is not attribute type?
Number
Time
Integer
Boolean
Date
7
Open Ended
What was the 5th missing data type?
8
Validation Checks
There are 4 types of validation used in databases
Presence Check
Restricted Choice
Range Check
Length Check
9
Multiple Choice
Which validation check is this an example of?
Data must be a number between 1 and 6
Presence
Check
Restricted Choice
Range Check
Length Check
10
Multiple Choice
Which validation check is this an example of?
A username must be 10 characters
Presence Check
Restricted Choice
Range Check
Length Check
11
Multiple Choice
Which validation check is this an example of?
House must be one of G, L, O or X
Presence Check
Restricted Choice
Range Check
Length Check
12
Multiple Choice
Which validation check is this an example of?
You cannot leave the date of birth field blank
Presence Check
Restrcited Choice
Range Chek
Length Check
13
Database Entities/Tables
Data in a database file is organised into entities/tables to store related information
An entity/table is made up of multiple attributes/fields to store a single item of
information
You can add records to the table storing information about one person or thing
Each table must have a primary key, a unique identifier for each record in a table
A database may have more than one table and the tables can be linked together using
a foreign key
14
Data Dictionaries
You identify the attributes to be stored for each entity in a data dictionary
Indicate primary or foreign keys using the notation PK or FK
Always indicate Yes or No in the required column
Show the criteria of the validation rules
15
E-R Diagrams
Show entities as a rectangle and attributes as ovals, underline PK, star (*) foreign key,
show one to many relationship, add a word to describe the relationship
16
Primary Keys
A primary key is a field used to uniquely identify every record in the database. Sometime primary keys are obvious, for example a car license plate could be used to uniquely identify cars. Often, primary keys are less obvious and it is necessary to create a unique value – often an ID number.
A primary key is a guaranteed way of uniquely identifying each record. In the school example, the primary key used to identify each member of staff in the teacher table is Staff ID.
17
Foreign Keys
A foreign key is a primary key from one table that appears in another table to link the two together. The Department ID is the primary key in the Department table that appears as a foreign key in the Staff table to link the two.
18
Key Relationships
The link between the primary and foreign key provides a relationship between the tables.
These can be
1:1
1:M
M:M
19
Draw
Identify the Foreign Key
20
Multiple Choice
What is the relationship between the entities?
1:M
Employs
Departments employ Staff
DepartmentCode:StaffIDNumber
21
Multiple Choice
What is the primary to foreign key relationship?
1:M
Employs
Department.DepartmentCode : Staff.StaffIDNumber
Department.DepartmentCode : Staff.DepartmentCode
22
Open Ended
What is the relationship between the entities?
23
Open Ended
What is the primary to foreign key relationship?
24
Multiple Choice
What are the Primary Keys?
Pupil.PupilID
School.SchoolID
Pupil.SchoolID
School.SchoolID
25
Multiple Choice
What is the Foreign Key?
Pupil.SchoolID
School.SchoolID
Pupil.PupilID
26
Multiple Choice
What is the relationship between Pupil and School?
1:M
M:1
1:1
M:M
27
SQL Queries
Queries are a method used for requesting information from a database which matches set criteria. Queries are designed using a programming language called SQL (Structured Query Language).
There are 4 types of queries
SELECT - search for
INSERT - add a record in
DELETE - remove a record
AMEND - update and existing record
28
Multiple Choice
What would be the result of this query?
SELECT forename
FROM Pupil
WHERE pupillid = 'S0004';
Jane
Atkins
St Kristen's
P0011
29
Multiple Choice
What would be the result of this query?
SELECT forename FROM Pupil, School
WHERE School.schoolID = Pupil.schoolID
AND schoolName = 'Kirk Lane Junior School';
Julie Stevens
S0002
Julia
Kirk Lane Junior School
30
Multiple Choice
What would be the effect of this query?
UPDATE Pupil
SET schoolID = 'P0018'
WHERE schoolID = 'P0011';
All P0011 become P0018
All P0018 become P0011
31
Multiple Choice
What would be the effect of this query?
DELETE FROM School
WHERE schoolID = 'P0011';
St Kristen's P0011 is removed from the Pupil table
St Kristen's P0011 is removed from the School table
32
Multiple Choice
What would be the effect of this query?
INSERT INTO Pupil (pupilID, forename, surname, schoolID)
VALUES ('S0006', 'Emma', 'Jones', 'P0018');
Remove Emma Jones from the database
Add Emma Jones to the database
Find Emma Jones in the database
33
Referential Integrity
In Relational Database Management Systems (RDBMS) referential integrity can be enforced by working with primary and foreign keys. Each foreign key must have a matching primary key so that reference from one table to another must always be valid.
Then, with referential integrity in place, the database contents will be joined together to be jointly updated when necessary.
34
Open Ended
What is the referential Integrity issue in this database?
35
Sorting Databases
Sorting a database is placing the data within it into a specific order
ASC - A to Z or numerically smallest to largest
DESC - Z to A or or numerically largest to smallest
36
Multiple Choice
How has the database been sorted?
Pupil table ASC on schoolID
Pupil table ASC order on surname
School table ASC on schoolID
School table ASC on schoolName
Database Design & Development
National 5 Computing Science
Show answer
Auto Play
Slide 1 / 36
SLIDE
Similar Resources on Wayground
29 questions
Figurative Language 4th Grade
Presentation
•
4th Grade
30 questions
FIGURATIVE LANGUAGE
Presentation
•
3rd Grade
29 questions
Lesson 0.1 My CS Journey
Presentation
•
3rd Grade
34 questions
3.G.1
Presentation
•
3rd Grade
25 questions
Recap - Creative Imedia
Presentation
•
3rd Grade
29 questions
Lab Safety Is Common Sense
Presentation
•
KG
25 questions
Comparing Fractions
Presentation
•
3rd Grade
25 questions
NF.3 & NF.4 Review
Presentation
•
3rd Grade
Popular Resources on Wayground
5 questions
A Home on the Shore
Quiz
•
3rd Grade
28 questions
US History Regents Review
Quiz
•
11th Grade
6 questions
A Horse Tale
Quiz
•
3rd Grade
20 questions
Math Review
Quiz
•
3rd Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
20 questions
Dividing Fractions
Quiz
•
5th Grade
55 questions
A Long Walk to Water Final Review
Quiz
•
6th - 8th Grade
10 questions
Equation Word Problems
Quiz
•
7th Grade
Discover more resources for Computers
5 questions
A Home on the Shore
Quiz
•
3rd Grade
6 questions
A Horse Tale
Quiz
•
3rd Grade
20 questions
Math Review
Quiz
•
3rd Grade
5 questions
Dramatic Dream
Quiz
•
3rd Grade
10 questions
Area
Quiz
•
3rd Grade
10 questions
3rd grade Context Clues
Quiz
•
2nd - 3rd Grade
20 questions
Parts of Speech
Quiz
•
3rd Grade
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...