An entity is a distinct object or concept that can be described by attributes. In a relational database, a table can represent an entity: each row is one record, and each column is an attribute of that entity. section 1.3 section 1.12
Product as an entity
For an online store, a product is an entity. Its attributes might be name, description, price, and manufacturer. A product table stores those attributes in columns, while each product occupies one row. section 1.3
Entity design starts by turning subjects and characteristics found in requirements into entities and attributes. A subject such as a product, customer, or dealer becomes an entity; its descriptive characteristics become attributes. This work is part of data modeling, whose goal is an entity-relationship diagram. section 4.2 section 4.1
Design an entity by working through these practical decisions:
- Identify the attributes needed to describe it. section 4.9
- Choose a primary key that uniquely identifies every row; create a numeric key when no suitable candidate key exists. section 4.9
- Assign a data type to each attribute by examining sample data and requirements. section 4.9
- Use a consistent naming convention. Singular names suit primary entities, while plural names can feel natural for table titles. section 4.2
Keep separate entities in separate tables when they describe different things. Combining customer and product information in one table creates redundant data and can cause deletion problems, such as losing a customer record when a product is removed. section 1.3
Entities also provide the endpoints for relationships. After identifying them, define how they relate, determine relationship cardinality, and decide whether any should be represented as weak entities. section 5.0
Extracting entities from requirements
A database for spaceship brands, models, manufactured spaceships, dealers, and customers can identify brand, model, spaceship, dealer, and customer as entities. A prompt can ask ChatGPT to identify entities from stated requirements, with instructions separated from the requirement context. section 8.4 section 8.3











