Test 3 Flashcards
First normal form
Each value must be scalar and no repeating columns
2nd normal form
Every non key column must depend on the primary key
3rd normal form
every non key column must depend only on the primary key. (considered good design)
What would violate referential integrity.
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
Ch 8 datatypes, what datatypes will store whole numbers, character.
Integer-whole numbers. Decimal- decimal numbers. Char-fixed string length. Varchar-max string length.. Datetime-exact date(millisecond). smalldatetime-date (minute). Date-date
Relationships one to one, one to many, many to many.
One to many is most common
What is used after Create database
Go
What is a constraint?
A way to filter what data goes through.
(inline) InvoiceTotal MONEY NOT NULL CHECK(InvoiceTotal >= 0)
(bottom) CHECK (InvoiceTotal >= 0)
Keyword for constraint on a column?
Check keyword
Customer order has to refer to Customer, what do you use?
A join/ foreign key
A referenced table must be made before a table can reference it.
Where do records come from?
tables
When planning the database, 100 east main street sc how do separate.
Street name, city, state, number
What do CAST and CONVERT do?
Cast changes one data type to another. Convert does the same thing but more complex.
Date function
GETDATE()
Unicode character
Nchar-fixed unicode length. Nvarchar-max unicode length