COPA Module 8: Database Concepts (SQL & DBMS) – all 25 MCQ questions with answers

  1. What is the error in the below statement?

    Answer: Return type missing – A SQL function must declare what it returns – 'returns integer' is missing.

  2. Which system is responsible for ensuring durability?

    Answer: Recovery system – The recovery system restores the database after failures, ensuring durability.

  3. What is full form of DDL?

    Answer: Data Definition Language – DDL = Data Definition Language (CREATE, ALTER, DROP, TRUNCATE).

  4. What does the following statement in SQL do?

    Answer: Deletes a table called student – DROP TABLE removes the whole table – its structure and all its data.

  5. Which of the following is TRUE about DDL command?

    Answer: Creation, deletion and alteration – DDL commands create, delete and alter database objects such as tables.

  6. Which is used to input the entry and give the result in a variable in a procedure?

    Answer: In and out – IN parameters pass values into a procedure and OUT parameters return results.

  7. Which scheme controls the interaction between executing transaction?

    Answer: Concurrency control scheme – Concurrency control manages transactions running at the same time so data stays correct.

  8. Which collection of operations form a single logical unit of work?

    Answer: Transactions – A transaction is a group of operations treated as one logical unit – all or none.

  9. Which unit is considered if the domain of the element is atomic?

    Answer: Indivisible units – Atomic means the value cannot be divided further – an indivisible unit.

  10. What is the set of permitted values for each attribute of a relation called as?

    Answer: Domain – The domain of an attribute is the set of all values it is allowed to take.

  11. Why query should be executed successfully on a existing view?

    Answer: SELECT privilege on the view – To query a view, the user needs SELECT privilege on that view.

  12. What is the use of below statement?

    Answer: Handling exception – DECLARE … HANDLER defines what to do when an error/condition occurs – exception handling.

  13. What is full form of DML?

    Answer: Data Manipulation Language – DML = Data Manipulation Language (SELECT, INSERT, UPDATE, DELETE).

  14. Which is a type of database?

    Answer: Relational – A relational database stores data in related tables of rows and columns (e.g. MySQL).

  15. What is the format for compound statement?

    Answer: both begin ……. end and begin atomic……. end – Compound statements are written as begin … end, or begin atomic … end.

  16. Which query calculates a sum, average and then groups the result by two sets of values?

    Answer: Cross-tab – A crosstab query calculates sum/average and groups results by two sets of values (rows × columns).

  17. Which database aspect preserves execution of translation in isolation?

    Answer: Consistency – As per the question bank, consistency keeps the database correct when a transaction runs alone.

  18. What does the term "attribute" refers to in a table?

    Answer: Column – In a table, an attribute is a column (field); a row is a record/tuple.

  19. Which is the best way to represent the attributes in a large database?

    Answer: Concatenation – As per the question bank, concatenation is used to represent attributes in a large database.

  20. What does the following code snippet do?

    Answer: Adds a column ADDRESS in the table – ALTER TABLE … ADD adds a new column (ADDRESS) to an existing table.

  21. Which command is used to obtain the structure of an Oracle table?

    Answer: DESCRIBE [TableName]. – DESCRIBE (or DESC) shows the columns and data types of an Oracle table.

  22. Which is the logical design of the database?

    Answer: Schema – The schema is the logical design (structure) of the whole database.

  23. What is the order for the tuples of the relations?

    Answer: Any – A relation is a set, so its tuples (rows) can be in any order.

  24. Which of the following is used to call the procedure given above?

    Answer: Declare d_count integer; call dept_count proc(’Physics’, d_count); – Declare a variable for the OUT parameter, then CALL the procedure with both arguments.

  25. Which are TCL commands?

    Answer: COMMIT and ROLLBACK – TCL (Transaction Control Language) commands are COMMIT, ROLLBACK and SAVEPOINT.