SQL Flashcards

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
Q

4? Byte

A

+- 2,000,000,000 (int) (32 bit)

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

8? Byte

A

bigint (64 bit)

27
Q

Fixed Precision

A

Decimal/Numeric. More costly. More precise/accurate than float.

28
Q

Scale (Data)

A

Number of decimal places (123.123 = 3)

29
Q

Floating Point Number

A

Efficient, but lose accuracy.

30
Q

GUID

A

Global Unique ID

31
Q

Parse()

A

Convert strings to dates.

32
Q

Try_Cast()

A

Same as Cast, but generates nulls for errors. (Cast/Convert/Parse)

33
Q

Schema

A

Groupings of objects (tables). Can grants permissions based on schemas.

34
Q

Use full object name.

A

Servicer/Database/Schema/Object. Improves performance because SQL doesn’t have to figure out.

35
Q

Persisted

A

SQL Function

36
Q

Exists

A

Returns True/False

37
Q

Data Integrity

A

d

38
Q

Domain Integrity

A

Integrity within column (consistent data type, nullable, add rules(1:10), prior to x date)

39
Q

Entity Integrity

A

Looks across columns. Uniqueness.

40
Q

Referential Integrity

A

(Order for employee that doesn’t exist)

41
Q

Default Value For Data Integrity

A

k today(), getdate()

42
Q

Uniqueness Constraint

A

Generally covered by primary key, but could also be valid for surrogate keys.

43
Q

Referential Enforcement

A

Cascade :Deletes all children when parent is deleted. Set Default: Catch all value when parent gets deleted. set null

44
Q

CREATE SEQUENCE

A

D

45
Q

Insert Into With Select

A

Insert Into Select * FROM WHERE

46
Q

Table Scan

A

Scans entire table contents.

47
Q

Leaf Level (Index)

A

All the data.

48
Q

Why not index everything?

A

Indexes have to be updated every time table changes.

49
Q

Clustered Index

A

Pyramid

50
Q

Selectivity(Index)

A

By how much does the field reduce the values to be searched.

51
Q

Density(Index)

A

Uniqueness

52
Q

Depth(Index)

A

d

53
Q

Windowed Functions Syntax

A

Function() Over (Partition By x,y,z Order By a,b,c,x,y,z)

54
Q

Foreign Key

A

Links to the primary key of another table.

55
Q

Connect to Python

A

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
Q

Scoping

A

D

57
Q

OLTP

A

Online Transaction Processing Typically facilitate and manage transaction-oriented (UPDATE, INSERT, DELETE, ALTER) applications vs analytical (OLAP).

58
Q

ACID

A

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
Q

Transaction(db)

A

A sequence of database operations that satisfies the ACID properties (can be perceived as a single logical operation on the data).

60
Q

OLAP

A

Online Analytical Processing Optimized for read only. Good for analytics.

61
Q

ODS

A

Operational Data Store

62
Q

EDW

A

Enterprise Data Warehouse

63
Q

EDH

A

Enterprise Data Hub