MIDTERM Flashcards
What is a database data file?
Contains the schema and data for a database. A database cannot exist without one. A database may be split across multiple data files.
What is a transaction log file?
Contains transaction data to run the database. The database can’t be brought online without one. Can be used to restore data.
What is DDL?
Statements that affect the database schema. Create, Alter or Drop objects such as tables, constraints, views, indexes.
What is DML?
Statements affect data only. Used to CRUD Data. Create, read, update, delete.
How do ANSI nulls behave?
1 = NULL Does not return false, NULL = NULL does not return true.
What are table aliases? Benefits of using them?
An acronym of a table. Ex: TableA a. Easier to type out, Makes it clearer.
Difference between Delete and Truncate?
Truncates
- Do not log row data
- much faster
- only work on entire table, so no Where clause
- Resets identities
- statements can be rolled back
What is an OLTP?
Online Transaction Processing
- High volume of users performing large amount of transactions on a small amount of data.
- Queries include both read and write operations
- Must maintain data integrity
- Must be fault tolerant
Benefits of Normalization?
- Small tables
- High resistance to data inconsistency
- Low or no redundancy
- Improved performance on small targeted queries
1st Normal Form?
- Data must be Atomic
2nd Normal Form?
- Data for each table must be dependent on the entire key
3rd Normal Form?
- No column may be transitively related to the candidate keys
What is a candidate key?
- Any attribute that might be used to uniquely identify an entity
What is a logical data model?
- A model where we capture entities, attributes and relationships
What is an entity?
- A thing we want to store information about. Typically nouns (Student, Class, Address).
What is an attribute?
- Properties of an entity we want to store. They describe some aspect of the entity (Birthdate, Course description, Postal code)