1.5 DataBases GMETRIX

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/58

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

59 Terms

1
New cards

Entity Relationship Dia

Entities represent tables in a database

Attributes represent entity properties

Relationship are a vital part of an ERD as they show how entities relate to each other

2
New cards

Database Normalization

the process of organizing the attributes and tables of a relational database to minimize data redundancy

3
New cards

First Normal Form (1NF)

each field has a single value and each record is unique

4
New cards

Second Normal Form (2NF)

unmatched data is moved into another table and related to original table

5
New cards

Third Normal Form (3NF)

the prefizes would need to be broken out into another table as there could be duplicate values in the PREFIX field

6
New cards

Fourth Normal Form (4NF)

there are no multi-valued dependencies from one table to another

7
New cards

Indexing

Fields that are often used as criteria in queries should be considered for indexing as having tables indexed by those fields can make queries using those fields run faster.

Indexig is not usually based data type, length or field, or whether a field is a foreign key

8
New cards

Primary Keys

Ensures each record in a table in unique

Can consist of multiple fields

The key value cannot be null

9
New cards

Foreign Keys

Represents the many side of a one-to-many relationship

Can contains duplicate values unless it serves as the primary key for the table in which it resides

10
New cards

Referential Integrity

Ensures a value on a one side of a one-to-many relationship exists before the value can exist on the many side of a relationship

11
New cards

CHECK constraint

puts a limitation on the info that can be entered into a data field

CHECK (InterviewDate>=GETDATE())

12
New cards

DEFAULT

sets a default value for the field

13
New cards

GETDATE()

IN SQL Server is today's date

14
New cards

ItemID and Price fields

need to be broken out into another table with the ItemID staying in this table because the Price has a transitive dependency on the ItemID, meaning that if an ItemID is changed, the price has to be changed as well

15
New cards

Data Definition Language (DDL)

keywords control a database schema

16
New cards

CREATE

is a DDL keyword because it adds an object to a database

17
New cards

SELECT

a Data Manipulation Language (DML) keyword

18
New cards

VIEW

is an object

19
New cards

WHERE

serves as a conditional filter for a query

20
New cards

Records with that have an matching OrderIDs in both tables

The query is an inner order between the Orders and the OrderDetails tables, so only the records that have an OrderID appearing in both tables will display the query results

21
New cards

CREATE NONCLUSTERED INDEX NDX_Inventory_LocationID ON Inventory (LocationID);

A non-clustered index uses key-values to point to data rows, thus speeding up searches on fields that aren't primary key fields. An index is created on the table with the field being indexed inside parentheses. Thus, the correct code for this index is as follows:

CREATE NONCLUSTERED INDEX NDX_Inventory_LocationID ON Inventory (LocationID);

22
New cards

SELECT id, datePlaced, amount FROM Order

The retrieve only the id, datePlaced, and amount

23
New cards

UPDATE Inventory SET Location = 'San Jose' WHERE Location = 'Fremont'

In SQL, an UPDATE statement updates data using the keyword SET on a field inside the table. The WHERE clause sets the criteria for the values that need to be updated.

24
New cards

SELECT * FROM Product ORDER BY productName, id

In order to retrieve all the data from the table, you can use the asterisk * symbol

25
New cards

Relational Data Format

Is present in a SQL Server Database

26
New cards

SQL Server

is a relational database engine

27
New cards

Excel

builds flat files

28
New cards

Azure COSMOS DB

a schema-free database engine that stores data in key-value pairs

29
New cards

TRIGGER

enforces a business role by taking action on an insert, update, or delete

30
New cards

Stored Procedures, Functions, and Cursors

Are not based on actions

31
New cards

CURSOR

looks through and processes data on row-by-row basis

32
New cards

GOTO

goes to a specific block of code

33
New cards

WAITFOR

blocks execution of code until a certain time or for a certain amount of time

34
New cards

Data Manipulation Language (DML)

these keywords change data, but not the structure of it

ex. INSERT, DELETE

35
New cards

CREATE/DROP

are DDL keywords, where those keywords create and delete database objects such as tables and views

36
New cards

EXEC PROCEDURE selectshoes 'Kicks'

EXEC PROCEDURE selectshoes @brand = 'Kicks'

The EXEC command runs a stored procedure

A parameter can be specified by name, or with just the value following the order of the parameters within the stored procedures.

Thus, the EXEC PROCEDURE selectShoes @brand = 'Kicks and EXEC PROCEDURE selectShoes 'Kicks' both work.

Parameter values don't need to include parameters

37
New cards

CREATE PROCEDURE selectShoes @brand nvarchar(20) AS SELECT * FROM Shoes WHERE ShoeBrand = @brand;

The CREATE PROCEDURE keywords add a new stored procedure to a database. ADD adds pieces to existing objects. EXEC executes a stored procedure that has already been created

38
New cards

Scalar Functions

return a single value only

39
New cards

Table-Value Function

returns several fields of data

40
New cards

Multi-Value Function

41
New cards

Transaction Pieces

An Exclusive Lock helps provide concurrency to transactions

When a transaction is committed, all changes made within it take place

The SAVE TRANSACTION command defines at what point to which a transaction can return if part of the transaction is conditionally canceled.

42
New cards

Serializable transaction level

ensures other transactions with key-value pairs in the range of keys read by a current transaction are not processed until the current transaction completes

43
New cards

Snapshot transaction level

allows other transactions to make modifications

44
New cards

Repeatable Read transaction level

specifies statements that cannot read data that has been modified but not committed by other transactions but doesn't protect key values

45
New cards

Read Committed transaction level

specifies that data has been modified but not committed cannot be read

46
New cards

Transaction

combines multiple statements into one atomic action

cane be rolled back before it is committed

can contain select, insert, update, delete, create, and exec statements

47
New cards

Transaction Isolation Levels: Read Committed, Read Uncommitted

Allows two transactions to retrieve the same row in a database simultaneously

48
New cards

Connection Pooling: Pooler

maintains ownership of the physical connection and manages database connections

49
New cards

Connection Pooling: Server

50
New cards

Connection Pooling: Web Service

51
New cards

Connection Pooling: Data Manager

52
New cards

Language Integrated Query (LNQ)

a technology in which SQL code can be used inside of a programming language, such as C#, to retrieve data from a database

53
New cards

Document Database

is best suited for data that lacks consistent structure

54
New cards

Key-Value Database

stores data in key-value pairs

55
New cards

Relational Database

requires tables with set columns

56
New cards

Flat Database

a single large table with set columns

57
New cards

Key-Value Database

Allow for horizontal scaling of data

Its rows can have varying numbers of atttributes

Even though they aren't operational, they still use primary keys

58
New cards

NoSQL Databases:Document & Key-Value

Are both prominent NoSQL databases

59
New cards

Relational Databases

are more SQL oriented