wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Databases Fundamental Quiz 1

Total questions: 75

Worksheet time: 56mins

Name
Class
Date
1.
In which situation do you need to perform a restore on a database?
a)
when data becomes corrupted in the database
b)
when you need to roll back a transaction
c)
when you encounter an error in your application
d)
when data needs to be deleted from the database
2.
Which command should you use to give a user permission to read the data in a table?
a)
ALLOW SELECT
b)
LET READ
c)
PERMIT READ
d)
GRANT SELECT
3.
Which keyword can be used in a create table statement?
a)
ORDER BY
b)
DISTINCT
c)
GROUP BY
d)
UNIQUE
4.
You need to store product quantities, and you want to minimize the amount of storage space that is used. Which data type should you use?
a)
INTEGER
b)
DOUBLE
c)
COUNT
d)
FLOAT
5.
Which statement will result in the creation of an index?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
6.
You have the following table definition: CREATE TABLE Road (RoadID INTEGER NOT NULL, Distance INTEGER NOT NULL) The Road table contains the following data: You execute the following statement: INSERT INTO Road VALUES (1234, 36) What is the result?
a)
an error stating that NULL values are not allowed
b)
a new row in the table
c)
an error stating that duplicate IDs are not allowed
d)
a syntax error
7.
One reason to create a stored procedure is to:
a)
Improve performance.
b)
Minimize storage space.
c)
Bypass case sensitivity requirements.
d)
Give the user control of the query logic.
8.
Which permission does a user need in order to run a stored procedure?
a)
EXECUTE
b)
ALLOW
c)
CALL
d)
RUN
9.
You have a table named Product. You create a view that includes all the products from the Product table that are in the Furniture category. You execute a statement on the Product table that deletes all the products in the Furniture category. After you execute the statement, the result set of the view is:
a)
Empty
b)
Deleted
c)
Unchanged
d)
Archived
10.
You have two tables. Each table has three rows. How many rows will be included in the Cartesian product of these two tables?
a)
1
b)
3
c)
6
d)
9
11.
You are writing an SQL statement to retrieve rows from a table. Which data manipulation language (DML) command should you use?
a)
READ
b)
SELECT
c)
OUTPUT
d)
GET
12.
Which constraint ensures a unique value in the ID column for each customer?
a)
DISTINCT
b)
FOREIGN KEY
c)
SEQUENTIAL
d)
PRIMARY KEY
13.
The component that holds information for a single entry in a table is called a:
a)
Data type
b)
Row
c)
Column
d)
View
14.
You are writing a select statement to find every product whose name contains a specific character. Which keyword should you use in your where clause?
a)
FIND
b)
BETWEEN
c)
INCLUDES
d)
LIKE
15.
A database contains two tables named Customer and Order. You execute the following statement: DELETE FROM Order WHERE CustomerID = 209 What is the result?
a)
The first order for CustomerID 209 is deleted from the Order table.
b)
All orders for CustomerID 209 are deleted from the Order table, and CustomerID 209 is deleted from the Customer table.
c)
All orders for CustomerID 209 are deleted from the Order table.
d)
CustomerID 209 is deleted from the Customer table.
16.
You have a table named Product. The Product table has columns for ProductDescription and ProductCategory. You need to change the ProductCategory value for all the spoons in the Product table to 43. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
17.
You have a table that contains information about all students in your school. Which SQL keyword should you use to change a student's first name in the table?
a)
UPDATE
b)
CHANGE
c)
SELECT
d)
INSERT
18.
You need to populate a table named EmployeeCopy with data from an existing table named Employee. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
19.
You execute the following statement: This statement is an example of a/an:
a)
Subquery
b)
Union
c)
Outer join
d)
Cartesian product
20.
Which keyword would you use in a select statement to return rows that meet a specific condition?
a)
WHERE
b)
UNION
c)
ORDER BY
d)
FROM
21.
You have a table named Employee that includes the following columns: EmployeeID Smp1oyeeName Which statement should you use to return the number of rows in the table?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
22.
The Product table contains the following data. You execute the following statement: SELECT COUNT(*) FROM Product WHERE Quantity > 18 What is the value returned by this statement?
a)
1
b)
2
c)
3
d)
4
23.
Which command should you use to remove a table from a database?
a)
REMOVE TABLE
b)
UPDATE TABLE
c)
DROP TABLE
d)
DELETE TABLE
24.
You need to store the contact information for each student in your school database. You should store each student's information in a:
a)
Stored procedure
b)
Function
c)
Row
d)
Variable
25.
Which category of SQL statements is used to add, remove, and modify database structures?
a)
Data access language (DAL)
b)
Data manipulation language (DML)
c)
Data control language (DCL)
d)
Data definition language (DDL)
26.
You have a Customer table and an Order table. You join the Customer table with the Order table by using the CusromerID column. The results include: All customers and their orders Customers who have no orders Which type of join do these results represent?
a)
Complete join
b)
Partial join
c)
Inner join
d)
Outer join
27.
Data in a database is stored in:
a)
Tables
b)
Queries
c)
Data types
d)
Stored procedures
28.
You need to disable User1's access to view the data in the Customer table. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
29.
Denormalization is performed in order to:
a)
Reduce redundancy.
b)
Eliminate repeating groups.
c)
Create smaller tables.
d)
Improve query performance.
30.
You have a table named Product that contains one million rows. You need to search for product information in the Product table by using the product's unique ID. What will make this type of search more efficient?
a)
A cursor
b)
A subquery
c)
A trigger
d)
An index
31.

You have a table named Product that contains the following data. The PrcducrID column is the primary key. The CategoryID column is a foreign key to a separate table named Category. You execute the following statement: INSERT INTO Product VALUES (3296, 'Table', 4444) What is the result?

a)
a foreign key constraint violation
b)
a syntax error
c)
a new row in the Product table
d)
a primary key constraint violation
e)
a new row in the Category table
32.
Which two keys establish a relationship between two tables? (Choose two.)
a)
candidate
b)
foreign
c)
superkey
d)
local
e)
primary
33.
One difference between a function and a stored procedure is that a function:
a)
Must be called from a trigger.
b)
Must return a value.
c)
Cannot contain a transaction.
d)
Cannot accept parameters.
34.
Which keyword must be included in a create view statement?
a)
WHERE
b)
ORDER BY
c)
UPDATE
d)
SELECT
35.
You have a table named Customer. You need to add a new column named District. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
36.
You need to remove a view named EmployeeView from your database. Which statement should you use?
a)
DELETE VIEW EmployeeView
b)
DELETE EmployeeView
c)
DROP EmployeeView
d)
DROP VIEW EmployeeView
37.
A named group of SQL statements that can be executed in a database is called a:
a)
Subroutine
b)
Formula
c)
Stored procedure
d)
Method
38.
A view can be used to:
a)
Save an extra copy of data stored in a separate table.
b)
Limit access to specific rows or columns of data in a table.
c)
Ensure referential integrity.
d)
Save historical data before deleting it from the base table.
39.
On which database structure does an update statement operate?
a)
Table
b)
User
c)
Trigger
d)
Role
40.
You need to list the name and price of each product, sorted by price from highest to lowest. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
41.
You delete rows in a table named Order. The corresponding rows in the OrderItem table are automatically deleted. This process is an example of a/an:
a)
Inherited delete
b)
Cascade delete
c)
Functional delete
d)
Waterfall delete
e)
Domino delete
42.
Which statement deletes the rows where the employee's phone number is not entered?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
43.
You need to insert two new products into the Product table. The first product is named Book and has an ID of 125. The second product is named Movie and has an ID of 126. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
44.
You need to store the first name, last name, and student ID for 100 students. This information will be stored in a table as:
a)
100 items and three cells.
b)
100 rows and three columns.
c)
three rows and 100 columns.
d)
three items and 100 cells.
45.
What are three valid data manipulation language (DML) commands? (Choose three.)
a)
INSERT
b)
COMMIT
c)
DELETE
d)
OUTPUT
e)
UPDATE
46.
You assign User1 a set of permissions that include the WITH GRANT OPTION. The WITH GRANT OPTION enables User1 to:
a)
request a log of permission use.
b)
delegate permissions to other users.
c)
create new database users.
d)
view other users' permissions.
47.
Which type of index changes the order in which the data is stored in a table?
a)
non-sequential
b)
sequential
c)
non-clustered
d)
clustered
48.
Which statement should you use to remove a foreign key?
a)
ALTER TABLE
b)
DELETE TABLE
c)
DELETE FOREIGN KEY
d)
ALTER FOREIGN KEY
49.
First normal form requires that a database excludes:
a)
Foreign keys
b)
Composite keys
c)
Duplicate rows
d)
Repeating groups
50.
You execute a statement inside a transaction to delete 100 rows from a table. The transaction fails after only 40 rows are deleted. What is the result in the database?
a)
The table will be corrupted.
b)
Forty (40) rows will be deleted from the table.
c)
The transaction will restart.
d)
No rows will be deleted from the table.
51.
You have a table that contains product IDs and product names. You need to write an UPDATE statement to change the name of a specific product to glass. What should you include in the update statement?
a)
SET ProduetName = 'glass'
b)
LET ProduetName = 'glass'
c)
EXEC ProduetName = 'glass'
d)
ASSIGN ProduetName = 'glass'
52.
Your database contains a table named Customer. You need to delete the record from the Customer table that has a CusromerID of 12345. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
53.
On which database structure does an insert statement operate?
a)
Role
b)
Trigger
c)
User
d)
Stored procedure
e)
Table
54.
You have a table of products with fields for ProductID, Name, and Price. You need to write an UPDATE statement that sets the value in the InStock field to Yes for a specific ProductID. Which clause should you use in your update statement?
a)
THAT
b)
WHERE
c)
GROUP BY
d)
HAVING
55.
You have the following table definition: CREATE TABLE Product (ProductID INTEGER, Name VARCHAR(20)) You need to insert a new product. The product's name is Plate and the product's ID is 12345. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
56.
You have the database table named Cars as defined below: You have the following Structured Query Language (SQL) statement: SELECT * FROM Cars c WHERE c.Origin <> ‘USA’ AND c.Color <> ‘Black’ How many rows are returned by the SQL statement?
a)
4
b)
5
c)
6
d)
7
57.
You have a database table named SongInformation as defined below: You need to create a Structured Query Language (SQL) query to retrieve only the names of songs that sold more than 1000 compact discs (CDs). Which query should you use?
a)
SELECT Name FROM SongInformation WHERE CDsSold > 1000
b)
SELECT Name FROM CDsSold WHERE CDsSold > 1000
c)
SELECT * FROM SongInformation WHERE CDsSold > 1000
d)
SELECT * FROM SongInformation
58.
You need to combine the results of two queries into a single result that contains all of the rows from both queries. Which Structured Query Language (SQL) statement should you use?
a)
TRUNCATE
b)
JOIN
c)
EXCEPT
d)
UNION
59.

This question requires that you evaluate the underlined text to determine if it is correct. The CREATE TABLE command removes one or more table definitions and all data, indexes, triggers, constraints, and permission specifications for those tables. Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the statement is incorrect, select the answer choice that makes the statement correct

a)
No change is needed
b)
DROP TABLE
c)
TRUNCATE TABLE
d)
ALTER TABLE
60.
You accept an IT internship at a local charity. The charity wants you to help them with compliance and auditing requirements. You need to ensure that a column or combination of columns uniquely identifies each row of a table. Which constraint should you define?
a)
Primary key
b)
Secondary key
c)
Foreign key
d)
Default key
61.
While attending college, you accept an IT internship at a local charity. The charity needs to report on data that is related and exists in two tables. You need to establish a relationship between the data that is in the two tables. Which constraint should you define?
a)
Foreign key
b)
Index key
c)
Link key
d)
Default key
62.

This question requires that you evaluate the underlined text to determine if it is correct.

A view can be used to ensure referential integrity. Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the statement is incorrect, select the answer choice that makes the statement correct

a)
No change is needed.
b)
Save an extra copy of data stored in a separate table.
c)
Limit access to specific rows or columns of data in a table.
d)
Save historical data before deleting it from the base table.
63.

This question requires that you evaluate the underlined text to determine if it is correct.

In a database table, each column represents a unique record.

Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the statement is incorrect, select the answer choice that makes the statement correct

a)
No change is needed
b)
Table
c)
Index
d)
Row
64.
You have two tables named Salesperson and Sales. You need to ensure that each record in the Sales table has a valid associated salesperson record in the Salesperson table. Which database object should you add to the Sales table?
a)
Nonclustered index
b)
Primary key
c)
Foreign key
d)
Clustered index
65.
You need to add rows to a database table. Which Structured Query Language (SQL) keyword should you use?
a)
JOIN
b)
INSERT
c)
CREATE
d)
UPDATE
66.
You need to retrieve data from two related database tables based on a column that exists in both tables. Which command should you use in a query?
a)
INTERSECT
b)
UNION
c)
JOIN
d)
TRUNCATE
67.

This question requires that you evaluate the underlined text to determine if it is correct. The UNION keyword combines the results of two queries and returns only rows that appear in both result sets. Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the statement is incorrect, select the answer choice that makes the statement correct

a)
No change is needed
b)
INTERSECT
c)
ALL
d)
UNION
68.
You work at a restaurant and they ask you to help them with a data issue. They provide you with the following recipe data: You need to normalize the data to third normal form. How many tables should you create?
a)
1
b)
2
c)
3
d)
4
69.
You accept an IT internship at a local charity. The charity has two tables in their data model named Chapter and Language, as defined below: You create a third table named ChapterLanguage to relate the Chapter table and the Language table. You need to select columns from the Chapter and Language tables to create a composite primary key for the ChapterLanguage table. Which two columns should you select? (Choose two.)
a)
ChapterID
b)
LanguageID
c)
Country
d)
Region
e)
City
70.
You need to delete a database table. Which data definition language (DDL) keyword should you use?
a)
ALTER
b)
DELETE
c)
DROP
d)
TRUNCATE
71.
Your class project requires that you help a charity to create a website that registers volunteers. The website must store the following data about the volunteers: Given name Surname Telephone number Email address You need to recommend a correct way to store the data. What do you recommend?
a)
Create a table that contains columns that are named given name, surname, phone number, and email.
b)
Create a table that contains rows that are named given name, surname, phone number, and email.
c)
Create a view that contains columns that are named given name surname, phone number, and email.
d)
Create a view that contains rows that are named given name surname, phone number, and email
72.

This question requires that you evaluate the underlined text to determine if it is correct. Truncate is a database term used to describe the process of applying a backup to a damaged or corrupt database. Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the statement is incorrect, select the answer choice that makes the statement corrector.

a)

No Change is needed

b)
Commit
c)
Attach
d)
Restore
73.
You accept an IT internship at a local charity. The charity asks you to keep a record of its volunteers by using a database table named Volunteer. When volunteers ask to be removed from mailing lists, the table must be updated. You need to use a transaction to ensure that the database has data integrity and referential integrity. Which statement should you use?
a)
Option A
b)
Option B
c)
Option C
d)
Option D
74.

This question requires that you evaluate the underlined text to determine if it is correct. ALTER TABLE removes all rows from a table without logging the individual row deletions. Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the statement is incorrect, select the answer choice that makes the statement correct.

a)
No change is needed
b)
DROP TABLE
c)
TRUNCATE TABLE
d)
CREATE TABLE
75.

This question requires that you evaluate the underlined text to determine if it is correct. Ports 20 and 21 are the default ports to secure a SQL Server.

Instructions: Review the underlined text. If it makes the statement correct, select "No change is needed." If the statement is incorrect, select the answer choice that makes the statement correct.

a)
No change is needed
b)
1433 and 1434
c)
411 and 412
d)
67 and 68