🌍 SQL & Databases · flashcards

SQL & Databases Relational Database Fundamentals Flashcards

51 question-and-answer cards covering Relational Database Fundamentals as it is examined in SQL & Databases. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.

51Cards in deck
24Free preview
16Syllabus topics
~191Chars per answer
FreePrice

24 sample cards from the Relational Database Fundamentals deck

Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.

  1. In DECIMAL(p, s), what do p and s mean?

    $p$ (precision) is the total number of significant digits; $s$ (scale) is the number of digits to the right of the decimal point. For example DECIMAL(7,2) stores values up to $\pm 99999.99$.

  2. Why should money be stored in DECIMAL/NUMERIC rather than FLOAT?

    Floating-point types store binary approximations and cannot represent many decimal fractions exactly (e.g., $0.1$), causing rounding errors. DECIMAL/NUMERIC is exact, which is required for financial calculations.

  3. What is the difference between CHAR(n) and VARCHAR(n)?

    CHAR(n) is fixed-length: values are right-padded with spaces to exactly $n$ characters. VARCHAR(n) is variable-length: it stores only the actual characters up to a maximum of $n$, using less space for short values.

  4. What type stores large character data, and how does the BOOLEAN type behave in SQL?

    TEXT / CLOB stores large/unbounded character data. BOOLEAN holds the logical values TRUE and FALSE — and, because of SQL's three-valued logic, also UNKNOWN (represented by NULL).

  5. What are the standard SQL date/time types?

    DATE (calendar date), TIME (time of day), TIMESTAMP (date + time), and interval types (INTERVAL). Variants WITH TIME ZONE (TIMESTAMPTZ) store zone/offset information.

  6. What is the difference between TIMESTAMP WITHOUT TIME ZONE and TIMESTAMP WITH TIME ZONE?

    WITHOUT TIME ZONE stores the literal date/time with no zone context. WITH TIME ZONE (TIMESTAMPTZ) normalizes the value to UTC on storage and converts to the session's time zone on retrieval, making it unambiguous across zones.

  7. What is an INTERVAL type used for?

    An INTERVAL represents a span/duration of time (e.g., '2 days 3 hours') rather than a point in time. Intervals can be added to or subtracted from dates and timestamps.

  8. Name several specialized SQL data types beyond numbers, strings, and dates.

    BLOB/BYTEA (binary data), JSON/JSONB (semi-structured documents), XML, UUID (128-bit unique identifiers), ARRAY, ENUM, and spatial/GEOMETRY types. PostgreSQL notably supports many of these natively.

  9. What is the difference between JSON and JSONB in PostgreSQL?

    JSON stores an exact textual copy (preserving whitespace/key order, reparsed each access). JSONB stores a decomposed binary form: faster to process and indexable (GIN), but does not preserve key order or duplicate keys.

  10. What is a UUID and why is it used?

    A UUID (Universally Unique Identifier) is a 128-bit value, often shown as 32 hex digits in 5 groups (8-4-4-4-12). It provides globally unique keys generated without central coordination, useful for distributed systems.

  11. What does NULL represent in SQL?

    NULL is a marker for the absence of a value — meaning 'unknown,' 'not applicable,' or 'missing.' It is NOT the same as zero, an empty string, or FALSE.

  12. What is three-valued logic (3VL) in SQL?

    SQL Boolean expressions can evaluate to TRUE, FALSE, or UNKNOWN. Any comparison involving NULL yields UNKNOWN, so predicates that are not definitely TRUE do not qualify rows in WHERE clauses.

  13. Why does 'column = NULL' never return rows, and what should be used instead?

    Comparing anything to NULL with = yields UNKNOWN (not TRUE), so no rows qualify. Use the predicates IS NULL and IS NOT NULL to test for NULLs.

  14. How does NULL behave in arithmetic and aggregate functions?

    Arithmetic with NULL yields NULL (e.g., $5 + \text{NULL} = \text{NULL}$). Aggregate functions like SUM, AVG, MIN, MAX ignore NULLs, but COUNT(*) counts all rows while COUNT(column) ignores NULLs.

  15. Evaluate TRUE OR UNKNOWN and TRUE AND UNKNOWN in SQL three-valued logic.

    TRUE OR UNKNOWN = TRUE (because OR is true if either operand is true). TRUE AND UNKNOWN = UNKNOWN (AND cannot be confirmed true while the other operand is unknown). FALSE AND UNKNOWN = FALSE.

  16. What is DDL and which statements belong to it?

    Data Definition Language defines and modifies schema objects. Statements: CREATE, ALTER, DROP, TRUNCATE, and RENAME. They act on structures like tables, indexes, views, and schemas.

  17. What does TRUNCATE do and how does it differ from DELETE?

    TRUNCATE quickly removes all rows from a table. It is DDL (typically auto-committed, minimal logging, resets identity, cannot use WHERE), whereas DELETE is DML that removes rows one-by-one, can be filtered with WHERE, and is transaction-controllable/rollbackable.

  18. What is DML and which statements belong to it?

    Data Manipulation Language changes the data within tables. Core statements: INSERT (add rows), UPDATE (modify rows), DELETE (remove rows), and MERGE (upsert). Some classifications include SELECT here as well.

  19. What is DQL and its single statement?

    Data Query Language is used to retrieve data; its statement is SELECT (with clauses like FROM, WHERE, GROUP BY, HAVING, ORDER BY). It is often grouped under DML in some taxonomies.

  20. State the logical order of evaluation of the main SELECT clauses.

    FROM (and JOINs) → WHERE → GROUP BY → HAVING → SELECT → DISTINCT → ORDER BY → LIMIT/OFFSET. Note this differs from the written order, which starts with SELECT.

  21. What is the difference between WHERE and HAVING?

    WHERE filters individual rows before grouping and cannot use aggregate functions. HAVING filters groups after GROUP BY and can reference aggregates (e.g., HAVING COUNT(*) > 5).

  22. What is DCL and which statements belong to it?

    Data Control Language manages privileges/permissions. Statements: GRANT (give privileges to users/roles) and REVOKE (remove them).

  23. What is TCL and which statements belong to it?

    Transaction Control Language manages transactions. Statements: COMMIT (make changes permanent), ROLLBACK (undo to a consistent state), SAVEPOINT (set a rollback marker), and SET TRANSACTION (configure properties).

  24. What are the ACID properties of a database transaction?

    Atomicity (all-or-nothing), Consistency (moves DB from one valid state to another respecting constraints), Isolation (concurrent transactions don't interfere), and Durability (committed changes survive failures).

What this deck covers

The Relational Database Fundamentals deck follows the SQL & Databases Relational Database Fundamentals syllabus — 4 chapters and 16 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 12.8 cards per chapter.

Answers are written to be recallable, not just readable — averaging about 191 characters, which is long enough to carry the reasoning and short enough to say out loud.

A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.

Relational Database Fundamentals flashcards FAQ

How many Relational Database Fundamentals flashcards are in this SQL & Databases deck?

51 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.

Are these SQL & Databases flashcards free?

Yes. The preview here is free to read with no signup, and the full 51-card deck is free inside the Examius app.

What do the Relational Database Fundamentals cards cover?

They follow the SQL & Databases Relational Database Fundamentals syllabus — 4 chapters and 16 topics — so the questions track what is actually examinable.

How should I use these flashcards?

Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.