wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Databases

Total questions: 55

Worksheet time: 41mins

Name
Class
Date
1.
What is a database?
a)
A piece of software to do calculations
b)
A device to load information onto the computer.
c)
A structured collection of information
d)
A calculator
2.
Which of the following describes a relational database?
a)
Access
b)
A database that has a table
c)
There are two or more tables that are linked using the primary keys
d)
There are more than one table that have duplicate data
3.
A sports club needs to store information about each member.  The individual information about each member is called a:
a)
Field
b)
File
c)
Table
d)
Record
4.
One of the members of the Sports Club has decided to resign.  What would the secretary do with the record for that member on the database?
a)
Amend the record
b)
Delete the field
c)
Delete the record
d)
Delete the file
5.
The Sports Club has had an Open Day and has gained a new member.  How will they add their details to the database?
a)
Add another field
b)
Amend a record
c)
Add a new record
d)
Delete a record
6.
The whole database is called:
a)
The file
b)
The field
c)
The record
d)
The table
7.
One specific piece of information about a person or thing is called:
a)
Field
b)
File
c)
Record
d)
Table
8.
A scout company have a database with records of all the scouts.  They want to create a list of all scouts who are under 15 and their achievements. What would they use? 
a)
SQL UPDATE command
b)
Form 
c)
SQL SELECT Query
d)
Sort
9.
A gym has a database with all their members they want to include email addresses in the database, what will they do?
a)
Add a record
b)
Add a field
c)
Edit a record
d)
Delete a field
10.
A health club wants to find all the members who use the club 3 days or more a week.  What will they put in the query in the 'days' SQL query criteria?
a)
>3
b)
<3
c)
<=3
d)
>=3
11.
What data type would be used to store the following item code:   0024
a)
Text
b)
Integer
c)
Real
d)
Boolean
12.
The school wants to sort the data by staff Surname.  How will they sort it?
a)
Ascending order
b)
Descending order
13.

Text, Integer, Currency, Boolean and Date/Time are all examples of...

a)

Data Types

b)

Filters

c)

Sorts

d)

Validations

14.
A unique identifying field.
a)
Primary Key
b)
Integer
c)
Verification
d)
Boolean
15.

The HD field is using the data type Boolean

a)

True

b)

False

16.

Which of the following is an example of a field?

a)

347

b)

ChannelType

c)

351, Nature, Documentary, Bling, False

17.

Which data type would be most suitable for Length?

a)

Integer

b)

Float/Double

c)

Boolean

d)

String

18.

Normalisation is:

a)

Removing all necessary data from a database

b)

Organising a database to remove repeated entries and increase the accuracy of the data

c)

Putting fields from different tables into one big database

19.

What is an atomic field?

a)

A field that contains multiple items of data

b)

A field that is repeated

c)

A field that contains only one item of data

20.

What is a foreign key?

a)

A unique identifier in a database

b)

A primary key of one table that appears in another table

c)

A field that should not be in a table and needs removing

21.

A relation is in 1NF if it doesn't contain any ____________?

a)

Determinants

b)

Repeating groups

c)

Null values in primary key fields

d)

Functional dependencies

22.

When you normalize a relation by breaking it into two smaller relations, what must you do to maintain data integrity?

a)

Remove any functional dependencies from both relations

b)

Assign both relations the same primary key field(s)

c)

Create a primary key(s) for the new relation

23.

Tables in ____ will perform suitably in business transactional databases.

a)

0NF

b)

1NF

c)

2NF

d)

3NF

24.
What does Normalisation allow a database designer to do?
a)
Design their database efficiently, removing the chance of redundancy and inaccuracies. 
b)
Remove additional records from the tables. 
c)
Add as much data as they like. 
d)
Draw an ERD. 
25.
To be in 2NF: 
a)
Each non-key field relates to the primary key
b)
There are multiple entries in the same field
c)
There are no foreign keys
d)
All numbers are in decimal form
26.
To be in 2NF:
a)
Any field not relating to the PK is placed in a separate table
b)
The records all relate easily
c)
Each table has a foreign key
d)
There are no redundancies
27.
To be in 3NF:
a)
Records do not depend on anything other than the table's PK
b)
The PK is not added
c)
The FKs are limited to one only
d)
The tables all relate to one another
28.
Which one of these do you want to avoid in good database design?
a)
Redundancy!
b)
Giant squid!
c)
Third normal form!
d)
Data!
29.
A primary key
a)
Is a unique identifier for the table. It cannot be null. 
b)
Is a unique identifier for the table. It can be null. 
c)
Is an identifier that always connects to a foreign key. 
d)
Is used in flat file databases. 
30.
An ER diagram shows relationships between:
a)
Tables in a relational database. 
b)
Rows in a relational database. 
c)
Records with foreign keys. 
d)
Two items about which there is data kept. 
31.
One shopper buys many items. How is this expressed as a relationship on an ER diagram?
a)
1:M
b)
M:1
c)
M:N
d)
1:1
32.
Many users access many servers. Why is this statement not a good inclusion in an ER diagram?
a)
It creates duplicates and therefore redundancy. 
b)
It is not a good idea to access too many servers. 
c)
It is syntactically incorrect. 
d)
It involves a bridging entity. 
33.
What word is missing from the line below?
SELECT *
_______ CUSTOMER;
a)
FROM
b)
WHERE
c)
SELECT
d)
ORDER BY
34.
What is the purpose of  *?
a)
Selects ALL fields from the table
b)
Selects only the first field in the table
c)
Selects the last field in the table
d)
Shows only the first row in the table
35.
Return the name and genre of each movie with an imdb_rating greater than 5 and year greater than 2012.
a)
SELECT * FROM movies WHERE imdb_rating > 5 AND year > 2012;
b)
SELECT name, genre FROM movies WHERE imdb_rating < 5 AND year < 2012;
c)
SELECT name, year FROM movies WHERE imdb_rating > 5 year > 2012;
d)
SELECT name, genre FROM movies WHERE imdb_rating > 5 AND year > 2012;
36.
Write the code for the following : Return all movies with the word love.
a)
SELECT * FROM movies WHERE name LIKE %love%;
b)
SELECT * FROM movies WHERE name LIKE ‘love’;
c)
SELECT * FROM movies WHERE name LIKE %love;
d)
SELECT * FROM movies WHERE name LIKE ‘%love%’;
37.

In ACID, A stands for Atomicity. But what does that mean?

a)

A transaction must be processed in its entirety or not at all

b)

A field must have a field length

c)

There must be validation on the key fields

d)

A transaction must have a valid link to another record on a linked table

38.

In ACID, the C stands for consistency. What does this mean?

a)

A transaction must be consistent

b)

A transaction must have a related record on another table

c)

A transaction cannot break any of the validation rules which maintain the integrity of the database

d)

A transaction must not force a failure in the database which causes ACID to fail overall

39.

The I in ACID stands for isolation. What does this mean?

a)

A transaction that has been bad must be placed in isolation until it knows what it has done wrong. Usually 1 minute per year after it has been created.

b)

No other transaction can be completed until the current transaction is completed even if they have to be completed concurrently.

c)

If somebody is accessing the same record, they must be stopped

d)

Records are put on their own for identification

40.

The D in ACID stands for durability. What does this mean?

a)

All transactions must be recorded on the database

b)

The database is able to be used by anybody

c)

If somebody drops the storage drive with the database on, it will still function

d)

Once a transaction has been committed, the transactions dependent on this will be completed even if there is a power cut

41.

If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default

a)

ASC

b)

DESC

c)

There is no default value

d)

None of the mentioned

42.

Which SQL function is used to count the number of rows in a SQL query?

a)

COUNT()

b)

NUMBER()

c)

SUM()

d)

COUNT(*)

43.

With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?

a)

SELECT * FROM Persons WHERE FirstName=’a’

b)

SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c)

SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d)

SELECT * FROM Persons WHERE FirstName=’%a%’

44.

How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?

a)

UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

b)

MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

c)

MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

d)

UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

45.

SQL query to find all the cities whose humidity is 95.

a)

SELECT city WHERE humidity = 95

b)

SELECT city FROM weather WHERE humidity = 95

c)

SELECT humidity = 89 FROM weather

d)

SELECT city FROM weather

46.

SQL query to find the temperature in increasing order of all cities.

a)

SELECT city FROM weather ORDER BY temperature

b)

SELECT city, temperature FROM weather

c)

SELECT city, temperature FROM weather ORDER BY temperature

d)

SELECT city, temperature FROM weather ORDER BY city

47.

Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.

a)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70

b)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70

c)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70

d)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70

48.

The command to remove rows from a table ‘CUSTOMER’ is __________________

a)

DROP FROM CUSTOMER

b)

UPDATE FROM CUSTOMER

c)

REMOVE FROM CUSTOMER

d)

DELETE FROM CUSTOMER WHERE

49.

Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.

a)

SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)

b)

SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)

c)

SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)

d)

SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);

50.

SQL is

a)

Structured Query Language

b)

Simple Query Language

c)

Structured Question Language

d)

Structure Quality Language

51.

Which statement is used to extract data from a database?

a)

Extract

b)

Get

c)

Open

d)

Select

52.

In order to modify data in a database we would use which SQL statement?

a)

Update

b)

Amend

c)

Alter

d)

Modify

53.

To remove a record from a table which SQL statement would you use?

a)

Remove

b)

Cancel

c)

Delete

d)

Eradicate

54.

Which statement allows us to add a record to a table?

a)

Add To

b)

Update To

c)

Add Into

d)

Insert Into

55.

______________ constraint prevents NULL values

a)

UNIQUE

b)

NOT NULL

c)

NULL

d)

FOREIGN KEY