A relational database stores facts in tables and connects them through keys, while constraints and transactions keep those facts valid as many users work at once. PostgreSQL is the database engine; SQL is the language used to define, read, and change data. AI features consume this truth but do not redefine it.
Only the study method from About This Book. No software is required for this chapter.
A spreadsheet is a useful grid owned by a human workflow. A database is a shared fact system that must answer three harder questions:
In the relational model, a table represents a set of facts of one kind. A row is one fact instance. A column defines one attribute and its allowed type. A primary key identifies a row. A foreign key asserts that a referenced row exists.
tickets.organization_id → organizations.id expresses more than matching numbers: the ticket must belong to a real organization.
“Relational” does not simply mean “tables have links.” It comes from relations: sets of tuples described by attributes and governed by predicates. SQL tables are practical implementations with details such as duplicate rows unless constrained, ordering only when requested, and NULL for missing or inapplicable values.
The important habit is to state a table as a sentence:
If the sentence is ambiguous, the schema will be ambiguous.
For SignalDesk AI, canonical facts include the ticket, its organization, message authorship, document version, access policy, approval decision, and audit event. Derived data includes search vectors, embeddings, summaries, suggested replies, and roll-up metrics.
Derived data may also live in PostgreSQL, but it needs lineage:
If an embedding is deleted and rebuilt, the knowledge document remains truth. If the only source text was embedded and then discarded, recovery and citation become impossible.
Classify each item:
A defensible first answer is: attribute; relationship; derived query or maintained projection; ephemeral derived score; canonical auditable event. The exact model may vary, but the reason must not.
Language models produce plausible text, not database invariants. A model may call a customer “active” while the account is suspended, merge two people with similar names, or cite a stale document. The application must ground model context in authorized relational facts and validate any proposed change against deterministic rules.
AI-native does not mean the model owns the data model. It means the data model includes the evidence, versions, policies, evaluations, and audit events needed to operate AI responsibly.
For every proposed table, write:
If you cannot answer these, the table name is not yet a model.
Sketch four boxes for organizations, users, memberships, and tickets. Label the primary key in each and draw foreign-key arrows. Write one rejected state beside each box.
Acceptance criterion: your diagram can represent one user belonging to two organizations without duplicating the user, and a ticket cannot reference a nonexistent organization.