Extra Notes 2 Flashcards

1
Q

What is necessary to be able to create a foreign key?

A

A primary key or a Unique key on the referenced column.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the steps (in order) to create a table that is partitioned?

A

Create database file partitions and files
Create Partition Function
Create Partition Scheme
Create the table by using partition scheme

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What datatype is generated with encryption?

A

varbinary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can a clustered index include a filter?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an application role?

A

A database principal that enables an application to run with its own, user-like permissions. Can be used with a certificate to ensure that the certificate can only be used in specific parts of the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the steps to create certificate and encryption?

A

CREATE MASTER KEY ENCRYPTION BY PASSWORD = ‘PASSWORD’

CREATE APPLICATION ROLE roleName WITH PASSWORD = ‘PASSWORD’

CREATE CERTIFICATE certificateName AUTHORIZATION roleName WITH SUBJECT = ‘Certificate Subject’

CREATE SYMMETRIC KEY encrypterName WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE certificateName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you minimize the number of page splits on a table?

A

Set FILLFACTOR=85

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the different LOCK ESCALATIONS you can use?

A

AUTO & DISABLED

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is LOCK ESCALATION AUTO?

A

In a partitioned table, you set lock escalation to auto to cause locks to only escalation to the partition level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is LOCK ESCALATION DISABLED?

A

No escalation can occur, which means the system will take many more row or page level locks which consumes more memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can you save the statistics IO of a query?

A

SET STATISTICS XML ON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between WITH RECOMPILE and WITH RECOMPILE AS for a stored procedure?

A

It forces the stored procedure to be recompiled for each execution, regardless if another developer uses WITH RECOMPILE or not. WITH RECOMPILE (no AS) is a one-off.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly