Computer Science/IT MCQs
Topic Notes: Computer Science/IT
MCQs and preparation resources for competitive exams, covering important concepts, past papers, and detailed explanations.
Plato
- Biography: Ancient Greek philosopher (427–347 BCE), student of Socrates and teacher of Aristotle, founder of the Academy in Athens.
- Important Ideas:
- Theory of Forms
- Philosopher-King
- Ideal State
151
Which normal form is primarily concerned with removing transitive dependencies?
Answer:
Third Normal Form (3NF)
A table is in 3NF if it is in 2NF and it contains no transitive dependencies. A transitive dependency is when a non-key attribute is dependent on another non-key attribute.
152
Which SQL clause is used to filter the records returned by a `SELECT` statement based on a specific condition?
Answer:
`WHERE`
The `WHERE` clause is used to extract only those records that fulfill a specified condition. It filters rows before any groupings are made.
153
Which clause is used in conjunction with aggregate functions to filter the results of a `GROUP BY` clause?
Answer:
`HAVING`
While the `WHERE` clause filters rows before they are grouped, the `HAVING` clause is used to filter the groups themselves after the `GROUP BY` clause has been applied. It acts as a filter on the results of aggregate functions.
154
What is the role of a query language in a DBMS?
Answer:
All of the above
A comprehensive query language like SQL (Structured Query Language) serves multiple roles. It includes a Data Definition Language (DDL) to define structure, a Data Manipulation Language (DML) to insert, update, and delete data, and a Data Query Language (DQL) to retrieve data.
155
A dependency where a non-key attribute determines another non-key attribute is a:
Answer:
Transitive dependency
This is the definition of a transitive dependency. If A → B and B → C (where A is the primary key and B and C are non-key attributes), then C is transitively dependent on A. 3NF eliminates these dependencies.
156
The `ON DELETE CASCADE` clause in a foreign key constraint means:
Answer:
You cannot delete a row in the parent table if child rows exist.
`ON DELETE CASCADE` is a referential action that automatically deletes all matching records in the child table when a record in the parent table is deleted. This helps maintain referential integrity.
157
Which data anomaly occurs when the deletion of data about one entity unintentionally leads to the loss of data about a completely different entity?
Answer:
Deletion Anomaly
A deletion anomaly exists when certain attributes are lost because of the deletion of other attributes. For example, if you delete the last student enrolled in a course, the information about the course itself might be lost if it's stored in the same table.
158
After developing a model for your database, you should:
Answer:
Normalize it
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
159
The main advantage of the network model over the hierarchical model is its ability to:
Answer:
Handle many-to-many relationships directly.
The network model's key improvement over the hierarchical model was its ability to model complex relationships, specifically many-to-many relationships, more naturally by allowing a child record to have multiple parent records.
160
If you try to insert a row with a primary key value that already exists, the database will:
Answer:
Reject the insertion due to a constraint violation.
The primary key constraint enforces uniqueness. Attempting to insert a duplicate value will result in an error, and the operation will be aborted to maintain entity integrity.