B.S.W.E. Bachelor of Software Engineering Database Systems & SQL 1 — Questions and Answers
Question 1: What does ACID stand for in database transactions?
- Atomicity, Consistency, Isolation, Durability (Correct answer)
- Association, Constraint, Index, Data
- Aggregate, Commit, Insert, Delete
- Authentication, Consistency, Integrity, Distribution
Correct answer: Atomicity, Consistency, Isolation, Durability
ACID (Atomicity, Consistency, Isolation, Durability) defines the properties that guarantee database transactions are processed reliably.
Question 2: Which SQL command removes a table and all its data permanently?
- DELETE
- TRUNCATE
- DROP (Correct answer)
- REMOVE
Correct answer: DROP
DROP TABLE removes the entire table structure along with all its data and the schema definition from the database.
Question 3: What is a foreign key in a relational database?
- A primary key in a different format
- A field referencing the primary key of another table (Correct answer)
- An encrypted key for secure access
- A unique identifier generated automatically
Correct answer: A field referencing the primary key of another table
A foreign key is a column that establishes a referential link between two tables by pointing to the primary key of another table.
Question 4: What type of JOIN returns all rows when there is a match in either table?
- INNER JOIN
- LEFT JOIN
- RIGHT JOIN
- FULL OUTER JOIN (Correct answer)
Correct answer: FULL OUTER JOIN
A FULL OUTER JOIN returns all rows from both tables, filling with NULL values where no match exists in either table.
Question 5: What is normalization in database design?
- Converting data to normal distribution
- Organizing data to reduce redundancy and improve integrity (Correct answer)
- Indexing all columns for performance
- Encrypting sensitive data
Correct answer: Organizing data to reduce redundancy and improve integrity
Normalization organizes a database structure to reduce data redundancy and improve data integrity through a series of normal forms.
Question 6: Which SQL aggregate function returns the number of rows matching a condition?
- SUM()
- AVG()
- COUNT() (Correct answer)
- MAX()
Correct answer: COUNT()
COUNT() returns the number of rows that match a specified condition or the total rows in a result set.
What does ACID stand for in database transactions?