AI Glossary / Data engineering and architecture / Intermediate
Relation Instance
Definition
A relation instance is the set of tuples belonging to a relation at a particular state or point in the database's evolution. The relation schema describes the attributes, domains, and relevant rules; the instance supplies the current values. In ordinary database language, it is roughly the current contents of a table. Classical relations are sets, while SQL tables and query results can have additional behaviors such as duplicates and NULL that require separate care.
What it means
The schema Course(CourseID,Title) can remain unchanged while courses are added, renamed, or removed. Each resulting collection of course tuples is a different instance of the same schema. This distinction helps separate structural changes from data changes. It also explains why inspecting one snapshot cannot establish every rule that should hold for all possible valid contents.
How it works
A schema defines the shape and constraints of permissible tuples. Inserts, updates, and deletes change the relation instance, normally within transactions. An instance is legal when it satisfies the applicable constraints under the chosen model. Queries derive result relations from an instance, and different inputs can produce different results without changing the query definition. In a transactional database, which committed or visible state a query observes depends on the system's consistency and isolation rules, so “current” should be interpreted in the query's context.
Three practical examples
- Catalog maintenance: adding a new course changes the course relation's instance while leaving its attribute definitions unchanged.
- Testing: a small relation instance is constructed to exercise a join, including unmatched and repeated-key cases under the allowed schema.
- AI reproducibility: a dataset build records the source snapshot so the same schema and query can be associated with the exact input state used.
Think of it this way
Think of a blank register's column headings compared with the entries written in it today. The headings resemble the schema, while today's entries resemble an instance. The analogy is limited because a formal relation is not defined by page order, and databases can provide transaction-specific views of changing data. A printed copy also does not automatically include the constraints needed to judge whether its entries are legal.
Worked example
Let the schema be Course(CourseID,Title), with CourseID a key. At state S1, the instance contains (C1,“Data Basics”) and (C2,“AI Practice”). At state S2, a new tuple (C3,“Model Review”) is added. The schema still has two attributes, while cardinality changes from two tuples to three. Renaming C1's title changes a value in the instance, not the schema. Attempting to add another C1 tuple with a different title violates the stated key constraint. Adding a new attribute Duration, however, changes the schema and requires considering how existing tuples are represented. This example separates row count, value updates, constraints, and structural evolution rather than treating every database change as the same operation.
Illustrative case study
Fictional example: Birch Learning compares two reports produced with identical SQL and sees different totals. Investigation finds that the reports used different source snapshots, one before and one after late enrollments were recorded. The team labels the input state and extraction time rather than assuming the query changed. This invented case illustrates data-state provenance; it does not claim that every report discrepancy comes from timing or that timestamps alone always identify a reproducible snapshot.
Common misconceptions and mistakes
Do not confuse a relation instance with a database server instance or with one individual row. The term refers to the relation's collection of tuples in a state. Do not infer a functional dependency solely because the current rows happen to satisfy it; the schema rule concerns every legal instance. Avoid relying on displayed row order as part of a classical relation. Also distinguish an empty relation from a missing schema: a relation can have a defined heading and zero tuples.
Business use
The distinction is useful in data testing, change management, and reproducible analytics. Describe schemas separately from snapshots and identify which state a result depends on. Use test instances designed around meaningful edge cases rather than only typical rows. For AI datasets, retain enough source-state and transformation metadata to explain changes in training or evaluation results. A schema version alone does not identify the data values, and a data file alone may not document all constraints or interpretation rules.
People also ask
Is one row a relation instance?
A relation instance can contain one tuple, but the term refers to the entire current set, not a synonym for any individual row.
Can an empty relation have a schema?
Yes. Its attributes and rules remain defined even when no tuples are present.
Does updating a value always change the schema?
No. Ordinary value updates change the instance while preserving the schema.
Check your understanding
A table gains ten rows but retains the same columns, types, and rules. What primarily changed?
Answer: Its instance changed. If a new column or a new key rule is introduced, the schema or its constraints change as well, even if the row count stays the same.
Related terms
- Relation Schema
- Tuple
- Domain
- Cardinality (data modeling)
- Relational model
- attribute
- cardinality
- degree
- database state
- snapshot
- constraint
- schema evolution
Learn next
create two different legal instances of one small schema and one illegal instance that violates a key. Explain why the same schema permits the first two and rejects the third. Then change the schema and identify what additional decisions are needed for existing data.
More in Data engineering and architecture
- Reflexive Rule - The reflexive rule for functional dependencies states that an attribute set determines each of its subsets. If Y is a subset of X, then X → Y.
- Region connection calculus - Region connection calculus (RCC) is a formal approach to qualitative spatial reasoning that describes relationships between regions, such as separation...
- Reification (computer science) - Reification in computer science means making an otherwise implicit, abstract or operational concept into an explicit object or data representation that a...
- Relation Profile - A relation profile, in database query optimization, is a statistical description of a relation and its attributes.
- Relational Data Model - The relational data model represents information through relations: sets of tuples described by named attributes and their domains.
- Relational data stream management system - A relational data stream management system applies relational query concepts to continuously arriving data.
Sources
Sources: Atzeni, Ceri, Paraboschi, and Torlone, Database Systems: Concepts, Languages and Architectures, https://dbbook.inf.uniroma3.it/dbbook.pdf ; University of Otago, COSC344 Lecture 8, https://www.cs.otago.ac.nz/cosc344/lectures/L8_2022.pdf ; PostgreSQL 18, Constraints, https://www.postgresql.org/docs/18/ddl-constraints.html . Primary textbook and teaching excerpts consulted for relation states, legal instances, and dependencies; product documentation grounds constraint examples. Classical set semantics are distinguished from practical SQL behavior.
Previous: Relation extraction Next: Relation network