Sample questions
Question 1Easy
A field that uniquely identifies each record in a table is the:
- Foreign key
- Candidate field
- Primary key
- Index only
Answer: C. Primary key
Explanation
A primary key cannot be NULL or repeated.
Step-by-step solution
- A primary key uniquely identifies each record.
- It cannot be NULL or repeated.
Why the other options are wrong
- A. A foreign key refers to another table's key.
- B. 'Candidate field' is not standard; candidate keys are possible choices for primary key.
- D. An index speeds up searching but does not have to be unique.
Question 2Easy
In a database table, a row is also called a:
- Field
- Attribute
- Key
- Record (tuple)
Answer: D. Record (tuple)
Explanation
Each row describes one entity, like one student.
Step-by-step solution
- A row holds all the data about one item.
- It is called a record, or a tuple in relational terms.
Why the other options are wrong
- A. A field is a column.
- B. Attribute is another name for a column.
- C. A key is a column used to identify rows.
Question 3Easy
In a database table, a column is also called a:
- Record
- Field (attribute)
- Tuple
- Row
Answer: B. Field (attribute)
Explanation
Each column holds one kind of data, like 'Name'.
Step-by-step solution
- A column holds one kind of data for every row.
- It is called a field, or an attribute.
Why the other options are wrong
- A. A record is a row.
- C. A tuple is a row.
- D. A row is a record.
Question 4Easy
Which SQL command is used to retrieve data from a table?
- GET
- FETCH
- SELECT
- RETRIEVE
Answer: C. SELECT
Explanation
SELECT ... FROM ... is the basic query.
Step-by-step solution
- SELECT reads data from a table.
- Example: SELECT name FROM students WHERE class = '10A';
Why the other options are wrong
- A. GET is an HTTP method, not SQL.
- B. FETCH is used with cursors, not to query a table directly.
- D. RETRIEVE is not an SQL command.
Question 5Medium
Which clause in SQL is used to filter rows?
- ORDER BY
- GROUP BY
- FROM
- WHERE
Answer: D. WHERE
Explanation
Example: SELECT * FROM students WHERE marks > 60.
Step-by-step solution
- Filtering keeps only rows that meet a condition.
- WHERE does this, e.g. SELECT * FROM students WHERE marks > 60.
Why the other options are wrong
- A. ORDER BY sorts rows; it does not remove any.
- B. GROUP BY collects rows into groups for totals or counts.
- C. FROM names the table to read from.
Tip: WHERE filters rows, HAVING filters groups.
Question 6Medium
Which SQL command removes a whole table, including its structure?
- DROP TABLE
- DELETE
- REMOVE
- TRUNCATE
Answer: A. DROP TABLE
Explanation
DELETE removes rows; DROP removes the table itself.
Step-by-step solution
- Removing the table itself, structure and all, is DROP TABLE.
- DELETE and TRUNCATE remove rows but leave an empty table behind.
Why the other options are wrong
- B. DELETE removes rows (all or some) but the table still exists.
- C. REMOVE is not an SQL command.
- D. TRUNCATE removes all rows quickly but keeps the table structure.
Tip: DELETE removes rows (some or all), TRUNCATE removes all rows, DROP removes the whole table.
Question 7Medium
A large central store of integrated historical data used for reporting and analysis is a:
- Spreadsheet
- Cache
- Data warehouse
- Router
Answer: C. Data warehouse
Explanation
Data warehouses support business intelligence.
Step-by-step solution
- A central store of integrated historical data for reporting is a data warehouse.
- It collects data from many systems for analysis.
Why the other options are wrong
- A. A spreadsheet is a single file, not an organisation-wide store.
- B. A cache is a small fast store for recently used data.
- D. A router forwards network traffic.
Question 8Medium
SELECT, INSERT, UPDATE and DELETE belong to:
- DDL
- DML (Data Manipulation Language)
- DCL
- TCL
Answer: B. DML (Data Manipulation Language)
Explanation
DML works with the data in tables.
Step-by-step solution
- SELECT, INSERT, UPDATE and DELETE read or change rows.
- Commands that work on data form DML, Data Manipulation Language.
Why the other options are wrong
- A. DDL changes structure (CREATE, ALTER, DROP).
- C. DCL handles permissions (GRANT, REVOKE).
- D. TCL handles transactions (COMMIT, ROLLBACK).
Question 9Hard
GRANT and REVOKE are examples of:
- DDL
- DML
- DCL (Data Control Language)
- TCL
Answer: C. DCL (Data Control Language)
Explanation
DCL controls access permissions.
Step-by-step solution
- GRANT gives a user a permission; REVOKE takes it back.
- Permission commands form DCL, Data Control Language.
Why the other options are wrong
- A. DDL defines structure, not who may use it.
- B. DML works on the data itself.
- D. TCL saves or undoes transactions.
Tip: Control = DCL = GRANT and REVOKE.
Question 10Hard
COMMIT and ROLLBACK are examples of:
- DDL
- DCL
- TCL (Transaction Control Language)
- DML
Answer: C. TCL (Transaction Control Language)
Explanation
They save or undo the changes of a transaction.
Step-by-step solution
- COMMIT makes a transaction's changes permanent; ROLLBACK undoes them.
- Commands that manage transactions form TCL, Transaction Control Language.
Why the other options are wrong
- A. DDL defines structure.
- B. DCL grants or revokes permissions.
- D. DML changes data, but COMMIT/ROLLBACK decide whether those changes are kept.
Tip: COMMIT = save, ROLLBACK = undo; both are TCL.
Practise all 28 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →