Podcast
Questions and Answers
What are the default ports to secure a SQL server?
What are the default ports to secure a SQL server?
Which two methods can be used to grant temporary permissions to users when you cannot create new groups?
Which two methods can be used to grant temporary permissions to users when you cannot create new groups?
What action can a user perform on data that is on the server if granted unlimited access?
What action can a user perform on data that is on the server if granted unlimited access?
To allow a user to read data in a table, which command should be used?
To allow a user to read data in a table, which command should be used?
Signup and view all the answers
What does the term 'truncate' refer to in a database context?
What does the term 'truncate' refer to in a database context?
Signup and view all the answers
What is the purpose of using a unique index in a database?
What is the purpose of using a unique index in a database?
Signup and view all the answers
In a relational database, what is the requirement for a foreign key in a table?
In a relational database, what is the requirement for a foreign key in a table?
Signup and view all the answers
Which command is used to remove a table from a database?
Which command is used to remove a table from a database?
Signup and view all the answers
What should be applied to the Employee table to ensure an employee can only be assigned to an existing department?
What should be applied to the Employee table to ensure an employee can only be assigned to an existing department?
Signup and view all the answers
What type of data should be recommended for storing financial amounts in a database?
What type of data should be recommended for storing financial amounts in a database?
Signup and view all the answers
Which command is used to create a query returning a set of table data by using the UPDAT statement?
Which command is used to create a query returning a set of table data by using the UPDAT statement?
Signup and view all the answers
What type of constraint ensures that data entered into a column is valid?
What type of constraint ensures that data entered into a column is valid?
Signup and view all the answers
Which command would you use to add a column to an existing table?
Which command would you use to add a column to an existing table?
Signup and view all the answers
Which SQL statement is used to retrieve rows from a table?
Which SQL statement is used to retrieve rows from a table?
Signup and view all the answers
How is a non-clustered index defined on a table?
How is a non-clustered index defined on a table?
Signup and view all the answers
What is one limitation of a delete statement in SQL?
What is one limitation of a delete statement in SQL?
Signup and view all the answers
What is the recommended method to store volunteer data with given name, surname, telephone number, and email address?
What is the recommended method to store volunteer data with given name, surname, telephone number, and email address?
Signup and view all the answers
Which database object should you add to the Sales table to ensure valid associated salesperson records?
Which database object should you add to the Sales table to ensure valid associated salesperson records?
Signup and view all the answers
Which DDL keyword is used to delete a database table?
Which DDL keyword is used to delete a database table?
Signup and view all the answers
Which statement is true regarding the ALTER statement?
Which statement is true regarding the ALTER statement?
Signup and view all the answers
First normal form requires a database to exclude which of the following?
First normal form requires a database to exclude which of the following?
Signup and view all the answers
Which statement about clustered and non-clustered indexes is true?
Which statement about clustered and non-clustered indexes is true?
Signup and view all the answers
What is the purpose of a foreign key in a database?
What is the purpose of a foreign key in a database?
Signup and view all the answers
What is the relationship of StateID in the state table?
What is the relationship of StateID in the state table?
Signup and view all the answers
Which statement about SQL Server logins is incorrect?
Which statement about SQL Server logins is incorrect?
Signup and view all the answers
What is the purpose of the SELECT statement in SQL?
What is the purpose of the SELECT statement in SQL?
Signup and view all the answers
Which SQL clause is used to specify criteria for selecting records?
Which SQL clause is used to specify criteria for selecting records?
Signup and view all the answers
Which constraint ensures that each value in the ID column is unique?
Which constraint ensures that each value in the ID column is unique?
Signup and view all the answers
If you want to retrieve rows from a table, which DML command should you use?
If you want to retrieve rows from a table, which DML command should you use?
Signup and view all the answers
What data type is recommended for storing financial transactions?
What data type is recommended for storing financial transactions?
Signup and view all the answers
To improve query performance on a column, which item should you consider adding?
To improve query performance on a column, which item should you consider adding?
Signup and view all the answers
What type of constraint would you use to establish a relationship between two tables?
What type of constraint would you use to establish a relationship between two tables?
Signup and view all the answers
Which data type should be used to store project names that range from three to 30 characters while minimizing storage space?
Which data type should be used to store project names that range from three to 30 characters while minimizing storage space?
Signup and view all the answers
What is required to define a column in a SQL table?
What is required to define a column in a SQL table?
Signup and view all the answers
What should you specify for a column that cannot contain duplicate values in a SQL table?
What should you specify for a column that cannot contain duplicate values in a SQL table?
Signup and view all the answers
What SQL keywords are valid to use in a CREATE TABLE statement?
What SQL keywords are valid to use in a CREATE TABLE statement?
Signup and view all the answers
Which SQL statement correctly creates a view that returns a list of games sorted alphabetically?
Which SQL statement correctly creates a view that returns a list of games sorted alphabetically?
Signup and view all the answers
When creating an integer-type column that must be assigned a value between 1 and 10, what should you include?
When creating an integer-type column that must be assigned a value between 1 and 10, what should you include?
Signup and view all the answers
Using a relational database minimizes redundant data and allows data retrieval:
Using a relational database minimizes redundant data and allows data retrieval:
Signup and view all the answers
If you want to ensure a column in a SQL table cannot be empty, what constraint should you specify?
If you want to ensure a column in a SQL table cannot be empty, what constraint should you specify?
Signup and view all the answers
What is the characteristic of a non-clustered index?
What is the characteristic of a non-clustered index?
Signup and view all the answers
Which statement correctly describes a unique index?
Which statement correctly describes a unique index?
Signup and view all the answers
Which of the following statements about clustered indexes is true?
Which of the following statements about clustered indexes is true?
Signup and view all the answers
Which SQL statement correctly updates a table named loanedBooks?
Which SQL statement correctly updates a table named loanedBooks?
Signup and view all the answers
What is the appropriate SQL statement to create a table named Student with specified attributes?
What is the appropriate SQL statement to create a table named Student with specified attributes?
Signup and view all the answers
What is true about filtered indexes?
What is true about filtered indexes?
Signup and view all the answers
Which SQL statement can be used to create an index on a column?
Which SQL statement can be used to create an index on a column?
Signup and view all the answers
Which statement describes the relationship between clustered and non-clustered indexes?
Which statement describes the relationship between clustered and non-clustered indexes?
Signup and view all the answers
Study Notes
MTA Exam Questions Review
-
SQL Server Default Ports: The default ports for securing a SQL server are 1433 and 1434.
-
Temporary User Permissions (2 methods): Two ways to grant temporary permissions to users on multiple tables without creating new groups are granting explicit permissions to the role, and adding users to an existing role with appropriate access.
-
User Actions on Server Data: Users can perform actions on database objects on the server. The extent of these actions can vary.
-
Granting Read Access: The
ALLOW SELECT
command grants select permission to read data in a table. If it makes the statement correct to read data, stateNo change is needed
. If the statement is incorrect, correct the statement by sayingGrant select
. OrPermit read
. -
Database Operations (Truncate): Truncate is a database operation used to clear/correct data if a database is damaged or corrupt. (NOT for backups). Other terms that could pertain, and should be used if appropriate, are
Attach
andCommit
(orRestoring
). -
Foreign Key Constraints: In relational databases, foreign keys in a table must be unique in that table and cannot refer to the primary key of another table. Foreign keys cannot contain null values.
-
Employee Table Assignment: To ensure that employees can only be assigned to existing departments, a foreign key should be added to the Employee table linking the Employee table with department table.
-
SQL Query for Table Data: The statement
UPDATE
is not used to retrieve data, butSELECT
is.
Database Table Structure and Data Types
-
SQL Database Table Keywords: To delete a table use
DROP
. -
Data Types and Normal Form: First normal form requires elimination of repeating groups and duplicate rows in table data.
-
SQL Database Table Relationships: A primary key is a constraint ensuring each row in the Table is unique and is related to other tables. A foreign key in one table can point to a primary key in another table.
Database Objects and Constraints
-
Removing Tables: The command to remove a table is
DROP TABLE
. -
Data Integrity: Using Constraints, especially Foreign Keys, keeps the reference data consistent across related tables, preventing orphaned rows and inconsistencies.
-
Data Types: Use
INT
for numerical data in a table column. UseVARCHAR
for string data, but specify the maximum length. -
Indexes: Indexes improve query performance by speeding up data retrieval. A clustered index sorts data physically on disk. A non-clustered index doesn't. Indexes are often added to commonly queried fields.
Data Validation and Relationships
-
Data Types For Financial Transactions: Recommendations for financial transactions in a database table are
MONEY
andDECIMAL
to support precise calculations and avoid rounding errors. -
Unique Values & Data Integrity (Constraints): A primary key ensures a unique value for each row in a table, guaranteeing distinct identification for all records.
-
Relationships and Data Consistency: Use foreign keys to ensure data consistency by enforcing connections between related tables, preventing invalid or orphaned data.
-
Adding Columns: The correct command to add a column to an existing table is
ALTER TABLE
. -
Data Consistency: A database with constraints guarantees a consistent set of data in related tables, improving data integrity.
Query and Data Manipulation
-
Query Performance Optimization: Use indexes on columns frequently searched.
-
Data Modification Statements:
-
UPDATE
for changing data in a table -
DELETE
to eliminate rows. -
INSERT
to add new rows.
-
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.