• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Start selling Create your account
Document preview thumbnail
Preview 3 out of 22 pages
Exam (elaborations)

SQL Database Fundamentals 2025 60 QA Practice Exam Verified RDBMS

Document preview thumbnail
Preview 3 out of 22 pages

SQL Database Fundamentals 2025 — 60 Practice Questions Verified Answers

Content preview

SQL Database Fundamentals 2025 — 60 Practice Questions
Verified Answers

Series:
CrashCourses Professional Study Series

Author:
Dr Z. Moomba, MBChB, MRCPsych | BethelWellness Ltd

Exam Target:
SQL Fundamentals

Year:
2025/2026

Format:
60 Questions with Verified Answers and Rationales


>
Author's Note:
This document is an original work produced for the CrashCourses Professional Study Series.
Clinical questions and professional scenarios were composed by Dr Z. Moomba based on current
exam objectives, published guidelines, and evidence-based sources (2024–2025). All patient
names, ages, and case details are fictional. Any resemblance to existing published Q&A banks is
coincidental. For personal study use only — not for reproduction or redistribution.


PART 1: CORE PRINCIPLES & FOUNDATIONS
A systems administrator at a multi-national retail chain must clear out all legacy records from a
staging table called `StagingInventory`. The operation must minimise transaction log growth to
avoid filling the storage drive. Which SQL command best achieves this?
A. DROP TABLE StagingInventory;
B. DELETE FROM StagingInventory;
C. TRUNCATE TABLE StagingInventory;
D. ALTER TABLE StagingInventory DROP ROWS;

Answer: C





,Rationale:
Lead: `TRUNCATE TABLE` is a Data Definition Language (DDL) command that swiftly removes
all records by deallocating the data pages used for storage.
Discriminator: Because it logs page deallocations rather than individual row deletions, it
consumes a fraction of the transaction log space, perfectly satisfying the storage constraint.
Distractor: `DELETE` is a standard row-removal DML command, but it fully logs every single
row deleted, which would rapidly bloat the transaction log for a large table.
Examiner Insight: A table cannot be truncated if it is referenced by an active foreign key
constraint in another table, regardless of whether the child table actually contains any data
[ISO/IEC 9075 SQL Standard].

A logistics manager queries an `EmployeeRoutes` table to find the most experienced drivers.
They want the output ordered by `EmploymentDate`, ensuring the individuals working there the
longest appear at the very top. Which clause guarantees this order?
A. ORDER BY EmploymentDate ASC
B. GROUP BY EmploymentDate DESC
C. ORDER BY EmploymentDate DESC
D. SORT BY EmploymentDate LAST

Answer: A

Rationale:
Lead: The `ORDER BY` clause determines the sorting behavior of a query's result set, with
`ASC` forcing chronological ascending order (oldest to newest dates).
Discriminator: The requirement for the "longest working" employees means the oldest
`EmploymentDate` values must be displayed first, requiring ascending order.
Distractor: `ORDER BY EmploymentDate DESC` would correctly sort the data but in reverse
chronological order, placing the newest hires at the top of the report.
High-Yield Point: If sorting is not explicitly defined by an `ORDER BY` clause, the database
engine returns rows in a non-deterministic sequence that can change between executions
[ANSI SQL-92].

An analyst runs `SELECT COUNT(DiscountCode) FROM Sales;` against a retail database. What
precise calculation does the database engine perform?
A. It tallies the sum of all numeric values within the discount code column.
B. It returns the absolute total of all rows present in the `Sales` table.
C. It counts every row where the `DiscountCode` column is not NULL.




, D. It calculates the total number of distinct discount codes utilized.

Answer: C

Rationale:
Lead: The `COUNT(column_name)` aggregate function evaluates the specified column and
increments its counter only when it encounters a non-NULL value.
Discriminator: By explicitly naming `DiscountCode` inside the parentheses, the function is
instructed to ignore any rows where this specific field is empty (NULL).
Distractor: Returning the absolute total of all rows regardless of NULLs is achieved using
`COUNT(*)`, which is a common point of confusion for beginners.
Clinical Pearl: To count exclusively unique occurrences of non-NULL values, the `DISTINCT`
keyword must be nested within the function: `COUNT(DISTINCT DiscountCode)` [PostgreSQL
16 Documentation].

During a system upgrade for a regional university, a database architect needs to append a
`GraduationYear` column to an existing `Alumni` table. Which category of SQL commands
handles this structural alteration?
A. Data Manipulation Language (DML)
B. Data Definition Language (DDL)
C. Data Control Language (DCL)
D. Transaction Control Language (TCL)

Answer: B

Rationale:
Lead: Data Definition Language (DDL) encompasses commands that define or modify the
database schema, such as `CREATE`, `ALTER`, and `DROP`.
Discriminator: Adding a new column structurally changes the table blueprint (via `ALTER
TABLE`), which firmly categorises the operation as DDL.
Distractor: Data Manipulation Language (DML) manages the actual data payloads (rows) via
`INSERT`, `UPDATE`, and `DELETE`, but it cannot change the table's architecture.
Key Principle: In databases like Oracle and MySQL, executing any DDL command automatically
triggers an implicit commit of the current transaction, preventing rollback [Oracle Database
Concepts 2024].

A cybersecurity auditor searches a `ServerLogs` table for error codes starting with 'ERR-'
followed by exactly three alphanumeric characters. Which standard `LIKE` pattern accurately
filters for this string length?

Document information

Uploaded on
March 23, 2026
Number of pages
22
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
£12.35

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CrashCourses
4.7
(9)
Sold
145
Followers
49
Items
664
Last sold
7 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions