wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ITS_DATABSE #2

Total questions: 145

Worksheet time: 1hrs 14mins

Name
Class
Date
1.

The terms "bitmap," "b-tree," and "hash" refer to which type of database structure?

a)

A. View

b)

B. Function

c)

C. Index

d)

D. Stored procedure

e)

E. Trigger Correct

2.

One reason to add an index is to:

a)

A. Decrease storage space.

b)

B. Increase database security.

c)

C. Improve performance of select statements.

d)

D. Improve performance of insert statements. Correct

3.
a)

A. defragmentation

b)

B. normalization

c)

C. fragmentation

d)

D. denormalization

4.

You have a table that contains the following data.

Which database term is used to describe the relationship between ProductID and ProductCategory?

a)

A. Cohort

b)

B. Relationally dependent

c)

C. Deterministic

d)

D. Functionally dependent

e)

E. Compositional Correct

5.

Which key uniquely identifies a row in a table?

a)

A. foreiqn

b)

B. primary

c)

C. local

d)

D. superkey

6.

Which statement creates a composite key?

a)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

7.

At 3:00 P.M. (1500 hours), you create a backup of your database. At 4:00 P.M. (1600 hours), you create a table named Customer and import data into the table. At 5:00 P.M. (1700 hours), your server fails. You run a script to apply only the 3:00 P.M. backup to your database. What is the result of the script?

a)

A. The Customer table no longer exists.

b)

B. The Customer table is unaffected.

c)

C. The Customer table exists but has no data.

d)

D. The script fails.

8.

In which situation do you need to perform a restore on a database?

a)

A. when data becomes corrupted in the database

b)

B. when you need to roll back a transaction

c)

C. when you encounter an error in your application

d)

D. when data needs to be deleted from the database

9.

Which command should you use to give a user permission to read the data in a table?

a)

A. ALLOW SELECT

b)

B. LET READ

c)

C. PERMIT READ

d)

D. GRANT SELECT Correct

10.

You need to enable a new employee to authenticate to your database. Which command should you use?

a)

A. ALLOW USER

b)

B. CREATE USER

c)

C. ADD USER

d)

D. INSERT USER

e)

E. ALTER USER

11.

Which keyword can be used in a create table statement?

a)

A. ORDER BY

b)

B. DISTINCT

c)

C. GROUP BY

d)

D. UNIQUE .

12.

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)

A. INTEGER

b)

B. DOUBLE

c)

C. COUNT

d)

D. FLOAT

13.

Which statement will result in the creation of an index?

a)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

14.

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)

A. an error stating that NULL values are not allowed

b)

B. a new row in the table

c)

C. an error stating that duplicate IDs are not allowed

d)

D. a syntax error

15.

You need to store product names that vary from three to 30 characters.

You also need to minimize the amount of storage space that is used.

Which data type should you use?

a)

A. VARCHAR (3, 30)

b)

B. CHAR (3, 30)

c)

C. VARCHAR (30)

d)

D. CHAR (30)

16.

One reason to create a stored procedure is to:

a)

A. Improve performance. .

b)

B. Minimize storage space.

c)

C. Bypass case sensitivity requirements.

d)

D. Give the user control of the query logic.

17.

Which permission does a user need in order to run a stored procedure?

a)

A. EXECUTE

b)

B. ALLOW

c)

C. CALL

d)

D. RUN

18.

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)

A. Empty

b)

B. Deleted

c)

C. Unchanged

d)

D. Archived

19.

In SQL, an insert statement is used to add a:

a)

A. User to a database.

b)

B. Row of data to a table.

c)

C. Table to a database.

d)

D. Column to a table definition.

20.

You have two tables. Each table has three rows. How many rows will be included in the Cartesian product of these two tables?

a)

A. 0

b)

B. 3

c)

C. 6

d)

D. 9

21.

You are writing an SQL statement to retrieve rows from a table. Which data manipulation language (DML) command should you use?

a)

A. READ

b)

B. SELECT

c)

C. OUTPUT

d)

D. GET

22.

Which constraint ensures a unique value in the ID column for each customer?

a)

A. DISTINCT

b)

B. FOREIGN KEY

c)

C. SEQUENTIAL

d)

D. PRIMARY KEY

23.

The component that holds information for a single entry in a table is called a:

a)

A. Data type

b)

B. Row

c)

C. Column

d)

D. View

24.

You execute the following statement:

SELECT EmployeeID, FirstName, DepartmentName

FROM Employee, Department ;

This type of operation is called a/an:

a)

A. Intersection

b)

B. Outer join

c)

C. Equi-join

d)

D. Cartesian product

25.

Which command should you use to add a column to an existing table?

a)

A. MODIFY

b)

B. ALTER

c)

C. UPDATE

d)

D. INSERT

e)

E. CHANGE

26.

You have the following table definition:

CREATE TABLE Product

(ID INTEGER PRIMARY KEY,

Name VARCHAR(20),

Quantity INTEGER) ;

The Product table contains the following data. You execute the following statement:

SELECT Name FROM Product WHERE Quantity IS NOT NULL

How many rows are returned?

a)

A. 0

b)

B. 1

c)

C. 2

d)

D. 3

e)

E. 4

27.

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)

A. FIND

b)

B. BETWEEN

c)

C. INCLUDES

d)

D. LIKE

28.

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)

A. The first order for CustomerID 209 is deleted from the Order table.

b)

B. All orders for CustomerID 209 are deleted from the Order table, and CustomerID 209 is deleted from the Customer table.

c)

C. All orders for CustomerID 209 are deleted from the Order table.

d)

D. CustomerID 209 is deleted from the Customer table.

29.

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)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

30.

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)

A. UPDATE

b)

B. CHANGE

c)

C. SELECT

d)

D. INSERT

31.

You need to populate a table named EmployeeCopy with data from an existing table named Employee. Which statement should you use?

a)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

32.

You execute the following statement:

This statement is an example of a/an:

a)

A. Subquery

b)

B. Union

c)

C. Outer join

d)

D. Cartesian product

33.

Which keyword would you use in a select statement to return rows that meet a specific condition?

a)

A. WHERE

b)

B. UNION

c)

C. ORDER BY

d)

D. FROM

34.

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)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

35.

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)

A. 1

b)

B. 2

c)

C. 3

d)

D. 4

36.

Which command should you use to remove a table from a database?

a)

A. REMOVE TABLE .

b)

B. UPDATE TABLE

c)

C. DROP TABLE

d)

D. DELETE TABLE

37.

You need to store the contact information for each student in your school database.

You should store each student's information in a:

a)

A. Stored procedure

b)

B. Function

c)

C. Row

d)

D. Variable

38.

Which category of SQL statements is used to add, remove, and modify database structures?

a)

A. Data access language (DAL)

b)

B. Data manipulation language (DML)

c)

C. Data control language (DCL)

d)

D. Data definition language (DDL)

39.

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)

A. Complete join

b)

B. Partial join

c)

C. Inner join

d)

D. Outer join

40.

Data in a database is stored in:

a)

A. Tables

b)

B. Queries

c)

C. Data types

d)

D. Stored procedures

41.

You have a table named Student that contains 100 rows.

Some of the rows have a NULL value in the FirstName column.

You execute the following statement:

DELETE FROM Student What is the result?

a)

A. All rows in the table will be deleted.

b)

B. All rows containing a NULL value in the FirstName column will be deleted.

c)

C. You will receive an error message.

d)

D. All rows and the table definition will be deleted.

42.

You need to establish a set of permissions that you can routinely assign to new users.

What should you create?

a)

A. Resource

b)

B. Group

c)

C. List

d)

D. Role

43.

Which database term is used to describe the process of applying a backup to a damaged or corrupt database?

a)

A. Recover

b)

B. Restore

c)

C. Commit

d)

D. Attach Correct

44.

Denormalization is performed in order to:

a)

A. Reduce redundancy.

b)

B. Eliminate repeating groups.

c)

C. Create smaller tables.

d)

D. Improve query performance

45.

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. A cursor

b)

B. A subquery

c)

C. A trigger

d)

D. An index

46.

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. a foreign key constraint violation

b)

B. a syntax error

c)

C. a new row in the Product table

d)

D. a primary key constraint violation

e)

E. a new row in the Category table

47.

Which two keys establish a relationship between two tables? (Choose two.)

a)

A. candidate

b)

B. foreign

c)

C. superkey

d)

D. local

e)

E. primary

48.

One difference between a function and a stored procedure is that a function:

a)

A. Must be called from a trigger.

b)

B. Must return a value.

c)

C. Cannot contain a transaction.

d)

D. Cannot accept parameters.

49.

Which keyword must be included in a create view statement?

a)

A. WHERE

b)

B. ORDER BY

c)

C. UPDATE

d)

D. SELECT

50.

You have a table named Customer. You need to add a new column named District.

Which statement should you use?

a)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

51.

You need to remove a view named EmployeeView from your database.

Which statement should you use?

a)

A. DELETE VIEW EmployeeView

b)

B. DELETE EmployeeView

c)

C. DROP EmployeeView

d)

D. DROP VIEW EmployeeView

52.

A named group of SQL statements that can be executed in a database is called a:

a)

A. Subroutine

b)

B. Formula

c)

C. Stored procedure

d)

D. Method

53.

A view can be used to:

a)

A. Save an extra copy of data stored in a separate table.

b)

B. Limit access to specific rows or columns of data in a table.

c)

C. Ensure referential integrity.

d)

D. Save historical data before deleting it from the base table.

54.

On which database structure does an update statement operate?

a)

A. Table

b)

B. User

c)

C. Trigger

d)

D. Role Correct

55.

You need to list the name and price of each product, sorted by price from highest to lowest.

Which statement should you use?

a)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

56.

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)

A. Inherited delete

b)

B. Cascade delete

c)

C. Functional delete

d)

D. Waterfall delete

e)

E. Domino delete

57.

Which statement deletes the rows where the employee's phone number is not entered

a)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

58.

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)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

59.

Your Company stores customer social security numbers in a column SSN in a table named customers . New compliance laws prohibit your company from storing this information. Running the query below causes an error to occur.

ALTER TABLE Customers

REMOVE SSN;

What Changes are needed to the query above so that it removes the SSN column from the customer table.

a)

ALTER TABLE Customers

DELETE SSN;

b)

ALTER TABLE Customers

DROP COLUMN SSN;

c)

ALTER TABLE Customers

DROP SSN;

d)

ALTER TABLE Customers

DELETE COLUMN SSN;

60.

You have a table named Employee that includes four columns.

You execute the following statement:

SELECT * FROM Employee

Which columns are returned?

a)

A. all columns

b)

B. only the last column

c)

C. only the first column

d)

D. only the first and last columns

61.

Which two elements are required to define a column? (Choose two.)

a)

A. A name

b)

B. A key

c)

C. An index

d)

D. A data type

62.

What defines the amount of storage space that is allocated to a value in a column?

a)

A. format

b)

B. key

c)

C. data type

d)

D. validator

63.

You are creating a table to store customer data.

The AccountNumber column uses values that always consist of one letter and four digits.

Which data type should you use for the AccountNumber column?

a)

A. CHAR

b)

B. BYTE

c)

C. DOUBLE

d)

D. SMALLINT

64.

What is one difference between an update statement and a delete statement?

a)

A. An update statement can change only one row.

b)

B. A delete statement cannot use a where clause.

c)

C. An update statement does not remove rows from a table.

d)

D. A delete statement works only within a stored procedure.

65.

You have a Department table and an Employee table in your database.

You need to ensure that an employee can be assigned to only an existing department.

What should you apply to the Employee table?

a)

A. A primary key

b)

B. An index

c)

C. A foreign key

d)

D. A unique constraint

e)

E. A data type

66.

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)

A. 100 items and three cells.

b)

B. 100 rows and three columns.

c)

C. three rows and 100 columns.

d)

D. three items and 100 cells.

67.

What are three valid data manipulation language (DML) commands? (Choose three.)

a)

A. INSERT

b)

B. COMMIT

c)

C. DELETE

d)

D. OUTPUT

e)

E. UPDATE

68.

You assign User1 a set of permissions that include the WITH GRANT OPTION. The WITH GRANT OPTION enables User1 to:

a)

A. request a log of permission use.

b)

B. delegate permissions to other users.

c)

C. create new database users.

d)

D. view other users' permissions.

69.

Which type of index changes the order in which the data is stored in a table?

a)

A. non-sequential

b)

B. sequential

c)

C. non-clustered

d)

D. clustered

70.

Which statement should you use to remove a foreign key?

a)

A. ALTER TABLE

b)

B. DELETE TABLE

c)

C. DELETE FOREIGN KEY

d)

D. ALTER FOREIGN KEY

71.

First normal form requires that a database excludes:

a)

A. Foreign keys

b)

B. Composite keys

c)

C. Duplicate rows

d)

D. Repeating group

72.

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)

A. The table will be corrupted.

b)

B. Forty (40) rows will be deleted from the table.

c)

C. The transaction will restart.

d)

D. No rows will be deleted from the table.

73.

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)

A. SET ProduetName = 'glass'

b)

B. LET ProduetName = 'glass'

c)

C. EXEC ProduetName = 'glass'

d)

D. ASSIGN ProduetName = 'glass

74.

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)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

75.

On which database structure does an insert statement operate?

a)

A. Role

b)

B. Trigger

c)

C. User

d)

D. Stored procedure

e)

E. Table

76.

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)

A. THAT

b)

B. WHERE

c)

C. GROUP BY

d)

D. HAVING

77.

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)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

78.

Instructions: For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point.

a)

YES, NO , NO, YES

b)

YES, NO , YES, YES

c)

NO, NO , NO, YES

d)

YES, YES , NO, YES

79.
a)

client

s01. contoso.com

b)

s01. contoso.com

client

c)

client

www.contoso.com

d)

www.contoso.com

s01. contoso.com

80.
a)

A. 4

b)

B. 5

c)

C. 6

d)

D. 7

81.

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

82.

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.

The table has the following columns and rows:

When volunteer information changes, you must update the table. Y

ou need to change Tia's name to Kimberly.

Which statement should you choose?

a)

SET GivenName = 'Kimberly'

FROM Volunteer

WHERE GivenName = 'Tia"

b)

SET Volunteer

TO GivenName = 'Kimberly'

WHERE GivenName = 'Tia"

c)

UPDATE GivenName = 'Kimberly'

FROM Volunteer

WHERE GivenName = 'Tia"

d)

UPDATE Volunteer SET GivenName = 'Kimberly'

WHERE GivenName = 'Tia"

83.

This question requires that you evaluate the underlined text to determine if it is correct. Use the FROM keyword in a SELECT statement to return rows that meet a specific condition.

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)

A. No change is needed

b)

B. ORDER BY

c)

C. UNION

d)

D. WHERE

84.

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)

A. TRUNCATE

b)

B. JOIN

c)

C. EXCEPT

d)

D. UNION

85.

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)

A. No change is needed

b)

B. DROP TABLE

c)

C. TRUNCATE TABLE

d)

D. ALTER TABLE

86.

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)

A. Primary key

b)

B. Secondary key

c)

C. Foreign key

d)

D. Default key

87.

The following illustration shows the structure of a clustered index in a single partition.

  1. 1. A clustered index improves the performance of queries that [answer choice]

  2. 2. A clustered index improves the performance of queries on column that[answer choice]

Instructions: Select the answer choice that completes each statement Each correct selection is worth one point.

a)

Returns large result set

Are access sequentially

b)

Are access randomly

Returns a range of value by using the = operator

c)

Do not use Order By or Group BY clauses

Are not unique or contain many common values

d)

Returns large result set

Do not use Order By or Group BY clauses

88.
a)

Clustered Index

Non-clustered Index

b)

Foreign Key

Clustered Index

c)

Non-clustered Index

Clustered Index

d)

Foreign Key
Non-clustered Index

89.

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)

A. Foreign key

b)

B. Index key

c)

C. Link key

d)

D. Default key

90.

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)

A. No change is needed.

b)

B. Save an extra copy of data stored in a separate table.

c)

C. Limit access to specific rows or columns of data in a table.

d)

D. Save historical data before deleting it from the base table.

91.

You have a database table that stores information about school attendance.

a)

VARCHAR

INT

DECIMAL

b)

CHAR

INT

DECIMAL

c)

CHAR

BIT

DECIMAL

d)

VARCHAR

INT

DATETIME

92.
a)

NO, YES, YES

b)

NO, NO, YES

c)

YES, YES, YES

d)

YES, YES, NO

93.

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)

A. No change is needed

b)

B. Table

c)

C. Index

d)

D. Row

94.

This question requires that you evaluate the underlined text to determine if it is correct. You have two tables. Each table has three rows. You create a SQL query that uses a cross join. The query does not include a WHERE clause. Nine rows will be included in the Cartesian product of these two 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 corrector.

a)

A. No change is needed

b)

B. Zero

c)

C. Three

d)

D. Six

95.

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)

A. Nonclustered index

b)

B. Primary key

c)

C. Foreign key

d)

D. Clustered index

96.

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)

A. Nonclustered index

b)

B. Primary key

c)

C. Foreign key

d)

D. Clustered index

97.

This question requires that you evaluate the underlined text to determine if it is correct. Use the ALTER statement to add a new table in a 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 correct.

a)

A. No change is needed

b)

B. UPDATE

c)

C. INSERT

d)

D. CREATE

98.

You need to rename a column in a database table. Which data definition language (DDL) statement should you use?

a)

A. ALTER

b)

B. INSERT

c)

C. CREATE

d)

D. UPDATE

99.

This question requires that you evaluate the underlined text to determine if it is correct. Use indexing to create, remove, or change database objects. 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)

A. No change is needed.

b)

B. Data manipulation language (DML) statements

c)

C. Data definition language (DDL) statements

d)

D. A unique constrain

100.

You need to add rows to a database table. Which Structured Query Language (SQL) keyword should you use?

a)

A. JOIN

b)

B. INSERT

c)

C. CREATE

d)

D. UPDATE

101.
a)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

102.

This question requires that you evaluate the underlined text to determine if it is correct. The JOIN 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)

A. No change is needed

b)

B. INTERSECT

c)

C. ALL

d)

D. UNION

103.

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)

A. 1

b)

B. 2

c)

C. 3

d)

D. 4

104.

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)

A. ChapterId

b)

B. LanguageId

c)

C. Country

d)

D. Region

e)

E. City

105.

Instructions: For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point.

a)

NO, YES, YES, NO

b)

YES, YES, NO, NO,

c)

YES, YES, YES, NO,

d)

NO, YES, NO, NO,

106.

This question requires that you evaluate the underlined text to determine if it is correct. You combine data from three tables into one table. The new table includes redundancy to optimize read performance. The data in the new table has been denormalized.

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)

A. No change is needed

b)

B. Normalized

c)

C. Truncated

d)

D. Indexed

107.

This question requires that you evaluate the underlined text to determine if it is correct. Create a query that returns a set of table data by using the UPDATE statement.

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)

A. No change is needed

b)

B. INSERT

c)

C. REPLACE

d)

D. SELECT

108.

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)

A. Create a table that contains columns that are named given name, surname, phone number, and email.

b)

B. Create a table that contains rows that are named given name, surname, phone number, and email.

c)

C. Create a view that contains columns that are named given name surname, phone number, and email.

d)

D. Create a view that contains rows that are named given name surname, phone number, and email

109.

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)

A. Change is needed

b)

B. Commit

c)

C. Attach

d)

D. Restore

110.

This question requires that you evaluate the underlined text to determine if it is correct. Use the ALLOW SELECT command to give a user permission to read the data in a table. 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)

A. No change is needed

b)

B. GRANT SELECT

c)

C. LET HEAD

d)

D. PERMIT READ

111.

You have a user that has server roles as defined below

a)

Unlimited

Unlimited

b)

read only

Unlimited

c)

no

configuration

d)

unlimited

configuration

112.

Instructions: For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point

a)

YES, YES, NO

b)

YES, NO, YES

c)

YES, YES,YES

d)

NO, NO< NO

113.

This question requires that you evaluate the underlined text to determine if it is correct. Views are database objects that contain all of the data in a 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 correct

a)

A. No change is needed

b)

B. Queries

c)

C. Stored procedures

d)

D. Tables

114.

You have two tables named Cars and Color as defined below. The two tables are related by ColorId

a)

A. 0

b)

B. 2

c)

C. 3

d)

D. 6

115.

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)

A. Option A

b)

B. Option B

c)

C. Option C

d)

D. Option D

116.

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)

A. No change is needed

b)

B. DROP TABLE

c)

C. TRUNCATE TABLE

d)

D. CREATE TABLE

117.

You work at a coffee shop. They ask you to set up a website that stores charges on purchases. You need to recommend a data type in a database table to run financial functions against the charged amounts.

Which data type should you recommend?

a)

A. Money

b)

B. Bit

c)

C. Varchar

d)

D. Binary

118.

This question requires that you evaluate the underlined text to determine if it is correct. A row holds information for a single record in a table.

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)

A. No change is needed

b)

B. Column

c)

C. Data type

d)

D. View

119.

Instructions: For each of the following statements, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point.

a)

YES, YES, NO

b)

YES, NO, NO

c)

YES, YES, YES

d)

NO, YES, NO

120.

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)

A. No change is needed

b)

B. 1433 and 1434

c)

C. 411 and 412

d)

D. 67 and 68

121.

You ate creating a database object named Student to store the following data:

Which syntax should you use to create the object?

a)

CREATE TABLE Student(

ID INT,

Name VARCHAR(100),

Age INT);

b)

CREATE (TABLE student(

ID INT,

Name VARCHAR(100),

Age INT)

c)

CREATE student(

ID INT,

Name VARCHAR(100),

Age INT)

d)

CREATE TABLE (

ID INT,

Name VARCHAR(100),

Age INT)

122.

You develop a database to store data about textbooks. The data must be stored to process at a later time. Which database object should you use to store the data?

a)

A. View

b)

B. Table

c)

C. Function

d)

D. Stored procedure

123.

This question requires that you evaluate the underlined text to determine if it is correct. First normal form requires that a database excludes repeating groups.

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)

A. No change is needed.

b)

B. Composite keys

c)

C. Duplicate rows

d)

D. Foreign keys

124.

You have two database tables as defined below. The StateID column is unique in the State table. The AddressID column is unique in the Address table. The two tables are related by the StateID column

a)

Index

Union

b)

Primary Key

Foreign Key

c)

Foreign Key

Primary Key

d)

Primary Key

Inedx

125.

You have the following SQL query

SELECT * FROM dbo.ProAthlete WHERE Salary > 500000

The query takes too much time to return data. You need to improve the performance of the query.

Which item should you add to the Salary column?

a)

A. Non-null constraint

b)

B. Default constraint

c)

C. Index

d)

D. Foreign key

126.

You work for a small auto trading company. You need to remove a car from the company database. Information about the car is stored in the following tables.

All of the car’s parts are custom made, so they each have a row in every table. Cascading deletes are not enabled but referential integrity is. From which table must you first make your deletion?

a)

A. Make

b)

B. Model

c)

C. Engine

d)

D. ModelEngine

127.

You have a table that contains information about all students in your school. You use the INSERT SQL keyword to change a student’s given name in the table. 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)

A. CHANGE

b)

B. UPDATE

c)

C. No change needed

d)

D. SELECT

128.

You create the following table, which lists how many books you have on loan to your friends

Harry in San Francisco returns your books.

Which statement will update your table correctly?

a)

UPDATE LoanedBooks SET Books = 0 WHERE (Name = 'Harry' AND City = 'San Francisco')

b)

UPDATE LoanedBooks SET Books = 0 WHERE (Name = 'Harry' OR City = 'San Francisco')

c)

UPDATE LoanedBooks SET Books = 0 WHERE (Name in 'Harry', 'San Francisco')

d)

INSERT INTO LoanedBooks SET Books = 0 WHERE ID =6

129.

You are developing a SQL query. Which two SQL constructs represent data manipulation language (DML) statements? Choose two.

a)

SELECT EmployeeName FROM Employee WHERE EmployeeName = 'Jack Smith'

b)

INSERT INTO Employee VALUES ('Jack Smith')

c)

ALTER TABLE Employee ADD EmployeeName Varchar;

d)

D. CREATE ROW IN Employee WHERE EmployeeName = 'Jack Smith';

130.

You need to create a view to filter rows of data from an underling table. Which type of clause must be included in the CREATE VIEW statement?

a)

A. CONSTRAINT

b)

B. WHERE

c)

C. JOIN

d)

D. FILTER

131.

This question requires that you evaluate the underlined text to determine if it is correct. A key defines the amount of storage space that is allocated to a value in a column.

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)

A. No change is needed

b)

B. format

c)

C. data type

d)

D. validator

132.

This question requires that you evaluate the underlined text to determine if it is correct. A relational database management system employs the concept of an attribute to ensure that data entered into a field in a column is valid.

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)

A. No change is needed

b)

B. a primary key

c)

C. a constraint

d)

D. an index

133.

You are structuring a table in a relational database.

Instructions: For each of the following statement, select Yes if the statement is true. Otherwise, select No. Each correct selection is worth one point.

a)

NO, YES, NO

b)

YES, YES, YES

c)

NO, YES, YES

d)

YES, YES, NO

134.

You have a database that contains 10 terabytes of data. You need to back up the database every two hours. Which type of backup should you use?

a)

A. archive

b)

B. incremental

c)

C. partial

d)

D. full

135.

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)

A. No change is needed

b)

B. INTERSECT

c)

C. ALL

d)

D. JOIN

136.

Which query correctly returns a result set for all orders where the ship_state exclude Texas (TX) and Arizona(AZ)?

a)

SELECT * FROM orders WHERE NOT ship_state = 'TX' OR ship_state NOT = 'AZ';

b)

SELECT * FROM orders WHERE NOT ship_state = 'TX' OR ship_state NOT = 'AZ';

c)

SELECT * FROM orders WHERE ship_state NOT = 'TX' AND ship_state NOT = 'AZ';

d)

SELECT * FROM orders WHERE NOT ship_state = 'TX' AND NOT ship_state = 'AZ';

137.

You need to create data in the student's table. The report must meet the following requirements:

  1. 1. Display the students who enrolled on or after Januray 1,2020

  2. 2. Display all students who graduated in 2020

  3. 3. Return the result set in order of enrollment with the most recent enrollment date first.

  4. enrollment_date specifies the enrollment date, graduation_date specifies the graduation date. An academic_status of Graduated indicates that a student has graduated.

a)

SELECT *

FROM students

WHERE enrollment_date >= '2020-01-01'

AND academic_status = 'Graduated' OR graduation_date >= '2020,01,01';

ORDER BY enrollment_date ;

b)

SELECT *

FROM students

WHERE enrollment_date >= '2020-01-01'

OR academic_status = 'Graduated' OR graduation_date >= '2020,01,01';

ORDER BY enrollment_date DESC;

c)

SELECT *

FROM students

WHERE enrollment_date >= '2020-01-01'

OR academic_status = 'Graduated' AND graduation_date >= '2020,01,01';

ORDER BY enrollment_date DESC;

d)

SELECT *

FROM students

WHERE enrollment_date >= '2020-01-01'

AND academic_status = 'Graduated' AND graduation_date >= '2020,01,01';

ORDER BY enrollment_date ASC;

138.

You have a table named Customer that has columns named CustomerID, FirstName and DateJoined. CustomerID is the primary key.

You execute the following query

SELECT CustomerID, FirstName , DateJoined

FROM Customer

How are the rows organized in the result set?

a)

A. in alphabetical order by FirstName

b)

B. in no predictable order

c)

C. in the order in which the rows were inserted

d)

D. in chronological order by DataeJoined.

139.

The products table contains the following data.

Which query will increase the price of item 1 by 6 percent?

a)

SET Price = Price * 1.06

FROM Products

WHERE itemNumber = 1

b)

USE Prodcuts

SET Price = Price * 1.06

FROM Products

WHERE itemNumber = 1

c)

ALTER Products

SET Price = Price * 1.06

FROM Products

WHERE itemNumber = 1

d)

UPDATE Products

SET Price = Price * 1.06

FROM Products

WHERE itemNumber = 1

140.

You have a table named product that contains million of rows. You need to search for product information using the following query:

SELECT ProductName, Price FROM Product WHERE Category = 'Science Books';

What will make this search more efficient?

a)

A. A clustered index on the Price column

b)

B. A non-clustered index on the Category column

c)

C. A clustered index on the ProductName column

d)

A non-clustered index on the Price column

141.

The customers table includes the following data

You need to create a query that returns a result set contains the LastName, PhoneNumber and Extension for extensions that are valid numbers. The result set should be sorted by the LastLame.

a)

SELECT LastName, PhoneNumber, Extension

FROM customers WHERE PhoneNumber IS NOT NULL

ORDER BY LastName

b)

SELECT LastName, PhoneNumber, Extension

FROM customers WHERE PhoneNumber IS NULL

ORDER BY LastName

c)

SELECT LastName, PhoneNumber, Extension

FROM customers WHERE Extension IS NOT NULL

ORDER BY LastName

d)

SELECT LastName, PhoneNumber, Extension

FROM customers WHERE Extension IS NOT NULL

SORTED BY LastName

142.

A table named playerStat contains the following fields.

You need to display the number of points per player on the team whose ID is 1.

a)

SELECT PlayerID, SUM(Points)

FROM PlayerStat

WHERE TeamID = 1

GROUP BY PlayerID;

b)

SELECT PlayerID, TeamID

FROM PlayerStat

WHERE TeamID = 1

GROUP BY SUM(Points);

c)

SELECT PlayerID, TeamID

FROM PlayerStat

WHERE TeamID = 1

d)

SELECT PlayerID, TeamID

FROM PlayerStat

HAVING SUM(Points);

143.

The following table named Building stores data about buildings and their most recent inspection dates.

The address filed stores the building's address, the InspectionDate stores the most recent inspection date . A value of NULL in the InspectionDate means a building has not yet been inspected.

You need to display the addresses of the earliest 10 buildings that have been inspected.

a)

SELECT TOP 10 Address

FROM Building

WHERE InspectionDate IS NOT NULL

ORDER BY InspectionDate;

b)

SELECT TOP 10 Address

FROM Building

WHERE InspectionDate IS NOT NULL

GROUP BY InspectionDate;

c)

SELECT TOP 10 Address

FROM Building

WHERE InspectionDate IS NOT NULL ;

d)

SELECT TOP 10 Address

FROM Building

HAVING InspectionDate IS NOT NULL ;

144.

You create the following query to determine whether Sample Movie appear only once in the Movie table.

SELECT Title FROM Movie

WHERE Title = 'Sample Movie'

ORDER BY Title

GROUP BY Title

HAVING COUNT(*) =1;

When you run this query, it returns a syntax error.

You need to modify the query to run without error and return accurate results.

What should you do?

a)

Change the Having clause to Having COUNT(Title) = 1

b)

Change the Having clause to Having COUNT(1) = 1

c)

Remove the GROUP BY clause

d)

Remove the ORDER BY clause

145.

Which SQL statement will return the country and number of orders in each country where the number of orders if less than 50?

orderID represents an individual order, Country represents the country and Orders represents the number of orders.

a)

SELECT Country, orderID

FROM Orders

WHERE COUNT(orderID) < 50

GROUP BY Country;

b)

SELECT COUNT(orderID) Country,

FROM Orders

HAVING COUNT(orderID) < 50

GROUP BY Country;

c)

SELECT COUNT(orderID) Country,

FROM Orders

GROUP BY Country

HAVING COUNT(orderID) < 50

d)

SELECT Country, orderID

FROM Orders

WHERE COUNT(orderID) < 50