Which of the following scripts would set the database recovery model for sys.database?
Correct Answer: A
The script that would set the database recovery model for sys.database is option A. This script uses the ALTER DATABASE statement to modify the recovery model of the sys.database to full with no wait. The other options either have syntax errors, use incorrect keywords, or do not specify the recovery model correctly. Reference: CompTIA DataSys+ Course Outline, Domain 3.0 Database Management and Maintenance, Objective 3.1 Given a scenario, perform common database maintenance tasks.
Question 12
A database administrator is migrating the information in a legacy table to a newer table. Both tables contain the same columns, and some of the data may overlap. Which of the following SQL commands should the administrator use to ensure that records from the two tables are not duplicated?
Correct Answer: A
The SQL command that the administrator should use to ensure that records from the two tables are not duplicated is option A. This command uses the UNION clause to combine the records from the legacy table and the newer table into a single result set. The UNION clause also eliminates any duplicate records that may exist in both tables, and sorts the result by default. The other options either do not produce the desired result or have syntax errors. For example, option B would join the records from the two tables based on a common column, but not remove any duplicates; option C would return only the records that are common to both tables, but not the ones that are unique to each table; option D would produce a Cartesian product of the records from the two tables, which would increase the number of duplicates. Reference: CompTIA DataSys+ Course Outline, Domain 1.0 Database Fundamentals, Objective 1.2 Given a scenario, execute database tasks using scripting and programming languages.
Question 13
A database administrator is concerned about transactions in case the system fails. Which of the following properties addresses this concern?
Correct Answer: A
The property that addresses this concern is durability. Durability is one of the four properties (ACID) that ensure reliable transactions in a database system. Durability means that once a transaction has been committed, its effects are permanent and will not be lost in case of system failure, power outage, crash, etc. Durability can be achieved by using techniques such as write-ahead logging, checkpoints, backup and recovery, etc. The other options are either not related or not specific to this concern. For example, isolation means that concurrent transactions do not interfere with each other and produce consistent results; atomicity means that a transaction is either executed as a whole or not at all; consistency means that a transaction preserves the validity and integrity of the data. Reference: CompTIA DataSys+ Course Outline, Domain 1.0 Database Fundamentals, Objective 1.3 Given a scenario, identify common database issues.
Question 14
Which of the following database instances are created by default when SQL Server is installed? (Choose two.)
Correct Answer: B,D
The two database instances that are created by default when SQL Server is installed are master and model. Master is a system database that contains the information and settings of the SQL Server instance, such as the configuration, logins, endpoints, databases, etc. Master is essential for the operation and management of the SQL Server instance, and it should be backed up regularly. Model is a system database that serves as a template for creating new user databases. Model contains the default settings and objects, such as tables, views, procedures, etc., that will be inherited by the new user databases. Model can be modified to customize the new user databases according to specific needs or preferences. The other options are either not database instances or not created by default when SQL Server is installed. For example, root is not a database instance, but a term that refers to the highest level of access or privilege in a system; log is not a database instance, but a file that records the changes made by transactions on a database; view is not a database instance, but an object that represents a subset or a combination of data from one or more tables; index is not a database instance, but a data structure that stores the values of one or more columns of a table in a sorted order. Reference: CompTIA DataSys+ Course Outline, Domain 2.0 Database Deployment, Objective 2.3 Given a scenario, update database systems.
Question 15
Which of the following statements contains an error?
Correct Answer: B
The statement that contains an error is option B. This statement is missing the FROM clause, which specifies the table or tables from which to retrieve data. The FROM clause is a mandatory clause in a SELECT statement, unless the statement uses a subquery or a set operator. The correct syntax for option B would be: SELECT EmpId FROM employee WHERE EmpId=90030 AND DeptId=34 Copy The other options are either correct or valid SQL statements. For example, option A selects the employee ID from the employee table where the employee ID is equal to 90030; option C selects all columns from the employee table where the employee ID is equal to 90030; option D selects the employee ID from the employee table without any filter condition. Reference: CompTIA DataSys+ Course Outline, Domain 1.0 Database Fundamentals, Objective 1.2 Given a scenario, execute database tasks using scripting and programming languages.