1.
The primary - foreign key relations are used to
Correct Answer
A. Cross-reference database tables
Explanation
The primary-foreign key relations are used to cross-reference database tables. This means that the primary key of one table is used as a foreign key in another table to establish a relationship between the two tables. This allows for data consistency and integrity, as it ensures that any data referenced in one table exists in the related table. It also enables efficient querying and retrieval of data across multiple tables by using the foreign key to join the tables together.
2.
The UNION SQL clause can be used with
Correct Answer
B. The SELECT clause only
Explanation
The correct answer is "the SELECT clause only" because the UNION SQL clause is used to combine the result sets of two or more SELECT statements into a single result set. It is not used with the DELETE or UPDATE clauses, which are used to modify data in a table. Therefore, the UNION clause can only be used with the SELECT clause.
3.
Can you join a table to itself?
Correct Answer
A. YES
Explanation
Yes, you can join a table to itself. This is known as a self-join and it is used when you want to combine rows from the same table based on a related column. By using aliases to differentiate between the two instances of the table, you can create a join condition and retrieve the desired information. Self-joins are commonly used in scenarios where you have hierarchical data or when you need to compare records within the same table.
4.
What is the difference between the WHERE and HAVING SQL clauses?
Correct Answer
A. The WHERE SQL clause condition(s) is applied to all rows in the result set before the HAVING clause is applied (if present). The HAVING clause is used only with SELECT SQL statements and specifies a search condition for an aggregate or a group.
Explanation
The WHERE clause is used to filter rows based on a specific condition before the HAVING clause is applied. It is used with SELECT SQL statements and specifies a search condition for individual rows. On the other hand, the HAVING clause is used to filter rows based on a specific condition after the WHERE clause. It is used with SELECT SQL statements and specifies a search condition for aggregate functions or groups.
5.
The difference between the DELETE and TRUNCATE SQL clauses is _________________
Correct Answer
A. The TRUNCATE clause is identical to the DELETE clause
Explanation
The given answer states that the TRUNCATE clause is identical to the DELETE clause. This means that both clauses can be used to delete data from a database table. However, there may be some differences in their functionalities or syntax, which are not mentioned in the given options.
6.
What is the ABS SQL function used for?
Correct Answer
C. To return the absolute, positive value of a numeric expression.
Explanation
The ABS SQL function is used to return the absolute, positive value of a numeric expression. This means that it will return the value without considering its sign, always returning a positive value.
7.
SSIS stands for
Correct Answer
A. SQL Integration Services
Explanation
SSIS stands for SQL Integration Services. It is a component of Microsoft SQL Server that is used for building enterprise-level data integration and data transformation solutions. SSIS provides a platform for extracting, transforming, and loading (ETL) data from various sources into data warehouses or other target systems. It offers a wide range of tools and features to automate the process of data integration, including data cleansing, data profiling, and data quality services. With SSIS, developers can create packages to perform complex data integration tasks and schedule them to run at specific times or events.
8.
SQL server Management Studio replaces
Correct Answer
C. Both Enterprise Manager and Query Analyzer
Explanation
SQL Server Management Studio (SSMS) replaces both Enterprise Manager and Query Analyzer. SSMS is a comprehensive integrated environment for managing SQL Server databases. It combines the functionalities of both Enterprise Manager and Query Analyzer into a single tool. With SSMS, users can perform tasks such as managing databases, creating and executing queries, designing tables and views, and monitoring server performance. It provides a more efficient and streamlined experience for database administrators and developers by consolidating the features of the previous tools into one unified interface.
9.
------------------------------ is used to browse servers and view Log files
Correct Answer
C. Object Explorer
Explanation
Object Explorer is used to browse servers and view Log files. It provides a graphical interface to navigate and manage the objects within a SQL Server instance. It allows users to connect to different servers, explore server objects such as databases, tables, views, and also view log files for troubleshooting and monitoring purposes. With Object Explorer, users can easily browse and access the necessary information and logs related to the server and its objects.
10.
The command prompt utility used to copy data between SQL Server and User File is_____________
Correct Answer
A. Bcputility
Explanation
The correct answer is bcputility. Bcp utility is a command-line tool that allows for the import or export of data between SQL Server and user files. It can handle large volumes of data and offers various options for data format and transformation. This utility is commonly used for tasks such as bulk data loading, data migration, and data backups.
11.
The Master database in sql holds ------------------------ for SQL Server
Correct Answer
C. Initialization Info
Explanation
The Master database in SQL holds initialization information for SQL Server. This includes information about the server configuration, system databases, and other essential settings required for the proper functioning of SQL Server.
12.
The Integrity which makes sure that keyvalues are consistent across tables
Correct Answer
C. Referential Integrity
Explanation
Referential Integrity ensures that the relationships between tables are maintained and that any foreign key values in one table correspond to valid primary key values in another table. It guarantees the consistency and accuracy of data by preventing the creation of orphaned records or invalid references. This ensures that key values are consistent across tables and maintains the integrity of the database.
13.
Select the Exact Numeric Datatypes in SQL( any 3)
Correct Answer(s)
A. Smallmoney
C. Tinyint
D. Bigint
Explanation
The question asks for the exact numeric datatypes in SQL. The correct answer is smallmoney, tinyint, and bigint.
- smallmoney is a datatype that stores monetary values with a decimal point, with a range of -214,748.3648 to 214,748.3647.
- tinyint is a datatype that stores small integers with a range of 0 to 255.
- bigint is a datatype that stores large integers with a range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
These datatypes are used to store specific numeric values in SQL databases.
14.
All Integrity Categories Support User-Defined Integrity
Correct Answer
A. True
Explanation
This statement is true because all integrity categories, such as entity integrity, referential integrity, and domain integrity, can be defined and enforced by the user. User-defined integrity allows users to set rules and constraints on the data in a database to ensure its accuracy, consistency, and reliability. By defining these integrity categories, users can specify the conditions that must be met for the data to be considered valid, and the database management system will enforce these rules to maintain the integrity of the data.
15.
Primary Key Constraint Enforces ----------------------of the table
Correct Answer
B. Entity Integrity
Explanation
Entity Integrity is the correct answer because the primary key constraint enforces the uniqueness and non-nullability of the primary key attribute(s) in a table. It ensures that each row in the table can be uniquely identified and that no primary key value is null or duplicated. This constraint is essential for maintaining the integrity and consistency of the data within the table.
16.
A _______________constraint enforces referential Integrity
Correct Answer
B. Foreign key
Explanation
A foreign key constraint enforces referential integrity by ensuring that values in a column of one table match the values in a primary key column of another table. This constraint helps maintain the consistency and accuracy of data between related tables in a database. By specifying a foreign key constraint, any attempt to insert or update data that violates the relationship between the tables will be rejected, preventing inconsistencies and maintaining data integrity.
17.
Forign Key Constraint Does not create indexes Automatically
Correct Answer
A. True
Explanation
Foreign key constraints do not automatically create indexes because they serve different purposes. A foreign key constraint is used to enforce referential integrity between two tables, ensuring that values in one table's foreign key column match the values in another table's primary key column. On the other hand, indexes are used to improve query performance by allowing faster data retrieval. While foreign key constraints can benefit from existing indexes, they are not automatically created because they serve different functionalities.
18.
Single Column can have multiple Check Constraints
Correct Answer
A. True
Explanation
A single column in a database table can indeed have multiple check constraints. Check constraints are used to enforce specific conditions on the values that can be stored in a column. By applying multiple check constraints to a single column, you can impose different conditions or rules on the acceptable values for that column. This allows for more flexibility and granularity in defining the data validation rules for the column.
19.
Only ___________ null value(s) can appear in a column with unique statement constraint
Correct Answer
A. One
Explanation
A column with a unique statement constraint means that each value in the column must be unique and cannot be repeated. Therefore, if there is a null value in the column, it would violate the unique constraint because null values are not considered equal to each other. So, the only null value that can appear in a column with a unique statement constraint is one.
20.
A check Constraint cannot be placed on columns with text,ntext,___________ and ______________ datatypes
Correct Answer(s)
A. Image
C. Rowversion
Explanation
A check constraint is a rule that limits the values that can be inserted or updated in a column. It ensures that the data meets certain conditions. In this case, a check constraint cannot be placed on columns with the text, ntext, image, rowversion, binary, and varbinary datatypes. Therefore, the correct answer is image and rowversion.
21.
DBCC check constraint Returns any rows that violate rules.What does DBCC stands for?
Correct Answer
B. Database Consistency Checker
Explanation
DBCC stands for "Database Consistency Checker". It is a command in SQL Server that is used to check the consistency of the database, including checking the integrity of the data and the constraints defined on the tables. In this context, the DBCC check constraint command specifically checks for any rows in the database that violate the defined constraints. Therefore, the correct answer is "Database Consistency Checker".
22.
Default Constraint Enforces ____________________
Correct Answer
A. Domain Integrity
Explanation
The default constraint enforces domain integrity. Domain integrity ensures that the data entered into a column or attribute of a table follows the defined data type, format, and range of values. The default constraint specifies a default value for a column when no value is provided during an insert operation. This constraint helps maintain the integrity of the domain by ensuring that a valid default value is assigned to the column if no other value is specified.
23.
The SQL Server uses ___________ keyword to store the computed columns in a table
Correct Answer
C. PERSISTED
Explanation
The SQL Server uses the "PERSISTED" keyword to store computed columns in a table. This keyword ensures that the computed column values are physically stored in the table, rather than being calculated on the fly whenever the column is accessed. By using the "PERSISTED" keyword, the computed column values are stored and maintained in the table, allowing for faster retrieval and improved performance.
24.
What is the purpose of the SQL AS Clause?
Correct Answer
A. The AS SQL clause is used change the name of a column in the result set or to assign a name to a derived column.
Explanation
The AS clause in SQL is used to rename a column in the result set or to assign a name to a derived column. It allows for more meaningful and descriptive column names to be displayed in the output of a query. This can make the results easier to understand and interpret. Additionally, the AS clause can be used in conjunction with other SQL clauses, such as SELECT and FROM, to create aliases for tables or columns, which can simplify the syntax and improve readability of the query.
25.
The LIKE Keyword is used along with ______________
Correct Answer
D. WHERE clause.
Explanation
The LIKE keyword is used along with the WHERE clause. The WHERE clause is used to filter rows based on a specific condition. The LIKE keyword is used to perform pattern matching within the WHERE clause. It is used to search for a specified pattern in a column.
26.
What does the SQL FROM clause do?
Correct Answer
C. Specifies the tables to retrieve rows from.
Explanation
The SQL FROM clause is used to specify the tables from which we want to retrieve rows. It is used in conjunction with the SELECT statement to determine the source tables for the data. By specifying the tables in the FROM clause, we can retrieve data from multiple tables by joining them together.
27.
Which of the following SQL Statements is right?
Correct Answer
C. SELECT * FROM Sales WHERE Date BETWEEN '10/12/2005' AND '01/01/2006'
Explanation
The correct answer is "SELECT * FROM Sales WHERE Date BETWEEN '10/12/2005' AND '01/01/2006'". This is the correct SQL statement because it selects all columns from the "Sales" table where the "Date" column is between '10/12/2005' and '01/01/2006'. The BETWEEN keyword is used to specify a range, and the correct syntax is to use the AND keyword to separate the start and end dates.
28.
What Will be the result of this following statement : Select left('Have a Nice Day',4)
Correct Answer
A. Have
Explanation
The given statement is using the LEFT function in SQL to select the leftmost 4 characters from the string 'Have a Nice Day'. The LEFT function returns the specified number of characters from the start of the string. In this case, it will return 'Have', which is the leftmost 4 characters of the given string.
29.
Select the Non-Deterministic Functions
Correct Answer(s)
B. GETDATE
C. GETUTCDATE
E. DATENAME
Explanation
The correct answer includes the functions GETDATE, GETUTCDATE, and DATENAME. These functions are non-deterministic because their results can vary each time they are executed. GETDATE returns the current date and time, which is always changing. GETUTCDATE returns the current UTC date and time, which can also change. DATENAME returns a specific part of a date or time, such as the month or day, and the result can vary depending on the input. Therefore, these functions are considered non-deterministic.
30.
PATINDEX is a string function
Correct Answer
A. True
Explanation
PATINDEX is indeed a string function in SQL. It is used to search for a specific pattern within a string and returns the starting position of the first occurrence of the pattern. It is commonly used in SQL queries to perform pattern matching operations on strings. Therefore, the statement "PATINDEX is a string function" is correct.