liveBook · Manning

Entity

As explained in 100 SQL Server Mistakes and How to Avoid Them

An entity is a distinct type of thing represented in a data model and typically implemented as a table or related set of data.

An entity is an object within a data model, described by attributes and connected to other entities through defined relationships. In a relational database, it is typically represented by a table or related tables. section 4.1

A common design mistake is treating entities as arbitrary groupings based only on personal judgment. An Entity Relationship Diagram (ERD) makes entities, attributes, and relationships explicit, while normalization provides methodical rules for reducing duplication and redundancy. section 4.1

Use relationships and keys to decide when data belongs in separate entities:

  • Split a one-to-many relationship into separate entities; a sales order can contain multiple ordered products, so order items belong apart from the order. section 4.1.1
  • Use a primary key to identify each row and a foreign key to reference a primary key or unique constraint elsewhere. section 4.1.1
  • Move reusable details into their own entity instead of duplicating them; employee office information can be stored in Offices and referenced by Employees. section 4.1.1
Figure 4.1 ERD for Sales Orders

Use the sales-order ERD to inspect entities and their relationships in a concrete schema. section 4.1.1

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Defines entities through ERDs and relationships, then connects them to keys and normalization without detailing implementation commands.
Examples
Uses sales orders, products, employees, and offices to demonstrate entity separation, relationships, keys, and duplication avoidance.
What it assumes
Assumes basic database-schema familiarity while defining entities, attributes, relationships, and keys through concrete examples.
What you can do after
Evaluate schema structure by identifying entities, attributes, relationships, keys, and opportunities for normalization.
How it connects
Connects entities with attributes, Entity Relationship Diagrams, primary keys, foreign keys, referential integrity, and normalization.

Also explained in

Compare how 12 books explain entity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.