wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Database Design

Total questions: 70

Worksheet time: 2hrs 18mins

Name
Class
Date
1.

Identify the roles of database in the present business world.


i. Handling multifiles data access

ii. Controlling data security

iii. Equitable use

iv. Validating data

a)

i and ii

b)

ii and iii

c)

i, ii and iii

d)

i, ii and iv

2.

Define the property of database that ensures the evolvement in order to satisfy the changes in user requirements.

a)

flexibility

b)

efficiency

c)

usability

d)

completeness

3.

Identify the relation key that uniquely defines each row in a table.

a)

Foreign Key

b)

Candidate Key

c)

Primary Key

d)

Composite Key

4.

Choose the correct symbol of PROJECT in the Relational Algebra.

a)

˄

b)

×

c)

π

d)

σ

5.

In relational data model, the total number of values can be identified as ______________________ .

a)

Cardinality

b)

Tuple

c)

Attribute

d)

Entity

6.

Choose the symbol of entity in the Entity Relationship Diagram.

a)
b)
c)
d)
7.

Indicate the term for number of entities to which another entity can be associated via a relationship set.

a)

Schema

b)

Attributes

c)

Cardinality

d)

Entity

8.

Identify the relational algebra operator that is applied to tables of Employees and Department to produce the following result as in the table.

a)

An outer join operator

b)

The cross product operator

c)

The project operator

d)

The natural join operator

9.

A relation is in _______, if and only if, every determinant is a candidate key.

a)

First normal form (1NF)

b)

Second normal form (2NF)

c)

Third normal form (3NF)

d)

Boyce-Codd Normal Form (BCNF)

10.

Normalization works through a series called normal forms. Identify stages that are as high as needed to go in the normalization process for most purpose in business database design.

a)

One

b)

Two

c)

Three

d)

Unnormalised

11.

Choose the SQL command that is used to change a table's storage characteristics.

a)

CHANGE TABLE

b)

EDIT TABLE

c)

MODIFY TABLE

d)

ALTER TABLE

12.

Identify which of the following relation would be produced by the relational algebra statement below.

a)

Compute the inner join between the DEPARTMENT and EMPLOYEE relations.

b)

Compute the natural join between the DEPARTMENT and EMPLOYEE relations.

c)

Compute the set difference between the DEPARTMENT and EMPLOYEE relations.

d)

Compute the cross product between the DEPARTMENT and EMPLOYEE relations.

13.

Select the relational algebra statement to find employee tuples who work in Accounting Department called Sandra.

a)

σ dept = ‘IT’ ˄ name = ‘Sandra’(EMPLOYEE)

b)

σ dept = ‘IT’ ˅ name = ‘Sandra’(EMPLOYEE)

c)

π dept = ‘IT’ ˄ name = ‘Sandra’(EMPLOYEE)

d)

π dept = ‘IT’ ˅ name = ‘Sandra’(EMPLOYEE)

14.

Choose the syntax for output in Table

a)

σ staffID, name, department (π staffID=2211)(STAFF)

b)

π staffID, name, department (σ staffID=2211)(STAFF)

c)

π name, staffID, department (σ staffID=2211)(STAFF)

d)

σ name, staffID, department (π staffID=2211)(STAFF)

15.

Write the relational algebra to list employee’s number and employee’s name whose salary is greater than RM3000 in the table.

a)

σ WorkerId, WorkerName (π Salary > 3000)(WORKER)

b)

π WorkerId, WorkerName (σ Salary = 3000)(WORKER)

c)

π WorkerId, WorkerName(σ Salary > 3000)(WORKER)

d)

σ WorkerId, WorkerName (π Salary > 3000)(WORKER)

16.

Entities can be associated with one another in Entity Relationship Diagram (ERD) using _____________.

a)

relationship

b)

cardinality

c)

attributes

d)

primary key

17.

An entity in A is associated with at most one entity in B, and an entity in B is associated with at most one entity in A. Based on the statement, choose the relationship that has been applied.

a)

one-to-many

b)

one-to-one

c)

many-to-many

d)

many-to-one

18.

Choose the denotation in a relational database which has the functional dependency between attributes of StudentID, StudentName and Course.

a)

StudentID --> StudentName, Course

b)

StudentName -->Course

c)

StudentName, Course -->StudentID

d)

Course <--StudentID, StudentName

19.

Based on the relational schema in Figure, select one of the following that would violate the 2NF property.

a)

Register_No, Name

b)

Course_No, Course_Name

c)

Register_No, Phone

d)

Phone, Branch

20.

Determine the SQL statement that were used to drop table in a database.

a)

DROP DATABASE TABLE

b)

DROP RELATION

c)

DROP TABLE

d)

DROP DATABASE RELATION

21.

Determine the result based on the SQL statement in Figure.

a)

A listing of all customers in the customer table

b)

A listing of the owner of the customer table

c)

A listing of all owner and customer of customer table

d)

A listing of the owner of the customer table as well as customers

22.

Analyze the result based on SQL statement in Figure.

a)

Changes the length of the Unit_Price field to 775

b)

Changes the price of a unit called Product_T to 7

c)

Changes the unit price of Product 7 to 775

d)

Updates the Product_T table to have a unit price of 7

23.

Identify the INCORRECT statement while using LIKE comparison operator.

a)

WHERE CustomerName LIKE ‘ad%’;

b)

WHERE CustomerName LIKE ‘%ad’;

c)

WHERE CustomerName LIKE ‘_ad%’;

d)

WHERE CustomerName LIKE = ‘ad%’;

24.

Choose the SQL statement to display the entire record from the Table with the names of students sorted out in descending order.

a)

SELECT * FROM Student ORDER BY NAME;

b)

SELECT * ORDER BY NAME FROM Student;

c)

SELECT * FROM Student ORDER BY NAME DESC;

d)

SELECT * ORDER BY NAME DESC FROM Student;

25.

Identify the output when SQL command in Figure is executed.

a)

The highest salary for all employees

b)

The highest salary in each department

c)

The employees with the highest salaries

d)

The employees with the highest salary for each department

26.

_________is a person, place, object, event or concept in the user environment about which company wishes to maintain the data

a)

attribute

b)

entity

c)

relationship

d)

primary key

27.

Which attribute is the DERIVED ATTRIBUTE?

a)

Name

b)

Address

c)

Age

d)

Salary

28.

Each entity is described by __________.

a)

Attribute

b)

Key

c)

Entity

d)

Relationship

29.

This shape is symbol for ?

a)

Entity

b)

Attribute

c)

Primary Key

d)

Foreign Key

30.

Which attribute is the COMPOSITE ATTRIBUTE?

a)

Employee

b)

Birthdate

c)

Name

d)

Address

31.

A attribute in a relation is a foreign key if the _____ from one relation is used as an attribute in that relation.

a)

Record

b)

Field

c)

Foreign Key

d)

Primary Key

32.

Every student can take many subject AND every subject can have many students


This statement above referring to...

a)

Many to Many (M:N)

b)

One to One (1:1)

c)

One to Many (1:M)

33.

______________is a relationship set where two entity sets participate in a relationship set.

a)

Unary Relationtiop

b)

Binary Relatioship

c)

Ternary Relationship

d)

Key Relationship

34.

An attribute that holds multiple values for a single entity.

a)

Single Valued Attributes

b)

Multi Valued Attributes

c)

Composite Attributes

d)

Derived Attributes

35.

What is the degree relationship that shows in the picture?

a)

Ternary Relationship

b)

Binary Relationship

c)

Unary Relationship

d)

Primary Relationship

36.

The cardinalities for the picture is

a)

One-to-one (1:1)

b)

One-to-many (1:M)

c)

Many-to-many (M:N)

37.

This represents which type relationship

a)

One-to-One

b)

One-to-Many

c)

Many-to-Many

d)

Subtype

38.

This represents what type relationship

a)

One-to-One

b)

One-to-Many

c)

Many-to-Many

d)

Subtype

39.

An identifying relationship means

a)

The foreign key created by the relationship is part of the primary key of the table

b)

The primary keys of the two tables are the same

c)

The foreign key created by the relationship is not part of the primary key of the table

d)

The relationship is identified by a name attribute

40.

What type relationship exists between these 2 tables

a)

There is no Relationship

b)

One-to-Many Non-Identifying Relationship

c)

Many-to-Many Relationship

d)

One-To-Many Identifying Relationship

41.

What type relationship exists between these 2 tables

a)

No Relationship

b)

One-to-Many Non-Identifying Relationship

c)

Many-to-Many Identifying Relationship

d)

One-to-Many Identifying Relationship

42.

In the individual table, customer_id is a

a)

primary key

b)

non-key column

c)

foreign key

d)

none of the other options

43.

You are designing a medical system database and have doctors and patients. What type relationship would you expect to exist between doctor and patient

a)

One-to-One

b)

One-to-Many

c)

Many-to-Many

d)

No Relationship

44.

When you have a Many-to-Many relationship in a database, you will end up with how many tables to store that relationship?

a)

One

b)

Two

c)

Three

d)

Four

45.

In designing an eCommerce site, what type relationship would you expect exists between a customer and an order?

a)

One-to-One

b)

One-to-Many

c)

Many-to-Many

d)

No Relationship

46.

Given the following diagram, if you want to delete a customer and retain referential integrity what order do you delete from the tables?

a)

order_details

b)

order

c)

customer

1)
2)
3)
47.

A relational database is developed for a hospital. State which of the following are end-user requirements.

a)

The nurses must be able to count how many patients should be in each room.

b)

The doctors must be able to change the diagnosis of a patients.

c)

The database must store information about the staff, patients, rooms and appointments.

d)

A simple update query will be used to change the room that a patient occupying.

e)

A complex search query will be used to show the details of a patient's appointment by searching using their patientID and appointment date and appointment time.

48.

A relational database is developed for a hospital. State which of the following are functional requirements.

a)

The nurses must be able to to enter a new patients into the database.

b)

The receptionists must be able to add a new appointment for the patient and assign it to a doctor and room.

c)

The database must allow the patients current medication to be updated using a simple update query.

d)

A simple search query will be used with wildcards to allow the user to search for a patient using just the first letter of their surname.

e)

A complex search query will be used to show the details of a patient's appointment by searching using their patientID and appointment date and appointment time.

49.

State the cardinality between the two table shown in the Entity Occurrence Diagram

a)

One to one

b)

One to Many

c)

Many to Many

50.

State the cardinality between the two table shown in the Entity Occurrence Diagram

a)

One to one

b)

One to Many

c)

Many to Many

51.

State the cardinality between the two table shown in the Entity Occurrence Diagram

a)

One to one

b)

One to Many

c)

Many to Many

52.

State which of the following Entity Occurrence Diagrams correctly demonstrate the relationships between the entities in the Entity Relationship Diagram shown.

a)
b)
c)
d)
53.

State the purpose of a compound key.

a)

To join multiple fields together to create a unique combination of data that can be used in place of a primary key.

b)

An aggregate function that is used to calculate compounding interest in a financial database.

c)

Used in conjunction with the primary key to create a unique identifier for each record.

d)

Used in encryption to decrypt and encrypt plain text messages.

54.

Using the image provided, state a suitable compound key.

THIS QUESTIONS NEEDS TO BE FIXED SORRY!!!

a)

CustomerID + Date + Time

CLICK HERE TO GET THE MARK

b)

StaffID + CustomerID

c)

Date + Time

d)

StaffID + CustomerID + Date

55.

The data dictionary shown is used to store the details of when an employee is working in a shop. State the errors with this data dictionary.

a)

Wrong Primary Key

b)

Should use a Compound Key

c)

Validation missing condition on Department field

d)

Incorrect data types

e)

Sizes are incorrect

56.

State any errors that are present in the data dictionary shown.

a)

Birthday should have a length check

b)

The entity should have a compound key

c)

The field EmployeeID should not have a presence check

d)

StoreID should have referential integrity applied to it in the validation

e)

There are no errors

57.

In a data dictionary, describe the purpose of the attribute size column.

a)

The attribute size column is used to identify the maximum number of characters allow for a textual value.

b)

The attribute size column is used to define the exact length of data stored in a text data type must be.

c)

The attribute size column is used to state the maximum size of each field being stored in an entity.

d)

The attribute size column is used to define the actual storage, in bytes, that will be used to store any data stored in the field per record.

58.

Describe the purpose of a wildcard.

a)

A wildcard is used in the WHERE clause to create a condition that allows placeholder letters.

b)

A wildcard let's the use enter any letter or number to fill in a space of the data.

c)

As the user types in some data the computer using wildcards will display some possible options to choose from.

d)

The wildcard is a special type of query that allows the user to change zero, one or many letters in a text value.

59.

State which of the following WHERE clauses would display records which contain the word "and" in their category.

a)

WHERE category LIKE "*and*"

b)

WHERE category LIKE "%and%"

c)

WHERE category LIKE "?and?"

d)

WHERE category LIKE "_and_"

e)

WHERE category CONTAINS "and"

60.

State which of the following are not an aggregate function.

a)

AVG()

b)

price * quantity

c)

MIN() AS [Minimum Price]

d)

LIKE "A*"

e)

GROUP BY itemCODE

61.

State which of the following are an aggregate function.

a)

MAX(price) AS [Maxiumum Price]

b)

price * quantity

c)

COUNT(*) AS [Number of Items]

d)

surname LIKE "A*"

e)

GROUP BY itemCODE

62.

Describe purpose of calculated values.

a)

To carry out arithmetic on the data stored in fields to be displayed in the results table.

b)

To carry out arithmetic on the data stored in fields to update the values that are stored in the database entity.

c)

To calculate the result of an aggregate function.

d)

To calculate string operations on the values stored in the database records.

63.

Describe the purpose of an alias.

a)

An alias is used to give a name to or rename a column in the results table of an SQL query.

b)

An alias is used to change the name of a field in the database table.

c)

An alias is used to change the name of any values that are used in the GROUP BY clause.

d)

An alias is used to add a heading to the whole results table so the user knows what the results are for.

64.

Describe the purpose of the GROUP BY clause.

a)

GROUP BY groups records together that have the same value in the given field. This allows an aggregate function to be used on subsets of data individually rather than the whole set of data.

b)

The GROUP BY let's the user specify where to find the data in the database.

c)

The GROUP BY clause allows the user to categorise the records in the results table.

d)

A GROUP BY is used when the user is using non-aggregate functions to allow them to be displayed even though they don't have an aggregate function.

65.

State whether this SQL query will execute correctly.

SELECT category, COUNT(category) AS [Number of Items]

FROM Items

a)

Yes

b)

No

66.

Describe the expected output of the following SQL Query.


SELECT DirectorName, AVG(duration) AS [Average Movie Duration]

FROM Movies

GROUP BY DirectorName

ORDER BY AVG(duration) DESC

a)

It will display a list of directors with the average length of their movies. The directors will be shown from largest average length to smallest average length.

b)

It will display the average duration of all the movies with the director who's average was the closest to the total average of all the movies. The directors will be displayed from largest total average to smallest total average.

c)

It will display the average duration of the specified director. The directors will be shown from largest average length to smallest average length.

d)

It will display only the directors names from smallest duration to largest duration.

67.

State which of the following SQL queries will display the year that each directors first movie was released.

a)

SELECT name, MIN(yearReleased) AS [Year of First Movie]

FROM Movie

GROUP BY name

b)

SELECT name, MAX(yearReleased) AS [Year of First Movie]

FROM Movie

GROUP BY name

c)

SELECT name, MIN(yearReleased) AS [Year of First Movie]

FROM Movie

GROUP BY yearReleased

d)

SELECT name, MAX(yearReleased) AS [Year of First Movie]

FROM Movie

GROUP BY yearReleased

68.

Using the sample data shown, Select the output of the following SQL Query:

SELECT Type, MIN(price) AS ‘Least expensive item’

FROM Electronics

WHERE Quantity >= 10

GROUP BY Type;

a)
b)
c)
d)
69.

State which of the following SQL Statements would produce the results shown for all full time employees.

a)

SELECT Department, SUM(salary) AS [Salary Cost]

FROM Staff

WHERE partTime = false

GROUP BY Department;

b)

SELECT Department, COUNT(salary) AS [Salary Cost]

FROM Staff

WHERE partTime = false

GROUP BY Department;

c)

SELECT Department, SUM(salary)

FROM Staff

WHERE partTime = false

GROUP BY Department;

d)

SELECT Department, SUM(salary)

FROM Staff

ORDER BY SUM(salary) DESC

GROUP BY Department;

70.

Select of the following results would be generated from the SQL Queries shown.

a)
b)
c)
d)