COPA Module 8: Database Concepts (SQL & DBMS) – all 25 MCQ questions with answers
What is the error in the below statement?
Answer: Return type missing – A SQL function must declare what it returns – 'returns integer' is missing.
Which system is responsible for ensuring durability?
Answer: Recovery system – The recovery system restores the database after failures, ensuring durability.
What is full form of DDL?
Answer: Data Definition Language – DDL = Data Definition Language (CREATE, ALTER, DROP, TRUNCATE).
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.
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.
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.
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.
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.
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.
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.
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.
What is the use of below statement?
Answer: Handling exception – DECLARE … HANDLER defines what to do when an error/condition occurs – exception handling.
What is full form of DML?
Answer: Data Manipulation Language – DML = Data Manipulation Language (SELECT, INSERT, UPDATE, DELETE).
Which is a type of database?
Answer: Relational – A relational database stores data in related tables of rows and columns (e.g. MySQL).
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.
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).
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.
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.
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.
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.
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.
Which is the logical design of the database?
Answer: Schema – The schema is the logical design (structure) of the whole database.
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.
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.
Which are TCL commands?
Answer: COMMIT and ROLLBACK – TCL (Transaction Control Language) commands are COMMIT, ROLLBACK and SAVEPOINT.