Home »
SQL »
SQL MCQs
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 _____.
- Relation, Tuple
- Tuple, Tuple
- Tuple, Relation
- 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?
- In a table, there could be any number of rows and any number of columns.
- In a table, there could be any number of rows and specified number of columns.
- In a table, there could be any number of columns and specified number of rows.
- 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?
- In case a transaction is rolled back, the data allied with table variable also get rolled back.
- In case a transaction is rolled back, the data allied with table variable does not roll back.
- In case a transaction is not rolled back, the data allied with table variable get rolled back.
- 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.
- More
- Less
- Equal
- 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.
- True
- 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?
- To Update table
- To Create table
- To Delete table
- 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?
- INT
- Number
- Digit
- 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?
- DELETE
- DROP
- ALTER
- 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?
- 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.
- 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.
- DELETE statement only deletes rows from the table whereas TRUNCATE statement can only delete columns from the table.
- 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:
- Table structure is dropped
- Integrity constraints are dropped
- Relationship is dropped
- 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:
- Table structure is dropped
- Integrity constraints are dropped
- Relationship is dropped
- 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?
- RENAME
- ALTER
- Both A) and B)
- 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:
- WHERE clause
- HAVING clause
- Both a and b
- 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.
- TRUNCATE TABLE is faster than DELETE TABLE statement.
- TRUNCATE TABLE uses fewer resources than DELETE TABLE statement.
- Both A) and B)
- 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 -
- Select the content from a table.
- Rename the content in a table.
- Copy the content from one table into another existing table.
- 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?
- At run time, temporary tables can be created.
- Temporary table can do similar operations to normal table.
- Both A) and B)
- 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
- 2
- 3
- 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?
- Local Temp
- Global Temp
- Both A) and B)
- 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?
- ?
- @
- #
- &
Answer: C) #
Explanation:
Local Temp Variable is used with # sign.
Discuss this Question
20. Global Temp Variable is used with which sign?
- ###
- ####
- #
- ##
Answer: D) ##
Explanation:
Global Temp Variable is used with Double-Hash (##) sign.
Discuss this Question