SQL Flashcards

(63 cards)

1
Q

Cache

A

d

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

Checkpoint

A

d

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

Universal No Lock

A

SET TRANSACTION LEVEL READ COMMITED

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

Json

A

Identifies data types auto

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

OLAP Cube

A

Pre-groups to save time.

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

Normalization

A

d

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

Entity

A

Tables

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

Attributes

A

Columns

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

Primary Key

A

Unique value per row. Can be made up of multiple columns (composite) key. Functions as a target which a foreign key can reference.

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

Candidate Key

A

Possible primary keys.

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

Surrogate Keys

A

Alternate primary keys that can be used to check the validity of primary key.

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

Dependency

A

Columns retrievable by key? In order to lookup a value, you have to know the key first.

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

Denormalization

A

SAMS vs RAD

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

Duplication

A

Attribute unnecessarily repeated. (SAMS and RAD duplication.)

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

Fact Table

A

d

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

Dimension Table

A

d

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

Forms

A

Every attribute must provide a fact about the key, the whole key, and nothing but they key, so help me Codd.

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

1st Normal Form

A

No repeating columns.

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

2nd Normal Form

A

Non-key columns shouldn’t be dependent on a part of the primary key.

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

3rd Normal Form

A

All fields must only depend on a key. (3NF)

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

Overnormalization

A

d

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

String Values

A

Larger because there are way more than 9(10?) values per character.

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

1 Byte

A

0 to 255 (8 bit)

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

2 Byte

A

+-30,000 (smallint)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
4? Byte
+- 2,000,000,000 (int) (32 bit)
26
8? Byte
bigint (64 bit)
27
Fixed Precision
Decimal/Numeric. More costly. More precise/accurate than float.
28
Scale (Data)
Number of decimal places (123.123 = 3)
29
Floating Point Number
Efficient, but lose accuracy.
30
GUID
Global Unique ID
31
Parse()
Convert strings to dates.
32
Try\_Cast()
Same as Cast, but generates nulls for errors. (Cast/Convert/Parse)
33
Schema
Groupings of objects (tables). Can grants permissions based on schemas.
34
Use full object name.
Servicer/Database/Schema/Object. Improves performance because SQL doesn't have to figure out.
35
Persisted
SQL Function
36
Exists
Returns True/False
37
Data Integrity
d
38
Domain Integrity
Integrity within column (consistent data type, nullable, add rules(1:10), prior to x date)
39
Entity Integrity
Looks across columns. Uniqueness.
40
Referential Integrity
(Order for employee that doesn't exist)
41
Default Value For Data Integrity
k today(), getdate()
42
Uniqueness Constraint
Generally covered by primary key, but could also be valid for surrogate keys.
43
Referential Enforcement
Cascade :Deletes all children when parent is deleted. Set Default: Catch all value when parent gets deleted. set null
44
CREATE SEQUENCE
D
45
Insert Into With Select
Insert Into Select \* FROM WHERE
46
Table Scan
Scans entire table contents.
47
Leaf Level (Index)
All the data.
48
Why not index everything?
Indexes have to be updated every time table changes.
49
Clustered Index
Pyramid
50
Selectivity(Index)
By how much does the field reduce the values to be searched.
51
Density(Index)
Uniqueness
52
Depth(Index)
d
53
Windowed Functions Syntax
Function() Over (Partition By x,y,z Order By a,b,c,x,y,z)
54
Foreign Key
Links to the primary key of another table.
55
Connect to Python
import pyodbc conn = pyodbc.connect('Driver={SQL Server};' 'Server=he2qntvpsql382;' 'Database=MHASAMS01PDB;' 'Trusted\_Connection=yes;') cursor = conn.cursor() cursor.execute('SELECT Organization FROM MHASAMS01PDB.ra.OrgLookup') for row in cursor: print(row)
56
Scoping
D
57
OLTP
Online Transaction Processing Typically facilitate and manage transaction-oriented (UPDATE, INSERT, DELETE, ALTER) applications vs analytical (OLAP).
58
ACID
Atomicity - Guarantees that each transaction is treated as a single "unit", which either succeeds completely, or fails completely. Consistency - Ensures that a transaction can only bring the database from one valid state to another (transaction follows constraints, cascades, triggers, etc...) Isolation - Running transactions simultaneously produces the same outcome as running them sequentially. Durability - Once a transaction has been committed, it will remain committed. (Recorded in non-volatile memory).
59
Transaction(db)
A sequence of database operations that satisfies the ACID properties (can be perceived as a single logical operation on the data).
60
OLAP
Online Analytical Processing Optimized for read only. Good for analytics.
61
ODS
Operational Data Store
62
EDW
Enterprise Data Warehouse
63
EDH
Enterprise Data Hub