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
281
What does DCL stand for in the context of SQL?
Answer:
Data Control Language
DCL stands for Data Control Language and is used to control access to data within the database. Its main commands are `GRANT` and `REVOKE`.
282
How many copies of the database schema are typically used in a redesign process?
Answer:
Three
In a professional environment, it's common to have three copies: the production (live) schema, a test schema for quality assurance, and a development schema for making changes.
283
Can a primary key be made up of more than one column?
Answer:
Yes, this is called a composite primary key.
Yes, when a single column is not sufficient to uniquely identify a row, two or more columns can be combined to form a composite primary key.
284
What is the primary difference between `UNION` and `UNION ALL`?
Answer:
`UNION ALL` includes duplicates, `UNION` does not.
Both combine result sets, but `UNION` performs a `DISTINCT` operation to remove duplicate rows from the final result set, while `UNION ALL` includes all rows from all queries, including duplicates. `UNION ALL` is faster as it doesn't have to check for duplicates.
285
What does SQL stand for?
Answer:
Structured Query Language
SQL is used to manage and manipulate relational databases.
286
What is the main purpose of a foreign key constraint?
Answer:
To enforce referential integrity between two tables.
The primary purpose of a foreign key is to enforce referential integrity. This means that a value in the foreign key column of one table must match an existing value in the primary key column of the related table, preventing orphaned records.
287
A relation is in BCNF if and only if every determinant is a:
Answer:
Candidate key (or superkey)
The formal definition of Boyce-Codd Normal Form (BCNF) is that for every non-trivial functional dependency X → Y in a table, X must be a superkey (which means it's a candidate key or contains a candidate key).
288
Which of the following is NOT a type of data anomaly that normalization helps to prevent?
Answer:
Concurrency Anomaly
Update, Insertion, and Deletion anomalies are problems related to data redundancy that are addressed by normalization. Concurrency anomalies are issues that arise from multiple simultaneous transactions and are managed by the DBMS's concurrency control mechanisms, not by normalization.
289
Which of the following is true of a network structure?
Answer:
It allows a many-to-many relationship
Unlike the hierarchical model, the network data model is more flexible. It represents relationships as a graph, allowing a record to have multiple "parent" records, which effectively supports the modeling of complex many-to-many relationships between data entities.
290
Which SQL statement is used to update data in a database?
Answer:
UPDATE
The UPDATE statement is the standard SQL command used to modify existing records in a table. You use a WHERE clause to specify which record(s) should be updated.