Font size
WorksheetsH446|U4 End of unit big quiz
Total questions: 100
Worksheet time: 50mins
Which type of compression permanently removes non-essential data?
Lossless
Lossy
Run Length Encoding
Dictionary-based
Which compression method is best suited for text files?
Lossy
Lossless
JPG
MP3
What does RLE stand for?
Run Length Encoding
Real Lossless Encryption
Random Length Extension
Redundant Lossy Encoding
In RLE, how is repeated data represented?
By storing each instance of the data
By removing the repeated data
By storing one example and the number of repetitions
By encrypting the repeated data
Dictionary-based compression stores frequently occurring data in a:
Hash table
Array
Dictionary
Queue
What is the purpose of encryption?
To reduce file size
To ensure data integrity
To make data unreadable without the correct key
To speed up data transfer
In encryption, the original message is called:
Ciphertext
Key
Plaintext
Hash
Which of the following is a simple substitution cipher?
Vernam cipher
Caesar cipher
Asymmetric encryption
Hashing
What is a weakness of the Caesar cipher?
It is too complex
It is unbreakable
It can be easily broken using frequency analysis
It requires a one-time pad
Which cipher is proven to be unbreakable if used correctly?
Caesar cipher
Vernam cipher
Symmetric encryption
Hashing
What is another name for the encryption key used in the Vernam cipher?
Public key
Private key
One-time pad
Hash
In the Vernam cipher, the encryption key should be:
Shorter than the plaintext
The same length as or longer than the plaintext
Used multiple times
Predictable
What operation is used to encrypt and decrypt data in the Vernam cipher?
AND
OR
XOR
NOT
Ciphers based on computational security:
Are unbreakable
Use a one-time pad
Can be broken given enough time and computing power
Use two keys
Which type of encryption uses the same key for encryption and decryption?
Asymmetric
Symmetric
Hashing
Vernam
What is a disadvantage of symmetric encryption?
It is too slow
It requires two keys
The key must be transferred to the recipient
It is unbreakable
Asymmetric encryption uses:
One key
Two related keys
A one-time pad
A hash function
In asymmetric encryption, which key is made public?
Private key
Public key
Session key
Secret key
What is a hashing function?
A two-way function
A one-way function
An encryption method
A compression method
Hashing is useful for storing:
Large files
Images
Passwords
Audio files
What is the simplest kind of database?
Relational database
Flat file database
Hierarchical database
Object-oriented database
Which of the following is an example of an entity?
Jo Bloggs
Customer
C111
fcarr53@gmail.com
What is an attribute?
A category of object
A characteristic of an entity
A single instance of an entity
A relationship between entities
Which attribute uniquely identifies a record in a relational database?
Foreign key
Secondary key
Primary key
What is a composite primary key?
A key in a flat file database
A key consisting of more than one attribute
A key that is not unique
A key in a related table
A field for which an index has been created for faster lookup is called a:
Foreign key
Secondary key
Primary key
Composite key
Which of the following is a type of relationship between entities?
One-to-one
One-to-many
Many-to-many
All of the above
In an Entity Relationship Diagram (ERD), entities are represented by:
Circles
Squares
Diamonds
Triangles
What is a foreign key?
The primary key of a table
An attribute that creates a join between two tables
A non-unique identifier
A key consisting of more than one attribute
In which table is a foreign key located?
On the "one" side of a relationship
On the "many" side of a relationship
In both tables
What does referential integrity ensure?
That all data is unique
That no foreign key references a non-existent record
That all primary keys are present
That all tables are in 3NF
In a one-to-many relationship between Customer and Subscription, which table contains the foreign key?
Customer
Subscription
Both Customer and Subscription
Neither Customer nor Subscription
Which of the following is true about a relation?
It is another name for a relationship
It is a type of entity
It is another name for a table
It is a column in a table
A database contains one or more:
Attributes
Entities
Relations
Records
A row in a relation contains a:
Field
Record
Attribute
Key
A column in a relation contains a:
Field
Record
When there is a many-to-many relationship between tables, they are:
Directly linked
Linked using a foreign key
Linked using a link table
Not linked
In a link table, what type of keys are used to link to other tables?
Primary keys
Secondary keys
Foreign keys
Composite keys
In a relational database, a table is also known as a:
Entity
Attribute
Relation
Record
Normalisation is used to:
Increase the size of a database
Improve query performance
Organise data and reduce redundancy
Define relationships between entities
In a relational database, tables are also known as:
Entities
Attributes
Relations
Records
The purpose of normalisation is:
To increase data redundancy
To organize data to reduce redundancy
To make data retrieval slower
To ensure data is stored in a single table
What is the purpose of normalization?
To increase data redundancy
To complicate database design
To arrive at the best possible database design
To reduce the number of tables
How many stages are there in normalisation?
1
2
3
4
What does 1NF stand for?
First Normal Form
Foreign Normal Form
Functional Normal Form
Final Normal Form
A table is in 1NF if it contains:
No repeating attributes
No partial dependencies
No non-key dependencies
Only a primary key
In 1NF, all attributes must be:
Unique
Atomic
Indexed
Foreign keys
A table with a primary key consisting of more than one field is called a:
Foreign key
Secondary key
Composite key
Simple key
7. What does 2NF stand for?
Second Normal Form
Second Nominal Form
Secondary Normal Form
Secondary Nominal Form
A table is in 2NF if it is in 1NF and contains no:
Repeating attributes
Partial dependencies
Non-key dependencies
Foreign keys
Which normal form can only occur if the primary key is a composite key?
1NF
2NF
3NF
BCNF
What does 3NF stand for?
Third Normal Form
Tertiary Normal Form
Transitive Normal Form
Top Normal Form
A table is in 3NF if it is in 2NF and contains no:
Repeating attributes
Partial dependencies
Non-key dependencies
Foreign keys
The definition of a table in 3NF is:
All attributes are atomic
All attributes are dependent on the key
All attributes are dependent on the key, the whole key, and nothing but the key
All attributes are unique
In 3NF, a non-key dependency means that an attribute is dependent on:
The primary key
A foreign key
A non-key attribute
All attributes
Which of the following is an advantage of normalisation?
Increased data redundancy
More complex queries
Faster searches
Larger tables
Normalisation helps to maintain:
Data redundancy
Data integrity
Data complexity
Data size
Having smaller tables with fewer fields results in:
Slower searches
Increased storage
Faster searches
More complex relationships
If a person changes their address, how many tables need to be updated in a normalised database?
All tables
Only one table
Two tables
It depends on the number of foreign keys
Which is not a property of a relation in 3NF
All attributes are dependent on the key
The relation is in 2NF
There are no non-key dependencies
What does SQL stand for?
Simple Query Language
Structured Query Language
Standard Query Language
Sequential Query Language
SQL is a:
Procedural language
Object-oriented language
Declarative language
Functional language
Which SQL statement is used to extract data from a database?
SELECT
FROM
WHERE
ORDER BY
In a SELECT statement, which clause specifies the table(s) to retrieve data from?
SELECT
FROM
WHERE
ORDER BY
Which clause is used to specify search criteria in a SELECT statement?
WHERE
FROM
ORDER BY
GROUP BY
Which clause is used to filter the results of a query?
SELECT
FROM
WHERE
ORDER BY
Which clause is used to sort the results of a query?
SELECT
FROM
WHERE
ORDER BY
What does the asterisk (*) wildcard mean in a SELECT statement?
Any single character
Zero or more characters
All fields
All tables
Which SQL keyword is used to search for a pattern?
EQUAL
LIKE
IN
BETWEEN
Which SQL operator is used to specify a range of values?
EQUAL
LIKE
IN
BETWEEN
Which SQL operator is used to specify multiple possible values for a column?
EQUAL
LIKE
IN
BETWEEN
If neither ASC nor DESC is specified in an ORDER BY clause, the default order is:
Descending
Ascending
Random
Unsorted
When selecting attributes from linked tables, you should specify the table name when:
The attribute name is unique
The attribute name occurs in more than one table
The attribute is a primary key
The attribute is a foreign key
Which keyword is used as an alternative to the WHERE clause to extract data from two linked tables?
LINK
JOIN
COMBINE
MERGE
In a JOIN clause, the ON keyword is used to specify:
The tables to join
The attributes to select
The join condition
The order of the results
Which is not a clause of the SELECT statement?
SELECT
FROM
JOIN
WHERE
What will the following query return? SELECT * FROM Customers WHERE City = "London";
All customers
All fields from the Customers table where the city is London
The city of London from the Customers table
An error
What does the following SQL do? SELECT OrderID, CustomerName FROM Orders ORDER BY CustomerName DESC;
Selects the OrderID and CustomerName from the Orders table and sorts it in Descending Order by the OrderID
Selects the OrderID and CustomerName from the Orders table and sorts it in Descending Order by the CustomerName
Selects the OrderID and CustomerName from the Orders table and sorts it in Ascending Order by the OrderID
Selects the OrderID and CustomerName from the Orders table and sorts it in Ascending Order by the CustomerName
Which statement is used to combine the results of two SELECT statements?
JOIN
UNION
MERGE
COMBINE
Which symbol is used to separate each SQL statement?
a) ,
b) .
c) ;
d) :
Which SQL statement is used to create a new table?
CREATE TABLE
ALTER TABLE
Which SQL statement is used to create a new table?
CREATE TABLE
ALTER TABLE
INSERT INTO
UPDATE
Which SQL statement is used to modify the structure of an existing table?
CREATE TABLE
ALTER TABLE
INSERT INTO
UPDATE
Which SQL statement is used to add a new record to a table?
CREATE TABLE
ALTER TABLE
INSERT INTO
UPDATE
Which SQL statement is used to modify an existing record in a table?
CREATE TABLE
ALTER TABLE
INSERT INTO
UPDATE
Which SQL statement is used to delete a record from a table?
CREATE TABLE
ALTER TABLE
INSERT INTO
DELETE
Which data type is used for variable-length character strings?
CHAR
VARCHAR
TEXT
STRING
Which data type is used for true/false values?
INT
FLOAT
Which data type is used for storing date values?
TIME
DATE
DATETIME
TIMESTAMP
Which data type is used for currency values?
FLOAT
DECIMAL
MONEY
CURRENCY
In a CREATE TABLE statement, which keyword is used to specify that a field cannot be left blank?
UNIQUE
PRIMARY KEY
NOT NULL
REQUIRED
Which SQL clause is used to add a new column to an existing table?
ADD COLUMN
ADD
ALTER COLUMN
INSERT COLUMN
Which SQL clause is used to delete a column from an existing table?
DELETE COLUMN
DELETE
DROP COLUMN
DROP
Which SQL clause is used to change the data type of a column?
(a)
Which keyword is used to create a link between two tables?
LINK
JOIN
FOREIGN KEY
REFERENCES
When inserting data into a table, the order of the values must match the order of the:
Table names
Field names
Data types
Constraints
Which SQL clause is used to specify the new values for a record in an UPDATE statement?
NEW VALUES
SET
CHANGE
MODIFY
In an UPDATE statement, which clause is used to specify which record should be modified?
SET
FROM
WHERE
ORDER BY
To delete all records from a table without deleting the table itself, you can use:
DROP TABLE
DELETE FROM
DELETE * FROM
TRUNCATE TABLE
What is the main difference between CHAR and VARCHAR?
CHAR is fixed-length, VARCHAR is variable-length
VARCHAR is fixed-length, CHAR is variable-length
There is no difference
CHAR is for numbers, VARCHAR is for text
