INFO5052-Midterm Flashcards
What is SQL Server?
The database engine
What program is used to query and maintain databases using SQL Server?
SQL Server Management Studio (SSMS)
What two files does SSMS create by default when you create a new database?
- Data File
- Log file
What is saved in the data file?
The schema and data for a given database
What is saved in a log file?
Transaction data required to run database. Database cannot be brought online without a log file.
Which type of file can be split across multiple files?
Data file
What is collation?
Defines how characters are interpreted
What is the recovery model?
Affects how long transactions are held in the transaction log
What is DDL?
Data Definition Language
What is DML?
Data Manipulation Language
What are two best practices with DDL?
- Always use semi-colons
- Use explicit schemas
What is NULL equal to?
Unknown
When working with complex joins, which type of join should be performed first? (INNER, OUTER)
Inner joins first
What does TRUNCATE do?
Removes all rows from a table without logging the individual row deletions.
Which is faster, TRUNCATE or DELETE?
TRUNCATE
Can a TRUNCATE be rolled back?
Yes
What are two “magic tables”?
- Inserted
- Deleted
Which four commands can make use of magic tables?
- INSERT
- UPDATE
- DELETE
- MERGE
What is an expression?
Anything that can be evaluated to return a single value
How do you return the magic tables?
OUTPUT inserted.ColumnName
OUTPUT deleted.ColumnName
What is a OLTP?
Online Transaction Processing Databases
What are the characteristics of an OLTP?
- Large number of users
- High volume of transactions
- Users have write access through an application
- Small amount of data
- Operational data
What is the purpose of normalization?
Data integrity
What is the preferred level of normalization?
3rd Normal
What is 1st Normal?
Unique columns with atomic data
What is 2nd Normal?
Data is dependent on entire key
What is a candidate key?
Any column or columns that can uniquely identify a row of data
What is 3rd Normal?
No column is transitively related to the candidate key
What is a logical data model?
Describes required data without describing structures. Includes entities, attributes and relationships