1.
Which data manipulation command is used to combines the records from one or more tables?
Correct Answer
C. JOIN
Explanation
The JOIN command is used to combine the records from one or more tables. It allows you to retrieve data from multiple tables based on a related column between them. This command is commonly used in database management systems to perform data manipulation and retrieve information from multiple tables simultaneously.
2.
Which of the following is a valid SQL type?
Correct Answer
D. All of the above
Explanation
Numeric: These are numeric data types used to store fixed-point numbers. They are typically used for representing numbers with a specific precision and scale.
Float: This is a floating-point numeric data type used to store approximate numeric values with a floating decimal point.
Character: This is a character string data type used to store text or character data.
Therefore, all the types mentioned in the options— numeric, float, and character—are valid SQL data types.
3.
Which operator is used to compare a value to a specified list of values?
Correct Answer
C. IN
Explanation
The operator "IN" is used to compare a value to a specified list of values. It checks if the value matches any of the values in the specified list.
4.
Is [
SQL permits attribute names to be repeated in the same relation.
] true or false?
Correct Answer
B. False
Explanation
SQL does not permit attribute names to be repeated in the same relation. Each attribute in a table must have a unique name to avoid ambiguity and ensure proper data organization.
5.
Is [
A SQL query automatically eliminates duplicates ?
] true or false?
Correct Answer
B. False
Explanation
False. A SQL query does not automatically eliminate duplicates. If a query retrieves data from a table that contains duplicate rows, all the duplicate rows will be returned. To eliminate duplicates, the DISTINCT keyword can be used in the SELECT statement to retrieve only unique values.
6.
Which SQL function is used to count the number of rows in a SQL query?
Correct Answer
D. COUNT(*)
Explanation
The COUNT(*) function is used to count the number of rows in a SQL query. It returns the number of rows that match the specified condition in the query. The asterisk (*) in COUNT(*) indicates that all rows in the result set should be counted. This function is commonly used to get the total number of records in a table or to count the number of rows that meet certain criteria in a query.
7.
Which SQL keyword is used to retrieve a maximum value?
Correct Answer
C. MAX
Explanation
The SQL keyword "MAX" is used to retrieve the maximum value from a column in a database table. It is commonly used with the "SELECT" statement to find the highest value in a specific column. For example, "SELECT MAX(salary) FROM employees" would return the highest salary in the "employees" table. The "MOST", "TOP", and "UPPER" keywords are not used for retrieving maximum values in SQL.
8.
___________removes all rows from a table without logging the individual row deletions.
Correct Answer
D. TRUNCATE
Explanation
TRUNCATE removes all rows from a table without logging the individual row deletions. This means that the operation is faster compared to DELETE, as it does not generate individual delete statements for each row. TRUNCATE also resets the identity column value (if any) and releases the storage space used by the table, making it more efficient for large data sets. However, it cannot be rolled back and does not trigger any delete triggers associated with the table.
9.
Which of the following is not a DDL command?
Correct Answer
A. UPDATE
Explanation
UPDATE is not a Data Definition Language (DDL) command. DDL commands are used to define or modify the structure of the database, such as creating or altering tables, indexes, or views. UPDATE, on the other hand, is a Data Manipulation Language (DML) command used to modify data within the tables. Therefore, UPDATE is not a DDL command.
10.
Which of the following are TCL commands?
Correct Answer
D. ROLLBACK and SAVEPOINT
Explanation
The correct answer is ROLLBACK and SAVEPOINT. These are both TCL (Transaction Control Language) commands in SQL. ROLLBACK is used to undo changes made in a transaction, while SAVEPOINT is used to mark a point in a transaction to which it can be rolled back later. UPDATE and TRUNCATE are DML (Data Manipulation Language) commands, SELECT and INSERT are also DML commands, and GRANT and REVOKE are DDL (Data Definition Language) commands.