Back to Blog
Subject Guide
2026-11-11
33 min read

100 Database and SQL MCQs for NAT-ICS-Style Practice

By McqsBase Team · Editorial policy and corrections

Database Fundamentals and SQL MCQs Practice Set for November 11, 2026

This independent practice set focuses on database fundamentals and introductory SQL for learners preparing for computer-science entry tests, including NAT-ICS-style study. It moves from core terminology and relational keys to normalization, queries, joins, constraints, and transaction concepts. The questions are practice material, not a claim about any official test syllabus; check the latest official notice for test arrangements and covered topics.

Why this Database Fundamentals and SQL set is useful

Work through 100 original database and SQL MCQs with four options and explanations. The set covers relational database vocabulary, keys, normalization, basic SQL statements, filtering, grouping, joins, constraints, and transactions. Use the explanations to identify whether an error came from a concept, a query rule, or a calculation. Start with this focused set, then continue with the MCQsBase question bank, online quiz practice, past papers, and the complete MCQsBase blog.

Test focus topics

No.Focus AreaWhat to Practice
1Database foundationsDistinguish data from information, DBMS functions, schemas, tables, records, fields, and domains.
2Relational keys and designIdentify primary, candidate, composite, and foreign keys, and recognize common normalization goals.
3SQL fundamentalsRead SELECT statements, conditions, sorting, aggregate functions, and grouped queries.
4Joins and constraintsPredict which rows joins return and understand common table constraints.
5Transactions and indexesReview transaction properties, commit and rollback, and the basic purpose of indexes.

What this set covers

SectionQuestionsFocus
Set 11-20Core Database Fundamentals and SQL fundamentals
Set 221-40Foundational test concepts
Set 341-60Mixed exam-style practice
Set 461-80Fast recall and elimination practice
Set 581-100Final revision and score-building
1-20. Database Fundamentals and SQL MCQs
Choose one option, then check the bold answer.
Q1MCQ Practice
Answer A

Which statement best distinguishes data from information?

A.Data are raw facts; information is data processed into a meaningful form.
B.Data are always numbers; information is always text.
C.Data are stored only in files; information is stored only in databases.
D.Data are conclusions; information is unprocessed observations.

Correct Answer

A) Data are raw facts; information is data processed into a meaningful form.
Data are recorded facts or observations. Organizing or interpreting them to provide meaning produces information.

Q2MCQ Practice
Answer A

What is the main role of a database management system (DBMS)?

A.To manage the creation, storage, retrieval, and control of database data
B.To replace every operating system on a computer
C.To convert all database values into images
D.To guarantee that stored data can never be changed

Correct Answer

A) To manage the creation, storage, retrieval, and control of database data
A DBMS provides facilities for defining, accessing, and managing data. It does not make data unchangeable or replace the operating system.

Q3MCQ Practice
Answer A

In a relational database, a table is also commonly called a:

A.Relation
B.Pointer
C.Compiler
D.Protocol

Correct Answer

A) Relation
The relational model represents data as relations, commonly displayed as tables of rows and columns.

Q4MCQ Practice
Answer A

In a relational table, one row describing one entity or event is called a:

A.Tuple
B.Domain
C.View
D.Constraint

Correct Answer

A) Tuple
A tuple is a row in a relation. A column is an attribute, while a domain is the set of permitted values for an attribute.

Q5MCQ Practice
Answer A

In a table, what does an attribute represent?

A.A column describing a property
B.A complete database backup
C.A group of unrelated databases
D.A transaction log entry only

Correct Answer

A) A column describing a property
An attribute represents a property recorded for each tuple and is typically shown as a table column.

Q6MCQ Practice
Answer A

What is a domain in the relational model?

A.The permitted set of values for an attribute
B.The number of tables in a database
C.A query that removes duplicate rows
D.A key shared by every database

Correct Answer

A) The permitted set of values for an attribute
An attribute's domain defines the values considered valid for it, such as integers or a restricted set of codes.

Q7MCQ Practice
Answer A

What does a database schema primarily describe?

A.The database's structure and defined objects
B.The current value of every row at a particular second
C.The physical location of every user
D.The sequence of keyboard commands used to open a database

Correct Answer

A) The database's structure and defined objects
A schema describes structures such as tables, columns, and constraints. The data currently stored is the database state or instance.

Q8MCQ Practice
Answer A

What is a database instance in this context?

A.The data stored in the database at a particular time
B.A rule that every table must have exactly two columns
C.A diagram of a network connection
D.A programming language used only for sorting

Correct Answer

A) The data stored in the database at a particular time
An instance is the database's current contents at a given moment; the schema is its defined structure.

Q9MCQ Practice
Answer A

Which is a typical benefit of storing related records in a database rather than separate, uncontrolled files?

A.Centralized control can help reduce inconsistent duplicate data.
B.A database eliminates the need to validate data.
C.Every database automatically prevents all unauthorized access.
D.A database makes every query run in constant time.

Correct Answer

A) Centralized control can help reduce inconsistent duplicate data.
Shared database management can reduce needless duplication and improve consistency. It does not remove the need for validation, security, or performance planning.

Q10MCQ Practice
Answer A

Which key is selected to identify each row uniquely in a table?

A.Primary key
B.Foreign key
C.Sort key
D.Display key

Correct Answer

A) Primary key
A primary key identifies rows uniquely and cannot contain a NULL value in the relational model.

Q11MCQ Practice
Answer A

A table has two different minimal column sets that each uniquely identify every row. What are both sets called before one is chosen as the primary key?

A.Candidate keys
B.Foreign keys
C.Partial dependencies
D.Non-key attributes

Correct Answer

A) Candidate keys
Each minimal unique identifier is a candidate key. One candidate is selected as the primary key.

Q12MCQ Practice
Answer A

A key consists of both StudentID and CourseID because neither column alone uniquely identifies an enrolment. What kind of key is it?

A.Composite key
B.Foreign key
C.Surrogate value
D.Single-column key

Correct Answer

A) Composite key
A composite key contains more than one attribute. Here the pair identifies each enrolment even though either component alone does not.

Q13MCQ Practice
Answer A

In an Enrolment table, StudentID refers to Student.StudentID. What role does Enrolment.StudentID play?

A.Foreign key
B.Candidate key by definition
C.Database schema
D.Aggregate function

Correct Answer

A) Foreign key
A foreign key refers to a key in another table, helping represent and enforce a relationship between the tables.

Q14MCQ Practice
Answer A

Which property is required of a primary key value in each row?

A.It must be unique and non-NULL.
B.It must be a text value.
C.It must be identical in all rows.
D.It must be calculated from the row number.

Correct Answer

A) It must be unique and non-NULL.
A primary key must distinguish each row, so duplicate and NULL key values are not permitted.

Q15MCQ Practice
Answer A

A table's chosen primary key uses StudentNumber, but Email is also unique and non-NULL. How is Email best described?

A.An alternate candidate key
B.A foreign key necessarily
C.A composite key necessarily
D.A repeating group

Correct Answer

A) An alternate candidate key
Email is another candidate key; because StudentNumber was selected as the primary key, Email is an alternate candidate key.

Q16MCQ Practice
Answer A

What does a referential-integrity rule generally require of a non-NULL foreign-key value?

A.It matches a referenced key value in the related table.
B.It is greater than every value in its own table.
C.It is unique across the entire database.
D.It contains no letters.

Correct Answer

A) It matches a referenced key value in the related table.
Referential integrity prevents a foreign key from referring to a missing parent row, subject to the database's defined rules.

Q17MCQ Practice
Answer A

A column is constrained to contain no duplicate values. Which common SQL constraint expresses this rule?

A.UNIQUE
B.ORDER BY
C.GROUP BY
D.ROLLBACK

Correct Answer

A) UNIQUE
A UNIQUE constraint disallows duplicate values in the constrained column or column combination. Its NULL handling can vary by DBMS.

Q18MCQ Practice
Answer A

A table requires every row to have a value in its ContactName column. Which constraint expresses this requirement?

A.NOT NULL
B.DEFAULT
C.FOREIGN KEY
D.INDEX

Correct Answer

A) NOT NULL
NOT NULL requires a value for that column. A DEFAULT supplies a value when one is omitted but does not express the same rule.

Q19MCQ Practice
Answer A

Which statement about a foreign key is generally correct?

A.It may contain repeated values when several rows refer to the same parent.
B.It must always be the primary key of its own table.
C.It must be unique in every table.
D.It cannot refer to a column in another table.

Correct Answer

A) It may contain repeated values when several rows refer to the same parent.
Many child rows can refer to one parent row, so a foreign key is often repeated. It need not be the child table's primary key.

Q20MCQ Practice
Answer A

Which issue is most directly associated with a repeating group in a table, such as storing Phone1, Phone2, and Phone3 for the same kind of value?

A.The structure is not in first normal form.
B.The table necessarily has no candidate key.
C.The table is already in third normal form.
D.The table has a transaction isolation problem.

Correct Answer

A) The structure is not in first normal form.
First normal form requires values in each row-column position to be atomic in the intended model, rather than storing repeating groups of the same attribute.

21-40. Database Fundamentals and SQL MCQs
Choose one option, then check the bold answer.
Q21MCQ Practice
Answer A

A relation is in first normal form when, among other requirements, each field contains:

A.One atomic value for that row and column
B.An entire unrelated table
C.A list of all possible values
D.A mandatory foreign key

Correct Answer

A) One atomic value for that row and column
First normal form avoids repeating groups and multivalued fields by representing each field with one value in the chosen relational design.

Q22MCQ Practice
Answer A

For a table with a composite candidate key, what does second normal form rule out?

A.Partial dependency of a non-key attribute on only part of a candidate key
B.Every foreign-key relationship
C.All NULL values in every possible column
D.Every use of a numeric attribute

Correct Answer

A) Partial dependency of a non-key attribute on only part of a candidate key
Second normal form requires first normal form and removes partial dependencies of non-key attributes on a proper subset of a candidate key.

Q23MCQ Practice
Answer A

A relation is in third normal form, under the usual introductory definition, if it is in second normal form and has no:

A.Transitive dependency of a non-key attribute on a key
B.Primary key
C.Numeric column
D.Foreign-key reference

Correct Answer

A) Transitive dependency of a non-key attribute on a key
Third normal form removes non-key attributes that depend transitively on a key through another non-key attribute.

Q24MCQ Practice
Answer A

In a table keyed by (StudentID, CourseID), suppose StudentName depends only on StudentID. What design issue does this illustrate?

A.Partial dependency
B.Transitive dependency only
C.Referential integrity
D.A sorting anomaly

Correct Answer

A) Partial dependency
StudentName depends on only part of the composite key, StudentID, rather than the whole key; this is the partial-dependency issue addressed by second normal form.

Q25MCQ Practice
Answer A

In a relation, suppose EmployeeID determines DepartmentID and DepartmentID determines DepartmentName. If EmployeeID is the key, what dependency of DepartmentName on EmployeeID is illustrated?

A.Transitive dependency
B.Partial dependency on a composite key
C.Multivalued primary key
D.Referential action

Correct Answer

A) Transitive dependency
EmployeeID determines DepartmentName through DepartmentID. The non-key attribute is therefore transitively dependent on the key.

Q26MCQ Practice
Answer A

Which problem can arise when the same department name is repeated in every employee row and is updated inconsistently?

A.Update anomaly
B.Compilation error
C.Cartesian coordinate
D.Deadlock by definition

Correct Answer

A) Update anomaly
Duplicated facts can require multiple updates; if some copies are missed, the database holds conflicting values.

Q27MCQ Practice
Answer A

A department's details cannot be stored until at least one employee is assigned to it. Which common anomaly is this?

A.Insertion anomaly
B.Sorting anomaly
C.Projection anomaly
D.Index anomaly

Correct Answer

A) Insertion anomaly
An insertion anomaly occurs when a design makes it difficult to record one fact without also recording an unrelated fact.

Q28MCQ Practice
Answer A

Deleting the last employee row also unintentionally removes the only stored details of that employee's department. What is this called?

A.Deletion anomaly
B.Join condition
C.Candidate key
D.Domain constraint

Correct Answer

A) Deletion anomaly
A deletion anomaly loses a separate fact as a side effect of deleting a row that combines multiple kinds of information.

Q29MCQ Practice
Answer A

Which SQL statement is used to retrieve rows from a table?

A.SELECT
B.INSERT
C.UPDATE
D.DROP

Correct Answer

A) SELECT
SELECT retrieves data. INSERT adds rows, UPDATE changes existing values, and DROP removes a database object.

Q30MCQ Practice
Answer A

Which SQL statement adds a new row to a table?

A.INSERT
B.SELECT
C.ALTER
D.COMMIT

Correct Answer

A) INSERT
INSERT adds rows to a table. SELECT reads rows, while ALTER changes a database object's definition.

Q31MCQ Practice
Answer A

Which SQL statement changes existing values in selected rows?

A.UPDATE
B.CREATE
C.SELECT
D.GRANT

Correct Answer

A) UPDATE
UPDATE modifies values in rows that meet its conditions. A missing or incorrect WHERE condition can affect unintended rows.

Q32MCQ Practice
Answer A

Which SQL statement removes selected rows from a table while leaving the table definition in place?

A.DELETE
B.DROP
C.CREATE
D.RENAME

Correct Answer

A) DELETE
DELETE removes row data. DROP removes a database object itself, including its definition.

Q33MCQ Practice
Answer A

Which SQL command is commonly classified as a data-definition language (DDL) command?

A.CREATE TABLE
B.SELECT
C.INSERT
D.UPDATE

Correct Answer

A) CREATE TABLE
CREATE TABLE defines a database structure, so it is DDL. SELECT, INSERT, and UPDATE operate on data.

Q34MCQ Practice
Answer A

Which SQL command is commonly classified as a data-manipulation language (DML) command?

A.INSERT
B.CREATE DATABASE
C.ALTER TABLE
D.DROP TABLE

Correct Answer

A) INSERT
INSERT manipulates table data. CREATE, ALTER, and DROP define or change database objects.

Q35MCQ Practice
Answer A

Which clause chooses the columns to appear in a query result?

A.SELECT
B.WHERE
C.ORDER BY
D.HAVING

Correct Answer

A) SELECT
The SELECT list specifies the output expressions or columns; WHERE filters rows and ORDER BY sorts the result.

Q36MCQ Practice
Answer A

Which clause filters individual rows before grouping in a basic SELECT query?

A.WHERE
B.HAVING
C.ORDER BY
D.AS

Correct Answer

A) WHERE
WHERE filters rows before grouping and aggregation. HAVING filters groups after grouping.

Q37MCQ Practice
Answer A

Which clause sorts the rows returned by a query?

A.ORDER BY
B.GROUP BY
C.WHERE
D.VALUES

Correct Answer

A) ORDER BY
ORDER BY specifies result ordering. Without it, a query does not promise a particular row order.

Q38MCQ Practice
Answer A

In standard SQL usage, what does DISTINCT do in SELECT DISTINCT City FROM Customers?

A.Returns each distinct City value once in the result
B.Sorts all cities alphabetically
C.Deletes duplicate city values from the table
D.Counts the number of cities

Correct Answer

A) Returns each distinct City value once in the result
DISTINCT removes duplicate result rows for the selected expression; it does not alter the stored table or itself specify sorting.

Q39MCQ Practice
Answer A

A query must return employees whose salary is greater than 50000. Which condition is appropriate?

A.WHERE Salary > 50000
B.WHERE Salary < 50000
C.ORDER BY Salary > 50000
D.GROUP BY Salary > 50000

Correct Answer

A) WHERE Salary > 50000
The greater-than comparison in WHERE retains rows whose Salary exceeds 50000; it excludes a salary equal to 50000.

Q40MCQ Practice
Answer A

Which condition selects rows where Status is either Active or Pending?

A.WHERE Status = 'Active' OR Status = 'Pending'
B.WHERE Status = 'Active' AND Status = 'Pending'
C.ORDER BY Status = 'Active' OR 'Pending'
D.GROUP BY Status = 'Active' AND 'Pending'

Correct Answer

A) WHERE Status = 'Active' OR Status = 'Pending'
A row can have either value, so OR is required. With AND, the same Status value would have to equal both strings simultaneously.

41-60. Database Fundamentals and SQL MCQs
Choose one option, then check the bold answer.
Q41MCQ Practice
Answer A

Which SQL condition tests whether a column has no value represented as NULL?

A.ColumnName IS NULL
B.ColumnName = NULL
C.ColumnName == 0
D.ColumnName IS EMPTY

Correct Answer

A) ColumnName IS NULL
SQL uses IS NULL to test for NULL. Equality comparisons with NULL do not provide the intended test.

Q42MCQ Practice
Answer A

Which condition finds names beginning with the letters Al using the SQL LIKE pattern convention?

A.Name LIKE 'Al%'
B.Name LIKE '%Al'
C.Name = 'Al_'
D.Name LIKE '_Al'

Correct Answer

A) Name LIKE 'Al%'
In LIKE patterns, percent represents zero or more characters, so Al% matches strings that begin with Al.

Q43MCQ Practice
Answer A

In a LIKE pattern, what does the underscore wildcard commonly match?

A.Exactly one character
B.Any number of characters
C.Only a digit
D.A missing value

Correct Answer

A) Exactly one character
The underscore wildcard represents one character. Percent, by contrast, represents zero or more characters.

Q44MCQ Practice
Answer A

Which clause groups rows that share the same value in a selected column?

A.GROUP BY
B.ORDER BY
C.WHERE
D.INSERT INTO

Correct Answer

A) GROUP BY
GROUP BY forms groups with matching values, usually so aggregate functions can calculate one result per group.

Q45MCQ Practice
Answer A

Which clause is used to filter groups based on an aggregate result such as COUNT(*)?

A.HAVING
B.WHERE
C.VALUES
D.DISTINCT

Correct Answer

A) HAVING
HAVING filters groups after aggregation; WHERE filters individual rows before groups are formed.

Q46MCQ Practice
Answer A

A query groups orders by CustomerID and should keep customers with at least three orders. Which condition belongs in HAVING?

A.HAVING COUNT(*) >= 3
B.WHERE COUNT(*) >= 3
C.ORDER BY COUNT(*) >= 3
D.GROUP BY COUNT(*) >= 3

Correct Answer

**A) HAVING COUNT(*) >= 3**
The count is computed per group, so the group-level condition uses HAVING rather than WHERE.

Q47MCQ Practice
Answer A

What does COUNT(*) count in a query over a set of rows?

A.The number of rows
B.Only rows whose every column is non-NULL
C.The number of distinct tables
D.The sum of all numeric values

Correct Answer

A) The number of rows
COUNT(*) counts rows, including rows that contain NULL in some columns.

Q48MCQ Practice
Answer A

What does COUNT(Email) count in a SQL query?

A.Rows where Email is not NULL
B.All rows, even when Email is NULL
C.Only distinct email addresses in all SQL systems
D.The total characters in Email values

Correct Answer

A) Rows where Email is not NULL
COUNT(column) ignores NULL values in that column. Use COUNT(DISTINCT Email) when distinct non-NULL values are required.

Q49MCQ Practice
Answer A

For a set of non-NULL numeric values, what does AVG(Score) calculate?

A.Their arithmetic mean
B.Their largest value
C.Their middle value after sorting
D.Their total number of rows

Correct Answer

A) Their arithmetic mean
AVG returns the arithmetic average of non-NULL input values. It is not the median or count.

Q50MCQ Practice
Answer A

Which aggregate function returns the largest value in a set of comparable values?

A.MAX
B.MIN
C.SUM
D.COUNT

Correct Answer

A) MAX
MAX returns the greatest value in the group or result set; MIN returns the smallest.

Q51MCQ Practice
Answer A

If a query uses SUM(Amount), which kind of column is normally appropriate for Amount?

A.A numeric column
B.A table name
C.A join keyword
D.A row identifier made of punctuation only

Correct Answer

A) A numeric column
SUM adds numeric values. A text label or SQL keyword is not a meaningful amount to add.

Q52MCQ Practice
Answer A

A table has values 4, 7, and 9 in its non-NULL Score rows. What is AVG(Score)?

A.6.67 approximately
B.20
C.7
D.9

Correct Answer

A) 6.67 approximately
The mean is (4 + 7 + 9) / 3 = 20/3, approximately 6.67; 7 is the middle value, not the mean.

Q53MCQ Practice
Answer A

What does a basic INNER JOIN return for two tables joined on a matching key?

A.Rows with matching join values in both tables
B.Every row from the left table, whether matched or not
C.Every possible combination of rows without a condition
D.Only rows that have NULL in both join columns

Correct Answer

A) Rows with matching join values in both tables
An INNER JOIN keeps combinations whose join condition matches. Unmatched rows are excluded.

Q54MCQ Practice
Answer A

What is the main purpose of a LEFT JOIN?

A.Keep every left-table row and include matching right-table data when available
B.Keep only rows that match in both tables
C.Remove every row from the left table
D.Sort the left table in descending order

Correct Answer

A) Keep every left-table row and include matching right-table data when available
A LEFT JOIN preserves all rows from the left input; columns from the right side are NULL when there is no match.

Q55MCQ Practice
Answer A

What result does a CROSS JOIN produce for two input tables?

A.The Cartesian product of their rows
B.Only matching key values
C.Only unmatched left rows
D.A sorted list of column names

Correct Answer

A) The Cartesian product of their rows
A CROSS JOIN pairs each row of one table with every row of the other. If they contain m and n rows, the result has m × n rows.

Q56MCQ Practice
Answer A

Table A has 3 rows and table B has 5 rows. How many row combinations does their CROSS JOIN produce?

A.15
B.8
C.5
D.2

Correct Answer

A) 15
A Cartesian product has 3 × 5 = 15 combinations. Adding the row counts would give 8, not the product.

Q57MCQ Practice
Answer A

In a join between Orders and Customers, which condition most directly pairs each order with its customer?

A.Orders.CustomerID = Customers.CustomerID
B.Orders.OrderDate = Customers.CustomerName
C.Orders.Amount > Customers.CustomerID
D.Orders.OrderID = Customers.City

Correct Answer

A) Orders.CustomerID = Customers.CustomerID
The shared customer identifier links each order to its customer. Comparing unrelated attributes would not define that relationship.

Q58MCQ Practice
Answer A

A row from the left table has no match in the right table in a LEFT JOIN. What is returned for the right-table columns in that result row?

A.NULL values
B.Zeros in every column
C.The first row from the right table
D.The text value 'NO MATCH' automatically

Correct Answer

A) NULL values
The left row remains, and the unavailable right-side values are represented as NULL in the join result.

Q59MCQ Practice
Answer A

What does an alias do in a SQL query such as Employees AS e?

A.Gives a table or expression a temporary name within the query
B.Permanently renames the table in the database
C.Deletes all rows from the table
D.Creates a required primary key

Correct Answer

A) Gives a table or expression a temporary name within the query
An alias is a query-level shorthand or output label; it does not by itself rename the stored table.

Q60MCQ Practice
Answer A

Which SQL set operator combines result rows from two compatible queries and removes duplicate rows by default?

A.UNION
B.JOIN
C.UPDATE
D.CHECK

Correct Answer

A) UNION
UNION combines compatible result sets and removes duplicates by default. UNION ALL retains duplicates.

61-80. Database Fundamentals and SQL MCQs
Choose one option, then check the bold answer.
Q61MCQ Practice
Answer A

What must generally be true for the two SELECT statements combined by UNION?

A.They return the same number of columns with compatible corresponding data types.
B.They must read the same table.
C.They must both contain ORDER BY in the same position.
D.They must return exactly the same rows.

Correct Answer

A) They return the same number of columns with compatible corresponding data types.
UNION aligns columns by position, so the result sets need matching column counts and compatible types in corresponding positions.

Q62MCQ Practice
Answer A

Which statement about a subquery is correct?

A.It is a query nested within another SQL statement.
B.It is a table that cannot be queried.
C.It is another name for a primary key.
D.It always returns exactly one row.

Correct Answer

A) It is a query nested within another SQL statement.
A subquery is nested inside a larger statement and can return one value, multiple values, or rows depending on its form.

Q63MCQ Practice
Answer A

Which operator is commonly used to test whether a value matches any value returned by a list-producing subquery?

A.IN
B.ALTER
C.COMMIT
D.DESC

Correct Answer

A) IN
IN tests membership in a specified list or subquery result. It is not a data-definition or transaction command.

Q64MCQ Practice
Answer A

A column Age should accept only values from 0 through 120 inclusive. Which constraint is designed to restrict allowed values with a condition?

A.CHECK
B.ORDER BY
C.JOIN
D.COMMIT

Correct Answer

A) CHECK
A CHECK constraint enforces a condition on column or row values, such as Age BETWEEN 0 AND 120.

Q65MCQ Practice
Answer A

What does a DEFAULT constraint or default definition generally do when an INSERT omits that column?

A.Supplies a predefined value for the omitted column
B.Rejects every insert into the table
C.Copies a value from every other table
D.Sorts the inserted row

Correct Answer

A) Supplies a predefined value for the omitted column
A default is used when a value is omitted, subject to the DBMS and statement details. It does not automatically copy unrelated table data.

Q66MCQ Practice
Answer A

Which SQL constraint is specifically used to require that a column value match a key in a referenced table?

A.FOREIGN KEY
B.CHECK
C.NOT NULL
D.DEFAULT

Correct Answer

A) FOREIGN KEY
A foreign-key constraint links a referencing column or columns to a key in another or the same table.

Q67MCQ Practice
Answer A

What is the main purpose of an index on a database table?

A.To help locate rows more efficiently for suitable queries
B.To guarantee that every query becomes faster
C.To replace the need for table data
D.To prevent all changes to indexed columns

Correct Answer

A) To help locate rows more efficiently for suitable queries
Indexes can speed up certain searches and joins, but they use storage and can add cost to data changes; they do not accelerate every query.

Q68MCQ Practice
Answer A

What is one common trade-off of adding indexes to a table?

A.They can improve some reads but add storage and maintenance work.
B.They make all inserts impossible.
C.They always reduce the size of the database.
D.They eliminate the need for a primary key.

Correct Answer

A) They can improve some reads but add storage and maintenance work.
Indexes can help query performance, but they take space and need updating when indexed data changes.

Q69MCQ Practice
Answer A

Which transaction property means that a transaction's changes are treated as an all-or-nothing unit?

A.Atomicity
B.Consistency
C.Isolation
D.Durability

Correct Answer

A) Atomicity
Atomicity means either all operations in the transaction take effect or none do.

Q70MCQ Practice
Answer A

Which ACID property requires a transaction to preserve defined database rules when it completes successfully?

A.Consistency
B.Atomicity
C.Isolation
D.Durability

Correct Answer

A) Consistency
Consistency means a successful transaction takes the database from one valid state to another, preserving applicable constraints.

Q71MCQ Practice
Answer A

Which ACID property concerns concurrent transactions behaving without improperly interfering with one another?

A.Isolation
B.Durability
C.Atomicity
D.Normalization

Correct Answer

A) Isolation
Isolation governs how concurrent transactions interact. The exact guarantees depend on the chosen isolation level and DBMS.

Q72MCQ Practice
Answer A

Which ACID property means committed changes should persist despite a subsequent system failure?

A.Durability
B.Isolation
C.Atomicity
D.Projection

Correct Answer

A) Durability
Durability is the persistence of committed changes. It is distinct from atomicity, which concerns all-or-nothing execution.

Q73MCQ Practice
Answer A

What does COMMIT generally do at the end of a transaction?

A.Makes the transaction's changes permanent according to the DBMS transaction rules
B.Reverses all changes in the transaction
C.Creates a new table
D.Sorts the transaction's rows

Correct Answer

A) Makes the transaction's changes permanent according to the DBMS transaction rules
COMMIT completes a transaction and makes its changes durable under the database's transaction behavior.

Q74MCQ Practice
Answer A

What does ROLLBACK generally do to uncommitted changes in a transaction?

A.Undoes them
B.Adds them to an index
C.Displays them in sorted order
D.Converts them into a table definition

Correct Answer

A) Undoes them
ROLLBACK cancels uncommitted work in the transaction, returning the database to its earlier transactional state.

Q75MCQ Practice
Answer A

Which database model organizes data primarily as tables connected through keys?

A.Relational model
B.Hierarchical file-folder model only
C.Optical model
D.Sequential model

Correct Answer

A) Relational model
The relational model represents data with relations and connects related records through keys and defined relationships.

Q76MCQ Practice
Answer A

In an entity-relationship diagram, what does an entity usually represent?

A.A distinguishable real-world object or concept about which data is stored
B.A sorting direction
C.A SQL comparison operator
D.A numeric calculation only

Correct Answer

A) A distinguishable real-world object or concept about which data is stored
Entities represent things or concepts such as Student or Course; their properties are represented by attributes.

Q77MCQ Practice
Answer A

In an entity-relationship model, an attribute is best understood as:

A.A property describing an entity
B.A connection between two unrelated queries
C.A command that deletes a table
D.A transaction failure

Correct Answer

A) A property describing an entity
Attributes describe entities, such as a Student's name or a Course's title.

Q78MCQ Practice
Answer A

If each department can have many employees and each employee belongs to one department, what is the relationship from Department to Employee?

A.One-to-many
B.One-to-one
C.Many-to-many
D.No relationship

Correct Answer

A) One-to-many
One department may be associated with many employees, while each employee is associated with one department in the stated model.

Q79MCQ Practice
Answer A

If students can take many courses and each course can have many students, what relationship exists between Student and Course?

A.Many-to-many
B.One-to-one
C.One-to-many in only one direction
D.No relationship

Correct Answer

A) Many-to-many
Each side can be linked to multiple instances on the other side, so the relationship is many-to-many.

Q80MCQ Practice
Answer A

How is a many-to-many relationship commonly represented in a relational database?

A.With an associative table containing foreign keys to the two related tables
B.By placing every course name in one student column
C.By removing both tables' keys
D.By making one table a database index

Correct Answer

A) With an associative table containing foreign keys to the two related tables
An associative table stores each link as a row and commonly uses the two foreign keys together as its key.

81-100. Database Fundamentals and SQL MCQs
Choose one option, then check the bold answer.
Q81MCQ Practice
Answer A

Which SQL keyword introduces the table or tables from which a SELECT query reads data?

A.FROM
B.SET
C.VALUES
D.COMMIT

Correct Answer

A) FROM
FROM identifies the source table or tables for a SELECT query. SET is commonly used in UPDATE assignments.

Q82MCQ Practice
Answer A

A query uses SELECT Name FROM Student WHERE City = 'Lahore'. What determines which Student rows are included?

A.The WHERE condition on City
B.The Name column in the SELECT list
C.The table's physical storage order
D.The word FROM by itself

Correct Answer

A) The WHERE condition on City
WHERE filters rows to those whose City matches Lahore. SELECT Name controls which value is displayed for each qualifying row.

Q83MCQ Practice
Answer A

What is the effect of omitting a WHERE clause from a basic UPDATE statement?

A.The update can affect every row in the target table.
B.The statement updates only the first row.
C.The statement becomes a SELECT query.
D.The statement cannot change any value.

Correct Answer

A) The update can affect every row in the target table.
Without a filtering condition, an UPDATE generally applies its assignments to all rows, so conditions should be checked carefully.

Q84MCQ Practice
Answer A

What is the effect of omitting a WHERE clause from a basic DELETE statement?

A.It can delete every row from the target table.
B.It deletes only rows containing NULL.
C.It drops the table definition in every SQL system.
D.It sorts the rows before deleting one.

Correct Answer

A) It can delete every row from the target table.
A DELETE without a row filter generally removes all table rows, while leaving the table structure in place.

Q85MCQ Practice
Answer A

Which query fragment sorts Salary from highest to lowest?

A.ORDER BY Salary DESC
B.ORDER BY Salary ASC
C.GROUP BY Salary DESC
D.WHERE Salary DESC

Correct Answer

A) ORDER BY Salary DESC
DESC requests descending order, so larger salaries appear before smaller ones; ASC is ascending order.

Q86MCQ Practice
Answer A

Which query fragment sorts a column in ascending order?

A.ORDER BY Name ASC
B.ORDER BY Name DESC
C.WHERE Name ASC
D.HAVING Name ASC

Correct Answer

A) ORDER BY Name ASC
ASC specifies ascending order in ORDER BY. It is commonly the default, but stating it makes the intended order explicit.

Q87MCQ Practice
Answer A

A query needs rows with Salary between 30000 and 50000, including both endpoints. Which condition is correct?

A.Salary BETWEEN 30000 AND 50000
B.Salary BETWEEN 30000 OR 50000
C.Salary > 30000 AND Salary < 50000
D.Salary = 30000 AND Salary = 50000

Correct Answer

A) Salary BETWEEN 30000 AND 50000
BETWEEN includes both endpoints in SQL, so this condition includes salaries of exactly 30000 and 50000.

Q88MCQ Practice
Answer A

Which condition selects records where Age is not 18?

A.Age <> 18
B.Age BETWEEN 18 AND 18
C.Age IS NULL
D.Age LIKE 18

Correct Answer

A) Age <> 18
The standard SQL not-equal operator is <>. It tests values different from 18, subject to SQL's handling of NULL.

Q89MCQ Practice
Answer A

Which statement about SQL NULL is most accurate?

A.It represents missing or unknown information and is not the same as zero.
B.It always means the number zero.
C.It is the same as an empty string in every database.
D.It is a reserved value that sorts first in every query.

Correct Answer

A) It represents missing or unknown information and is not the same as zero.
NULL marks an absent or unknown value. Its behavior differs from zero and from an empty string.

Q90MCQ Practice
Answer A

Which logical operator requires both conditions to be true for a row to pass the condition?

A.AND
B.OR
C.NOT
D.LIKE

Correct Answer

A) AND
AND is true only when both conditions are true. OR requires at least one condition to be true.

Q91MCQ Practice
Answer A

Which logical operator is used to reverse a condition's truth value?

A.NOT
B.AND
C.OR
D.UNION

Correct Answer

A) NOT
NOT negates a condition. For example, NOT (Age = 18) is true when that equality condition is false.

Q92MCQ Practice
Answer A

A table contains 12 rows, of which 3 have NULL in the Email column. What does COUNT(Email) return?

A.9
B.12
C.3
D.15

Correct Answer

A) 9
COUNT(Email) excludes the 3 NULL values, so it counts 12 - 3 = 9 non-NULL entries.

Q93MCQ Practice
Answer A

A table has 8 rows, including 2 rows where every value in the selected column is NULL. What does COUNT(*) return?

A.8
B.6
C.2
D.0

Correct Answer

A) 8
COUNT(*) counts all rows regardless of NULL values, so the result is 8.

Q94MCQ Practice
Answer A

A GROUP BY query selects DepartmentID and COUNT(*). What does each output row normally represent?

A.One department group and its row count
B.One individual employee and their salary
C.One table and its number of columns
D.One index and its storage size

Correct Answer

A) One department group and its row count
GROUP BY DepartmentID forms one group per department value, and COUNT(*) reports the number of rows in each group.

Q95MCQ Practice
Answer A

Which clause should be used to require each grouped DepartmentID to have a COUNT(*) greater than 5?

A.HAVING COUNT(*) > 5
B.WHERE COUNT(*) > 5
C.ORDER BY COUNT(*) > 5
D.FROM COUNT(*) > 5

Correct Answer

**A) HAVING COUNT(*) > 5**
The condition applies to an aggregate for each group, so HAVING is appropriate.

Q96MCQ Practice
Answer A

What does a view commonly represent in a relational database?

A.A named query that presents data derived from one or more sources
B.A physical keyboard attached to a database server
C.A required duplicate of every table
D.A transaction that cannot be rolled back

Correct Answer

A) A named query that presents data derived from one or more sources
A view presents selected or derived data through a stored query; whether it is updateable depends on its definition and DBMS.

Q97MCQ Practice
Answer A

Which statement best describes a database backup?

A.A separate copy used to help restore data after loss or damage
B.A constraint that makes values unique
C.A query that groups rows
D.A synonym for a foreign key

Correct Answer

A) A separate copy used to help restore data after loss or damage
Backups provide a recovery copy. Their usefulness depends on suitable storage, schedules, and restoration testing.

Q98MCQ Practice
Answer A

A database rule requires a product's Price to be greater than or equal to zero. Which design feature is most appropriate?

A.A CHECK constraint on Price
B.An ORDER BY clause
C.A CROSS JOIN
D.A ROLLBACK statement

Correct Answer

A) A CHECK constraint on Price
A CHECK constraint can enforce Price >= 0 when data is inserted or changed.

Q99MCQ Practice
Answer A

Which feature most directly ensures that two rows in a table cannot share the same selected identifier?

A.A primary-key constraint
B.An ORDER BY clause
C.A LEFT JOIN
D.A default value

Correct Answer

A) A primary-key constraint
A primary key enforces unique, non-NULL identification of rows. Sorting or defaults do not establish uniqueness.

Q100MCQ Practice
Answer A

In a Student table, StudentID is the primary key and ClassID references Class.ClassID. Which statement best describes ClassID in Student?

A.It is a foreign key that can link multiple students to one class.
B.It must be unique for every student.
C.It is necessarily the Student table's primary key.
D.It is an aggregate function.

Correct Answer

A) It is a foreign key that can link multiple students to one class.
Many students may share a class, so the foreign key can repeat while referring to the class table's key.

How to revise this Database Fundamentals and SQL set

  1. For each key question, state what must be unique and whether the key connects one table to another; do not treat every unique column as a primary key.
  2. When practising normalization, write down the functional dependency first, then check whether the issue is a repeating group, partial dependency, or transitive dependency.
  3. Read SQL clauses in their logical purpose: filter rows with WHERE, filter groups with HAVING, and sort the final result with ORDER BY.
  4. For join questions, sketch the matching key values and check whether unmatched rows should remain in the result.
  5. When reviewing an incorrect answer, write a small example table and manually predict the result before memorizing a rule.

Frequently Asked Questions

Are these official NAT-ICS questions?

No. They are original independent practice questions on database fundamentals and SQL, not copied from an official paper or confirmed syllabus.

What should I know before attempting the SQL questions?

Basic familiarity with tables, rows, columns, and simple conditions is enough. The explanations introduce the query rules used in the answers.

Why does COUNT(column) sometimes give a different result from COUNT(*)?

COUNT(*) counts rows, while COUNT(column) counts only rows where that column is not NULL. Check which measure a question asks for.

How can I review normalization questions effectively?

Identify the table's key and its dependencies, then ask whether attributes depend on the whole key and nothing but the key. Use the explanation to classify the design issue.

Final Takeaway

Consistent daily MCQ practice is one of the simplest ways to improve recall, speed, and exam confidence. Bookmark this page, complete the 100 Database Fundamentals and SQL MCQs, and continue your preparation on McqsBase.

Ready to Start Practicing?

Put your knowledge into practice with our comprehensive collection of MCQs and past papers.

Related practice articles

Latest articles

All articles