MTA 98-364 Exam Prep Flashcards
Study Guide and Exam Questions
Data Definition Language(DDL) Commands: with creating database objects like tables, constraints, and stored procedures.
• CREATE: creates a new database object, such as a table.
• ALTER: used to modify the database object
• DROP: used to delete the objects.
Also include
- USE:
- RENAME:
- TRUNCATE:
- DELETE:
- COMMENT
Data Manipulation Language(DML) Commands:
• INSERT: used to insert a new data row record in a table.
• UPDATE: used to modify an existing record in a table.
• DELETE: used delete a record from the table.
Also include
- MERGE:
- CALL:
- LOCK TABLE:
Data Control Language(DCL) Commands:
- GRANT: used to assign permission to users to access database objects.
- REVOKE: used to deny permission to users to access database objects.
Data Transfer Language(DTL) Commands:
- COMMIT: used to save any transaction into the database permanently.
- ROLLBACK: restores the database to the last committed state.
Constraints are limitations or rules placed on a field or column to ensure that data that is considered invalid is not entered
The Different types of constraints are
A unique constraint Enforces uniqueness on non primary key columns.
- A check constraint allows the administrator to limit the types of data a user can insert into the database.
- A default constraint is used to insert a default value into a column. If no other value is specified, the default value will be added to all new records.
- A not null constraint ensures that data is entered into a cell. In other words, the cell cannot be blank. It also means that you cannot insert a new record or update a record without adding a value to this field.
- The primary key constraint uniquely identifies each record in a database table. The primary key must contain unique values and it cannot contain NULL values. Each table should have a primary key, and each table can have only one primary key.
- A foreign key constraint in one table points to a primary key in another table
What common data type you would be used to count objects?
integer
Explanation: The int numeric data type is used to store mathematical computations and is used when you do not require a decimal point output. An example of an integer would be: 2 or –2
What common data type is used to store decimal numbers such as 3.14 and 7.07?
float
How many bytes does the int data type take up?
4 bytes
How many bytes does the money data type take up?
8 bytes
How many bytes does the Smallmoney data type take up?
4 bytes ( Remember accuracy to 4 decimal points)
How many bytes does the Smallint data type take up?
2 bytes
How many bytes does the Tinyint data type take up?
1 byte
How many bytes does the float data type take up?
4-8 bytes
How many bytes does the numeric data type take up?
5-17 bytes
How many bytes does the decimal data type take up?
5-17 bytes
How many bytes does the datetime data type take up?
8 bytes
How many bytes does the Datetime2 data type take up?
6-8 bytes
How many bytes does the Datetimeoffset data type take up?
8-10 bytes
How many bytes does the smalldatetime data type take up?
4 bytes
what datatype can store an integer between 0 and 255 and minimize the required storage
Tinyint
Function Types?
Scalar Ranking Aggregate Rowset User-defined
Aggregate functions are?
Aggregate functions return a single value, calculated from values in a column
avg: returns the average of values in a numeric expression, either all or distinct.
count: returns the number of values in an expression, either all or distinct.
min: returns the lowest value in an expression.
max: returns the highest value in an expression.
sum: returns the total of values in an expression, either all or distinct.
Scalar functions are?
Scalar functions return a single value, based on the input value of a single field.