wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Database

Total questions: 64

Worksheet time: 2hrs 35mins

Name
Class
Date
1.

SQL Categories:The Data Manipulation Language (DML) is NOT all about the rows in the table

a)

True

b)

False

c)

...

d)

...

2.

Create Table:Which of the following are typically found on a separate line (or separated by a comma) when creating the table

Note: Multiple answers may apply

a)

The 3-part column definition

b)

A table constraint for the Primary Key

c)

A column "constraint" like Identity or Default

d)

A table constraint for the Foreign Key

3.

Drop vs. Truncate:

When used on a table, what's the difference between the Drop and Truncate statements

4 lines
4.

Create Table:

Create an SQL statement that will create the table from this following relational notation

Note: Include the 3-part column notation and PK

Inventory (PartNumber, Description)

4 lines
5.

Identity:

The "Identity" keyword is used to designate that this column is a Primary Key

a)

True

b)

False

c)

k

d)

k

6.

Constraint Actions:

Consider an scenario where the FK constraint is using the "No Action" option. Describe what happens if you attempt to insert data into a child table without having a matching column in the parent

4 lines
7.

Cascade:

Consider a typical 1:M relationship with a foreign key constraint that has "on delete cascade". Describe what happens if you delete a row on the "1" side that has matching rows on the "M" side

4 lines
8.

Autonumber:

It is not considered good practice to use the autonumber/synthetic/surrogate feature on a Foreign Key

a)

True

b)

False

c)

l

d)

l

9.

Create Default:

Create an SQL statement that will create the table from the following relational notation. Include a default with the value of TX for the State

Customer (CustID, City, State)

4 lines
10.

Create Column Constraint:

Create an SQL statement that will create the table from this following relational notation. Include a constraint to make sure the value for grade is not below 0 or greater than 100

Grades (StudentID, QuizNum, Grade)

4 lines
11.

Constraints:

After a table has been built, you can not alter the table to add or remove a constraint

a)

True

b)

False

c)

k

d)

k

12.

Insert Statement:

Create an SQL statement to insert the following information into the table described below

Customer (CustID, Name)

4 lines
13.

Multiple Inserts:

When inserting multiple rows of data with a single insert statement, you only need to use the Values statement once

a)

True

b)

False

c)

k

d)

k

14.

Insert Shortcuts:

When using the Insert statement, you are allowed to skip the "column clause" under which of the following circumstances

Note: Multiple answers may apply

a)

There are no Surrogate columns

b)

When there are multiple column/value pairs

c)

The number of values exactly matches the number of columns

d)

The values are in the same order as the columns

15.

Update Statement:

Describe what happens if you forget to use the Where clause. For example, with this statement (that does have a Where)

Update Employee set DeptID=10 Where EmpID=12

4 lines
16.

Deleting Rows:

What was the practical guidance for configuring a table so you won't have to delete any rows

4 lines
17.

Views:

Consider the scenario where you created a View called vEmp. You would typically use this view in an SQL statement where the view appears "as if" it was a table.

For example:

Select * from vEmp

a)

True

b)

False

c)

k

d)

k

18.

View vs. Function:

According to lecture, what is the major feature difference between a View and a table Function

4 lines
19.

DML statements

Which of the following DML statements appear to be using the correct syntax

Note: Multiple answers may apply

a)

Update EmployeeSet Dept='Engineering'Where EmpID=1234

b)

Delete from Employeewhere EmpID=1234

c)

Drop from Employeewhere EmpID=1234

d)

Truncate from Employeewhere EmpID=1234

20.

Index:

Explain why the performance of the Insert command is not influenced by the creation of an index

4 lines
21.

Database Redesign:

According to lecture, which of the following are the common reasons for performing a database redesign

Note: Multiple answers may apply

a)

You merged with another company and you need to merge your data

b)

You need to address some long-term database issues

c)

You are migrating to a new database product

d)

You want to gather some statistics on the performance of your database

22.

Correlated Subquery:

Describe in your own words how a correlated subquery is different from a normal subquery.

Note: I'm not asking for a definition. Read the question!

4 lines
23.

Diagram vs. Logical Design:

What parts of a logical design are not in evidence when looking at an SQL Server Management Studio's "Database Diagram"

Note: Multiple answers may apply

a)

The table names

b)

The candidate keys

c)

The column properties (data type, null vs not null)

d)

Some of the cardinality items

24.

Use of Dependency Graph:

Which of the following is the best reason for looking at the Dependency Graph of an existing database before populating the database with data

Note: I'm not talking about the Database Diagram

a)

To be able to see the foreign key relationships

b)

To be able to tell which tables need to be filled first

c)

To be able to see the maximum cardinality

d)

To be able to spot errors in cardinality

25.

Rename Table:

When renaming a table via the Microsoft SQL Server Management Studio, the system will automatically find and update all of the views, functions, and stored procedures in the database to that table with the new name

a)

True

b)

False

c)

l

d)

l

26.

Change Identity

You can use the "Alter Table/Alter Column" technique to add an "Identity" to an existing column

a)

T

b)

F

27.

Defaults:

In Microsoft SQL Server, if you add a new column with a default constraint to an existing table (with existing data), all of the rows will be automatically populated with the default value for that column only if the column is also marked NOT NULL

a)

True

b)

False

28.

Add a Not Null Column:

What are the steps to add a new column to an existing table (with existing data) that has a "not null" column constraint

4 lines
29.

Drop Column:

To drop a column that is part of a key you must first remove the constraints that apply to that key

a)

True

b)

False

30.

Data Conversion:

Changing the data type of a column from an integer to a string will automatically perform a data type conversion (provided there are no errors)

a)

True

b)

False

31.

Configuration Control

Describe the fundamental purpose for using a "configuration control board" before making change to a databaseNote: Purpose != What it does

4 lines
32.

The best practices for solving a concurrency issue is to temporarily put a lock on the entire database

a)

True

b)

False

33.

Explain the significance of having an "atomic transaction" in a financial system (for example transferring money from one account to another)

Note: I'm not asking for a definition

4 lines
34.

Which of the following statements about locks are true

Note: Multiple answers may apply

a)

Explicit locks use the "concurrent" keyword

b)

Implicit locks require that you provide a "hint" as to your intentions

c)

The granularity of the lock should be at the smallest point that provides the required protection

d)

If there is an exclusive lock, no other user can gain access to that resource

e)

If there is a shared lock, other users can read (but not write) to that resource

35.

Pessimistic Concurrency does a better job of protecting the database than Optimistic Concurrency

a)

True

b)

False

36.

Atomic:

What SQL keyword makes sure that a group of statements is executed together a single "atomic" statement

  Lock

a)

Lock

b)

With

c)

Transaction

d)

Kumquat

37.

Describe why you should always set permissions by role (or group) rather than to individual users

4 lines
38.

The issue of allowing a user to edit their own Employee record (but not be able to see other people's records) can be accomplished using just DCL statements

a)

True

b)

False

39.

Describe the cartoon that was used in lecture to describe a SQL Injection attack

4 lines
40.

Backup vs. Recovery

Describe why nobody cares how long it takes to do a backup

4 lines
41.

SQL Server:

Which of the following are true of SQL Server 2019Note: Multiple answers may apply

a)

There is a Linux version

b)

It is 64 bit only

c)

It is supported on Windows 7

d)

It comes bundled with the SQL Server Management Studio (so you don't have to download it separately)

42.

Microsoft Azure:

In a traditional Azure SQL Database, the administrator does not have control over the database instance

a)

True

b)

False

43.

Server Instance:

A single windows server can have multiple SQL Server instances

a)

True

b)

False

44.

Hierarchy:

Put the following items of the data hierarchy in the proper order (starting with the top of the pyramid)

a)

Cluster, SQL Server Instance, Database, Table, Rows

b)

SQL Server Instance, Cluster, Database, Tables, Rows,

c)

SQL Server Instance, Cluster, Database, Rows, Tables

d)

Cluster, SQL Server Instance, Database, Rows, Tables

45.

Authentication:

Describe a scenario where you must use SQL Authentication (instead of Windows Authentication)

4 lines
46.

SSMS Current Database:

Using the SQL Server Management Studio, how can you tell which database that you're currently "talking to"

4 lines
47.

Logins, Users, and Roles:

Which of following statements are true about Logins, Users, and Roles

Note: Multiple answers may apply

a)

Logins are stored in the service instance

b)

Users are stored in the database

c)

A single service instance can have many identical logins

d)

A single database can have many identical users

e)

A single database user can have many roles

48.

Backup Types:

Which of the following are the correct types of backups for Microsoft SQL Server

Note: Multiple answers may apply

a)

Full

b)

Differential

c)

Incremental

d)

Log

e)

Image

49.

Full Backup:

A Full backup includes information from both the data "file" and the entire "log" file

a)

True

b)

False

50.

Backup Location:

Explain why the default location for the backups is not ideal

4 lines
51.

What recovery model is best for a temporary database

a)

Simple

b)

Full

c)

Bulk Logged

d)

Complex

52.

What recovery model is best for a read only database

a)

Simple

b)

Full

c)

Bulk Logged

d)

Complex

53.

I can recover to the point of the last database backup

a)

Simple

b)

Full

c)

Bulk Logged

d)

Complex

54.

I can recover to the point of the last log backup

a)

Simple

b)

Full

c)

Bulk Logged

d)

Complex

55.

I can recover to any point in time covered by a log backup

a)

Simple

b)

Full

c)

Bulk Logged

d)

Complex

56.

What action is required for the database log files to "roll over"

a)

Log Backup

b)

Full Backup

c)

Partial Backup

d)

Simple Backup

57.

Maintenance Plans:

The scheduled maintenance plans in SQL Server can be viewed in the Windows Task Scheduler

a)

True

b)

False

58.

SQL Server File Extensions:

What is the file extension of the Data file used by SQL Server

(a)  

59.

Copy Database Files:

Which of the following are true about your ability to copy the physical database files during normal operations

Note: Multiple answers may apply

a)

When the service is running, the files are locked for all "attached" databases

b)

You need administrator rights, since the folder is not accessible to ordinary users

c)

The database administrator can copy the files without changing permissions

d)

The SQL server administrator can copy the files without changing permissions

60.

Clustered Index:

What is the "side effect" of using a Clustered index over an non-clustered index

4 lines
61.

Explain why it is discouraged that you manually "tune" the indexes

4 lines
62.

Index Location:

Which of the following is where you'd find the indexes for Cape_Codd's Inventory table?

a)

Under Databases->Cape_Codd->Indexes

b)

Under Databases->Cape_Codd->Tables->Indexes

c)

Under Databases->Cape_Codd->Tables->dbo.Inventory->Indexes

d)

Under Databases->Cape_Codd->Storage->Indexes

e)

None of the above

63.

Index Effects:

Which of the following DML statements will rarely (if ever) benefit from using an index

a)

Select

b)

Update

c)

Delete

d)

Insert

64.

Current Configuration:

What is the command that was used in lecture to view the current database's configuration (like language or isolation level)

(a)