Data Modeling and SQL

  1. Tables, Rows, and Columns in SQL

    A table organizes rows around named columns. Each row describes one occurrence or relationship under the table's design.

    Undergraduate
  2. Primary Keys and Display Names

    A primary key identifies rows uniquely and excludes null components under SQL primary-key semantics. A display name may be shared or change.

    Undergraduate
  3. Foreign Keys as References Between Tables

    A foreign key checks that a referenced value has a corresponding key under the declared relational constraint, with rules for nulls and changes.

    Undergraduate
  4. A Composite Key in a Table

    A composite key identifies a row through several columns together. Each individual column can repeat when the full combination must remain unique.

    Undergraduate
  5. Column Types and Business Rules

    A column type controls representable values. A domain constraint can restrict values further according to what the application means.

    Undergraduate
  6. Null, Zero, and Empty Text in SQL

    SQL null indicates missing or unknown data under the applicable operation. Zero and empty text can be present values with distinct meanings.

    Undergraduate
  7. Requiring a Present Column Value

    A not-null constraint requires a column value to be present. It does not by itself require a nonempty string or a value in a particular interval.

    Undergraduate
  8. Defaults for Omitted Column Values

    A column default supplies a value under the database's insertion rules when the caller requests a default or omits that column.

    Undergraduate
  9. Uniqueness for a Column or Combination

    A uniqueness constraint gives the database responsibility for rejecting duplicate keys according to its rules.

    Undergraduate
  10. Checking an Explicit Row Condition

    A check constraint can enforce a Boolean condition over a row's values according to the database's constraint evaluation rules.

    Undergraduate
  11. One-to-Many Relationships in Tables

    A one-to-many relationship allows several rows to reference one parent while each child row uses a single reference for that role.

    Undergraduate
  12. Many-to-Many Relationships with a Link Table

    A link table stores each relationship as a separate row, allowing each side to occur in several pairs.

    Undergraduate
  13. One-to-One Relationships with a Unique Reference

    A foreign key with a uniqueness constraint can limit the number of rows pointing at a parent to at most one.

    Undergraduate
  14. Choosing What One Table Row Represents

    Row granularity says what one observation or entity in a table means. Measures and keys depend on that choice.

    Undergraduate
  15. Moving a Repeated Attribute into a Related Table

    A separate table can keep repeated facts in one authoritative location and let several rows refer to them.

    Undergraduate
  16. Generated IDs and Domain Keys

    A generated ID can supply durable row identity. A domain key represents a naturally occurring uniqueness rule in the application.

    Undergraduate
  17. Why Generated Row Numbers Can Have Gaps

    A sequence or identity mechanism can supply distinct values without promising that every integer appears in saved rows.

    Undergraduate
  18. Units and Scales in Database Columns

    A column name or companion field can specify what stored numeric values measure. Conversions belong at documented interfaces.

    Undergraduate
  19. Saving Decimal Amounts with a Currency and Scale

    A monetary value needs a currency, a scale, and a rounding contract. A fixed-scale decimal or lowest-unit integer can serve different domains.

    Undergraduate
  20. Storing an Instant or a Local Calendar Date

    A timestamp used for ordering observations and a date used for a local policy encode different information. Column choice should match that intent.

    Undergraduate
  21. Enumerated Status Values and Reference Tables

    A small fixed status set can be constrained directly. A reference table can give allowed statuses additional data and an independent lifecycle.

    Undergraduate
  22. Deletion Policies for Referenced Rows

    A relationship constraint defines what happens to referencing rows when someone removes a referenced row.

    Undergraduate
  23. Creating Related Rows as One Unit of Work

    An operation creating a parent and children can make their changes succeed or fail together when the application promises a complete result.

    Undergraduate
  24. Introducing a Database Column for Existing Rows

    A schema change must account for data created before the new column existed and for writes occurring during rollout.

    Undergraduate
  25. Adding a Uniqueness Rule to Existing Data

    Before enforcing uniqueness, examine which current rows would share a key and decide which changes preserve the domain's relationships.

    Undergraduate
  26. Selecting the Intended Rows for an Update

    A database update uses a predicate to choose which rows to change. The predicate should express the operation's exact scope.

    Undergraduate
  27. Current Rows and Historical Events

    A current row can record the latest state. An event table can retain selected transitions when the history itself matters.

    Undergraduate
  28. Reference Codes and Human Labels in Tables

    A reference record can carry a stable code used by software and one or more labels used for display.

    Undergraduate
  29. Combining Column Defaults and Checks

    A default supplies a value under its rules. A check enforces a condition when candidate rows are stored. Choose them to agree at the insertion boundary.

    Undergraduate
  30. Designing Tables from the Questions They Need to Answer

    A usable schema records enough identity, relationships, and measurement detail to answer representative queries accurately.

    Undergraduate