Databases and SQL Quiz - CBSE Class 12 Computer Science
Free practice quiz: Databases and SQL (CBSE Class 12 Computer Science). 16 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
This CBSE Class 12 Computer Science practice quiz has 16 multiple-choice questions on Databases and SQL, and 16 of them come with an explanation. Try the 5 sample questions below (tap an option to check yourself), then play the full quiz online. No sign-up needed.
Start quiz: 16 questions, freeSample questions
Which SQL command is used to retrieve data from a database?
Show answer
Answer: A. SELECT
The SELECT statement is used to query data from a database. INSERT adds data, UPDATE modifies data, and DELETE removes data.
Explain the difference between INNER JOIN and LEFT JOIN in SQL.
Show answer
Answer: B. INNER JOIN returns only matching rows, LEFT JOIN returns all rows from the left table and matching rows from the right.
INNER JOIN only includes rows where there is a match in both tables. LEFT JOIN includes all rows from the left table, even if there's no match in the right table.
What is a relational database management system (RDBMS)?
Show answer
Answer: D. A system for managing data stored in relations (tables).
RDBMS organizes data into tables with rows and columns, establishing relationships between tables for efficient data management and retrieval.
Explain the concept of ACID properties in database transactions.
Show answer
Answer: A. Atomicity, Consistency, Isolation, Durability
ACID properties (Atomicity, Consistency, Isolation, Durability) ensure reliable database transactions. Atomicity means all or nothing; Consistency maintains data integrity; Isolation prevents interference; Durability ensures data persistence.
What is the purpose of the WHERE clause in an SQL SELECT statement?
Show answer
Answer: C. To filter the rows based on a condition
The WHERE clause is used to filter the rows in a SQL SELECT statement, returning only the rows that satisfy a specified condition.
More questions in this quiz
Answers and explanations are in the full quiz.
- What does SQL stand for?
- What is a primary key in a relational database?
- How would you retrieve all rows from a table named 'Customers' where the 'Country' column is 'USA'?
- Write an SQL query to create a table named 'Products' with columns 'ProductID' (INT, primary key), 'ProductName' (VARCHAR(50)), and 'Price' (DECIMAL(10,2)).
- Describe the use of 'GROUP BY' clause in SQL.
- What is a transaction in the context of a database?
- Consider two tables, 'Orders' and 'Customers', with a common column 'CustomerID'. Write an SQL query to retrieve the order details along with customer information using an appropriate JOIN.
- What is a database index, and how does it improve query performance?
- What is normalization in database design, and why is it important?
- Explain the difference between DELETE and TRUNCATE commands in SQL.
- How can you ensure data consistency in a database system?
Browse all Database Management quizzes