Database Administration Fundamentals Flashcards
What is the UNIQUE constraint?
Specifically identifies which column should not contain duplicate values.
What is the CHECK constraint?
Allows the admin to limit the types of data a user can insert into that column of the database.
What is a default constraint?
Used to insert a default value into a column.
What is the NOT NULL constraint?
Requires that data is entered into the cell, it is not allowed to be blank.
What is the primary key?
This uniquely identifies each record in the db.
What is a foreign key?
This is a column in one table that points to the primary key in another table.
Why is it a bad idea to let a foreign key contain a NULL value?
Because it may be impossible to verify the constraints if a foreign key consists of two or more columns if one of them is NULL.
What is a self-reference?
When the foreign key refers to columns in the same table.
What is XQuery?
A query and functional programming language designed to query collections of XML data.
What is SQLCMD?
A command line application that comes with SQL and exposes the management features of SQL Server. It allows SQL queries to be written and executed from the command prompt.
What is TRANSACT-SQL
This is the primary means of programming and managing SQL Server. When you use an DBMS, like SSMS, to perform an action, it is using T-SQL commands in the background to do the work.
What are the three types of files in SQL?
MDF = Primary data files, NDF = Secondary data files and LDF = Log files
Database objects are divided into two categories:
Storage and Programmability
Tables created using the ________ statement are used to store data.
CREATE TABLE
Constraints are also referred to as ____ constraints.
Column
In order to use views, you must use the ______ T-SQL statement to show data from the tables.
SELECT
DDL influences _____, while _______ influences actual data stored in tables.
Database objects, DML
The MS database server that hosts relational databases is called _____
MS SQL Server
The core DDL statements are (6):
ADDUCT: ALTER, DROP, DELETE, USE, CREATE and TRUNCATE
The core DML statements are (5)
MIDUS: MERGE, INSERT, DELETE, UPDATE, SELECT
System views belong to the ______
sys schema
What are 6 constraint types?
Unique, Check, Default, Not Null, Primary Key, Foreign Key
A bit is the T-SQL integer data type that can take a ___ of 1, 0 or NULL.
value
A regular character uses ___ bytes of storage, whereas a unicode character requires ____ bytes.
one, two
When querying a database you can obtain faster results from properly ______ tables and views.
indexed
What’s the difference between time, datetime, datetime2, datetimeoffset and smalldatetime?
Time is the 24 hr clock, Datetime is accurate to .00333 seconds, datetime2 is accurate up to 100 nanoseconds, datetimeoffset includes daylight savings time and smalldatetime does not keep track of seconds.
What prefix must you have in front of a string to use Unicode?
N
What is the default length for the CAST function?
30
What is native auditing?
The process of extracting trails on a regular basis so they can be transferred to a designated security system where the database admins do not have access, this ensures a certain level of separation of duties and provides evidence that the audit trails were not modified.
What is a two-phase commit system?
A feature of a transaction processing system which enables DB’s to be returned to the pre-transaction state if some error condition occurs. All databases are updated or none of them are.
Name 4 types of decomposition
Top-down, Bottom-up, Inside-out, Mixed
What is the inside-out approach to db design?
A type of bottom-up approach, the inside-out method begins with identifying a few important concepts then proceeds outward radially.
What is the top-down approach?
When a schema is created through a series of successive refinements, starting with the first schema.
What is the With Execute Owner clause?
When creating a stored procedure, this can be used to allow the person running the SP to have the same permissions as the person who owns the SP. This is better than granting SELECT to the user.
What is abstraction?
A method of coding that enables a user to focus on the coding rather than the syntax for a specific database API, allowing them to use generic methods of access as long as they have the additional codes or libraries which fill in the blanks.
What is the correct way to select an avg of a column?
SELECT AVG(“column name”) FROM “table name”
What is a clustered index?
It consists of a root page, intermediate levels and leaf levels in a B-tree structure. Each row contains a valid key and a pointer. A clustered index forces the data in the table to be sorted in the order of the index. Each table can only have 1 clustered index.
What is a non-clustered index?
Same as clustered except the index does not physically rearrange the data.
What are 3 characteristics of a simple view?
- It does not have any usage of SQL group functions or grouping of data.