Test 3 Flashcards

1
Q

First normal form

A

Each value must be scalar and no repeating columns

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

2nd normal form

A

Every non key column must depend on the primary key

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

3rd normal form

A

every non key column must depend only on the primary key. (considered good design)

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

What would violate referential integrity.

A

Deleting a row from a primary key table, inserting a row into a foreign key, update value of foreign key, update value of primary key or foreign key

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

Ch 8 datatypes, what datatypes will store whole numbers, character.

A

Integer-whole numbers. Decimal- decimal numbers. Char-fixed string length. Varchar-max string length.. Datetime-exact date(millisecond). smalldatetime-date (minute). Date-date

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

Relationships one to one, one to many, many to many.

A

One to many is most common

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

What is used after Create database

A

Go

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

What is a constraint?

A

A way to filter what data goes through.

(inline) InvoiceTotal MONEY NOT NULL CHECK(InvoiceTotal >= 0)

(bottom) CHECK (InvoiceTotal >= 0)

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

Keyword for constraint on a column?

A

Check keyword

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

Customer order has to refer to Customer, what do you use?

A

A join/ foreign key

A referenced table must be made before a table can reference it.

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

Where do records come from?

A

tables

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

When planning the database, 100 east main street sc how do separate.

A

Street name, city, state, number

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

What do CAST and CONVERT do?

A

Cast changes one data type to another. Convert does the same thing but more complex.

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

Date function

A

GETDATE()

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

Unicode character

A

Nchar-fixed unicode length. Nvarchar-max unicode length

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

What is index?

A

makes a sql statement that you can use repeatedly. Create (index name)

17
Q

A good reason to not make an index?

A

If the column you make an index on will be constantly changing.

18
Q

What is foreign key?

A

When a primary key is referenced.

19
Q

decimal(6,2) What does this mean?

A

6 is how many numbers can be put in (6). 2 is how many decimal places .00

20
Q

What is ddl?

A

Data definition language, defining the structure of the tables. Create database and tables, constraints

21
Q

Action queries?

A

Select, insert, commands that change records.

22
Q

Identity key?

A

Sets its own values, you don’t need to input data. Useful for primary key ids

23
Q

What do primary keys combined together make?

A

Composite key, this is called a linking table.