MCQ | SQL – Table

SQL Table MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Table.
Submitted by Anushree Goswami, on September 22, 2021

SQL Tables MCQs

1. In DBMS, table is known as _____ and row is known as _____.

  1. Relation, Tuple
  2. Tuple, Tuple
  3. Tuple, Relation
  4. Relation, Relation

Answer: A) Relation, Tuple

Explanation:

In DBMS, table is known as Relation and row is known as Tuple.

Discuss this Question


2. Select the statement which is TRUE?

  1. In a table, there could be any number of rows and any number of columns.
  2. In a table, there could be any number of rows and specified number of columns.
  3. In a table, there could be any number of columns and specified number of rows.
  4. In a table, there could be specified number of rows and specified number of columns.

Answer: B) In a table, there could be any number of rows and specified number of columns

Explanation:

In a table, there could be any number of rows and specified number of columns.

Discuss this Question


3. Select the statement which is TRUE?

  1. In case a transaction is rolled back, the data allied with table variable also get rolled back.
  2. In case a transaction is rolled back, the data allied with table variable does not roll back.
  3. In case a transaction is not rolled back, the data allied with table variable get rolled back.
  4. None of the above.

Answer: B) In case a transaction is rolled back, the data allied with table variable does not roll back

Explanation:

In case a transaction is rolled back, the data allied with table variable does not roll back.

Discuss this Question


4. Temporary variables use ____ resources than table variables.

  1. More
  2. Less
  3. Equal
  4. None of the above

Answer: A) More

Explanation:

Temporary variables use more resources than table variables.

Discuss this Question


5. Input and output parameters can be derived from table variables.

  1. True
  2. False

Answer: B) False

Explanation:

Input and output parameters can't be derived from table variables.

Discuss this Question


6. What is SQL CREATE Table used for?

  1. To Update table
  2. To Create table
  3. To Delete table
  4. None of the above

Answer: B) To Create table

Explanation:

SQL CREATE Table is used to create table in a database.

Discuss this Question


7. For integer value, which data type is supported in Oracle?

  1. INT
  2. Number
  3. Digit
  4. None of the above

Answer: B) Number

Explanation:

For Integer Value, Number data type is supported in Oracle.

Discuss this Question


8. To delete table definition and all data from the table, which statement is used?

  1. DELETE
  2. DROP
  3. ALTER
  4. None of the above

Answer: B) DROP

Explanation:

To delete table definition and all data from the table, DROP statement is used.

Discuss this Question


9. What is the difference between DELETE and TRUNCATE statements?

  1. DELETE statement free up the space kept in check by the table whereas TRUNCATE statement does not free up the space kept in check by the table.
  2. DELETE statement does not free up the space kept in check by the table whereas TRUNCATE statement free up the space kept in check by the table.
  3. DELETE statement only deletes rows from the table whereas TRUNCATE statement can only delete columns from the table.
  4. DELETE statement only deletes columns from the table whereas TRUNCATE statement can only delete rows from the table.

Answer: B) DELETE statement does not free up the space kept in check by the table whereas TRUNCATE statement free up the space kept in check by the table

Explanation:

DELETE statement does not free up the space kept in check by the table whereas TRUNCATE statement free up the space kept in check by the table.

Discuss this Question


10. When the table is dropped:

  1. Table structure is dropped
  2. Integrity constraints are dropped
  3. Relationship is dropped
  4. All of the above

Answer: D) All of the above

Explanation:

When the table is dropped, the table structure, integrity constraints, relationship and access privileges are dropped.

Discuss this Question


11. When the table is truncated:

  1. Table structure is dropped
  2. Integrity constraints are dropped
  3. Relationship is dropped
  4. None of the above

Answer: D) None of the above

Explanation:

When the table is truncated, table structure remains same; therefore none of the above problems occur.

Discuss this Question


12. In SQL, which statement can help in changing the name of the table?

  1. RENAME
  2. ALTER
  3. Both A) and B)
  4. None of the above

Answer: C) Both A) and B)

Explanation:

In SQL, RENAME and ALTER statement can help change the name of the table.

Discuss this Question


13. TRUNCATE TABLE requires:

  1. WHERE clause
  2. HAVING clause
  3. Both a and b
  4. None of the above

Answer: D) None of the above

Explanation:

TRUNCATE TABLE does not require any clause.

Discuss this Question


14. Select the correct statement.

  1. TRUNCATE TABLE is faster than DELETE TABLE statement.
  2. TRUNCATE TABLE uses fewer resources than DELETE TABLE statement.
  3. Both A) and B)
  4. None of the above

Answer: C) Both A) and B)

Explanation:

TRUNCATE TABLE uses fewer resources and is faster than DELETE TABLE command.

Discuss this Question


15. SELECT INTO statement -

  1. Select the content from a table.
  2. Rename the content in a table.
  3. Copy the content from one table into another existing table.
  4. None of the above

Answer: C) Copy the content from one table into another existing table

Explanation:

SELECT INTO statement copy the content from one table into another existing table.

Discuss this Question


16. Which of the following statement is TRUE?

  1. At run time, temporary tables can be created.
  2. Temporary table can do similar operations to normal table.
  3. Both A) and B)
  4. None of the above

Answer: C) Both A) and B)

Explanation:

At run time, temporary tables can be created and temporary table can do similar operations to normal table.

Discuss this Question


17. How many temp tables are there?

  1. 1
  2. 2
  3. 3
  4. 4

Answer: B) 2

Explanation:

There are 2 types of temp tables.

Discuss this Question


18. Which of the following are the types of the temp tables?

  1. Local Temp
  2. Global Temp
  3. Both A) and B)
  4. None of the above

Answer: C) Both A) and B)

Explanation:

Local and Global temp, both are the types of the temp tables.

Discuss this Question


19. Local Temp Variable is used with which sign?

  1. ?
  2. @
  3. #
  4. &

Answer: C) #

Explanation:

Local Temp Variable is used with # sign.

Discuss this Question


20. Global Temp Variable is used with which sign?

  1. ###
  2. ####
  3. #
  4. ##

Answer: D) ##

Explanation:

Global Temp Variable is used with Double-Hash (##) sign.

Discuss this Question






Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.