# Tables, rows and keys

> A relation represented as rows with named columns.

Course: [SQL and relational databases](https://studybrix.com/en/courses/sql-databases/index.md)
Level: university
Prerequisites: Basic computing and simple data tables.

## Notes

### Table

A relation represented as rows with named columns.

### Primary key

A constraint identifying each row uniquely.

### Foreign key

A value constrained to reference a key in another relation.

### Schema

The defined structure, fields and constraints of stored data.

## Practice questions

### 1. Which term best matches this description: A relation represented as rows with named columns.

A. Schema
B. Table
C. Primary key
D. Foreign key

Answer: Table

Explanation: Table is the matching concept in this lesson.

### 2. Which term best matches this description: A constraint identifying each row uniquely.

A. Table
B. Schema
C. Foreign key
D. Primary key

Answer: Primary key

Explanation: Primary key is the matching concept in this lesson.

### 3. Which concept would you apply first in a situation where a value constrained to reference a key in another relation.

A. Schema
B. Table
C. Primary key
D. Foreign key

Answer: Foreign key

Explanation: The scenario directly calls for Foreign key.

### 4. Name the concept described as: The defined structure, fields and constraints of stored data.

Answer: Schema

Explanation: The intended concept is Schema.

### 5. Which statement about Table is most accurate?

A. The defined structure, fields and constraints of stored data.
B. A value constrained to reference a key in another relation.
C. A relation represented as rows with named columns.
D. A constraint identifying each row uniquely.

Answer: A relation represented as rows with named columns.

Explanation: The definition in the lesson notes gives the required condition.

### 6. Explain one important difference between Table and Primary key.

Sample answer / marking guidance: Table: A relation represented as rows with named columns. Primary key: A constraint identifying each row uniquely.

Explanation: Credit a clear distinction using both definitions and an appropriate example if supplied.

### 7. Give a short example showing how Foreign key would be used in practice.

Sample answer / marking guidance: A valid example should demonstrate this idea: A value constrained to reference a key in another relation.

Explanation: Credit a relevant scenario that applies the concept rather than merely naming it.

### 8. Summarize why Schema matters in the lesson “Tables, rows and keys”.

Sample answer / marking guidance: Schema matters because The defined structure, fields and constraints of stored data.

Explanation: Credit the core purpose, scope and any important limitation from the notes.

## Further reading

- https://www.postgresql.org/docs/

Original AI-assisted educational draft; not independently teacher-reviewed. References support further study, not copied exercises, affiliation or curriculum accreditation.
