Databases Questions with Answers

28 practice questions on Databases (Computer Fundamentals) with answers and step-by-step solutions. Try 10 samples below, then practise all 28 free in the AptiNest app.

Sample questions

Question 1Easy

A field that uniquely identifies each record in a table is the:

  1. Foreign key
  2. Candidate field
  3. Primary key
  4. Index only

Answer: C. Primary key

Explanation

A primary key cannot be NULL or repeated.

Step-by-step solution

  1. A primary key uniquely identifies each record.
  2. 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:

  1. Field
  2. Attribute
  3. Key
  4. Record (tuple)

Answer: D. Record (tuple)

Explanation

Each row describes one entity, like one student.

Step-by-step solution

  1. A row holds all the data about one item.
  2. 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:

  1. Record
  2. Field (attribute)
  3. Tuple
  4. Row

Answer: B. Field (attribute)

Explanation

Each column holds one kind of data, like 'Name'.

Step-by-step solution

  1. A column holds one kind of data for every row.
  2. 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?

  1. GET
  2. FETCH
  3. SELECT
  4. RETRIEVE

Answer: C. SELECT

Explanation

SELECT ... FROM ... is the basic query.

Step-by-step solution

  1. SELECT reads data from a table.
  2. 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?

  1. ORDER BY
  2. GROUP BY
  3. FROM
  4. WHERE

Answer: D. WHERE

Explanation

Example: SELECT * FROM students WHERE marks > 60.

Step-by-step solution

  1. Filtering keeps only rows that meet a condition.
  2. 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?

  1. DROP TABLE
  2. DELETE
  3. REMOVE
  4. TRUNCATE

Answer: A. DROP TABLE

Explanation

DELETE removes rows; DROP removes the table itself.

Step-by-step solution

  1. Removing the table itself, structure and all, is DROP TABLE.
  2. 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:

  1. Spreadsheet
  2. Cache
  3. Data warehouse
  4. Router

Answer: C. Data warehouse

Explanation

Data warehouses support business intelligence.

Step-by-step solution

  1. A central store of integrated historical data for reporting is a data warehouse.
  2. 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:

  1. DDL
  2. DML (Data Manipulation Language)
  3. DCL
  4. TCL

Answer: B. DML (Data Manipulation Language)

Explanation

DML works with the data in tables.

Step-by-step solution

  1. SELECT, INSERT, UPDATE and DELETE read or change rows.
  2. 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:

  1. DDL
  2. DML
  3. DCL (Data Control Language)
  4. TCL

Answer: C. DCL (Data Control Language)

Explanation

DCL controls access permissions.

Step-by-step solution

  1. GRANT gives a user a permission; REVOKE takes it back.
  2. 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:

  1. DDL
  2. DCL
  3. TCL (Transaction Control Language)
  4. DML

Answer: C. TCL (Transaction Control Language)

Explanation

They save or undo the changes of a transaction.

Step-by-step solution

  1. COMMIT makes a transaction's changes permanent; ROLLBACK undoes them.
  2. 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 →

Related topics

See all Computer Fundamentals topics · All topics