Search Header Logo
Database Design & Development Revision

Database Design & Development Revision

Assessment

Presentation

Computers

3rd Grade

Practice Problem

Easy

Created by

Tracy Mutter

Used 2+ times

FREE Resource

13 Slides • 23 Questions

1

media

Database Design & Development

National 5 Computing Science

2

media

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

1

End-User Requirement

2

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

1

End-User Requirement

2

Functional Requirement

5

media

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?​

1

Number

2

Time

3

Integer

4

Boolean

5

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

1

Presence

Check

2

Restricted Choice

3

Range Check

4

Length Check

10

Multiple Choice

Which validation check is this an example of?​

A username must be 10 characters

1

Presence Check

2

Restricted Choice

3

Range Check

4

Length Check

11

Multiple Choice

Which validation check is this an example of?​

House must be one of G, L, O or X

1

Presence Check

2

Restricted Choice

3

Range Check

4

Length Check

12

Multiple Choice

Which validation check is this an example of?​

You cannot leave the date of birth field blank

1

Presence Check

2

Restrcited Choice

3

Range Chek

4

Length Check

13

media

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

media
media

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

media
media

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

Question image

What is the relationship between the entities?​

1

1:M

2

Employs

3

Departments employ Staff

4

DepartmentCode:StaffIDNumber

21

Multiple Choice

Question image

What is the primary to foreign key relationship?​

1

1:M

2

Employs

3

Department.DepartmentCode : Staff.StaffIDNumber

4

Department.DepartmentCode : Staff.DepartmentCode

22

Open Ended

Question image

What is the relationship between the entities?​

23

Open Ended

Question image

What is the primary to foreign key relationship?​

24

Multiple Choice

Question image

What are the Primary Keys?

1

Pupil.PupilID

School.SchoolID

2

Pupil.SchoolID

School.SchoolID

25

Multiple Choice

Question image

What is the Foreign Key?

1

Pupil.SchoolID

2

School.SchoolID

3

Pupil.PupilID

26

Multiple Choice

Question image

What is the relationship between Pupil and School?

1

1:M

2

M:1

3

1:1

4

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

Question image

What would be the result of this query?

SELECT forename

FROM Pupil

WHERE pupillid = 'S0004';

1

Jane

2

Atkins

3

St Kristen's

4

P0011

29

Multiple Choice

Question image

What would be the result of this query?

SELECT forename FROM Pupil, School

WHERE School.schoolID = Pupil.schoolID

AND schoolName = 'Kirk Lane Junior School';

1

Julie Stevens

2

S0002

3

Julia

4

Kirk Lane Junior School

30

Multiple Choice

Question image

What would be the effect of this query?

UPDATE Pupil

SET schoolID = 'P0018'

WHERE schoolID = 'P0011';

1

All P0011 become P0018

2

All P0018 become P0011

31

Multiple Choice

Question image

What would be the effect of this query?

DELETE FROM School

WHERE schoolID = 'P0011';

1

St Kristen's P0011 is removed from the Pupil table

2

St Kristen's P0011 is removed from the School table

32

Multiple Choice

Question image

What would be the effect of this query?

INSERT INTO Pupil (pupilID, forename, surname, schoolID)

VALUES ('S0006', 'Emma', 'Jones', 'P0018');

1

Remove Emma Jones from the database

2

Add Emma Jones to the database

3

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

Question image

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

Question image

How has the database been sorted?

1

Pupil table ASC on schoolID

2

Pupil table ASC order on surname

3

School table ASC on schoolID

4

School table ASC on schoolName

media

Database Design & Development

National 5 Computing Science

Show answer

Auto Play

Slide 1 / 36

SLIDE