Theory
Design before you build
Meera's nephew is about to build her shop database. A good builder does not lay bricks randomly, he draws a plan first.
For databases, that plan is an E/R diagram, and it is built from just three kinds of pieces: the things you store, their details, and how they connect. Get these three right on paper and the tables almost write themselves.
And there is a lovely shortcut for finding them: they hide inside an ordinary English sentence describing the business.
Theory
Nouns and verbs of your business
Describe Meera's shop in one sentence: "A customer places an order for items." Grammar just handed you the design. The nouns (customer, order, item) are the entities, the things you store. The details you would add ('the customer's name, the item's price') are attributes. The verb ('places') is the relationship. E/R design is largely reading the nouns and verbs out of a plain description.
At a glance
The three E/R building blocks
| Element | Is | Shape / becomes |
|---|---|---|
| Entity | A thing you store (Customer) | Rectangle / a table |
| Attribute | A detail (name, price) | Ellipse / a column |
| Relationship | An association (BUYS) | Diamond / a link |
Theory
The three, precisely
- Entity: a real-world thing you keep data about, Customer, Item, Order. Drawn as a rectangle. Each entity becomes a table.
- Attribute: a property of an entity, a Customer's name and phone, an Item's price. Drawn as an ellipse. Each attribute becomes a column.
- Relationship: an association between entities, usually a verb: Customer buys Item, Customer places Order. Drawn as a diamond.
Notice: entity to table, attribute to column is exactly Meera's spreadsheet (items down the rows, details across the columns), now with a proper design vocabulary.
Quiz
In 'A customer places an order', which word is the RELATIONSHIP?
- places (the verb connecting the two entities)
- customer
- order
- a
Show the answer
places (the verb connecting the two entities)
places is the verb linking the two entities (Customer and Order), so it is the relationship, drawn as a diamond. 'Customer' and 'order' are the entities (nouns, drawn as rectangles). The noun-vs-verb heuristic, nouns become entities/attributes, verbs become relationships, is the fastest way to read an E/R design out of a description.
Think first
Entity or attribute?
In Meera's shop, is 'phone number' an ENTITY or an ATTRIBUTE? What about 'Supplier'? Give the test you used to decide.
Show the answer
'Phone number' is an attribute (a detail of a customer, drawn as an ellipse, becomes a column). 'Supplier' is an entity (a thing with its own details like name and address, drawn as a rectangle, becomes a table). The test: can it stand alone with its own properties? If yes, entity; if it is just a detail describing something else, attribute. This entity-vs-attribute judgement is the core skill of E/R design.
Watch out
Where marks leak
Mixing up the shapes: entity = rectangle, attribute = ellipse, relationship = diamond, exams give marks for the correct symbols. Confusing an entity (a standalone thing, becomes a table) with an attribute (a detail, becomes a column). And forgetting that relationships are usually verbs. When asked to 'identify entities, attributes and relationships' from a paragraph, underline nouns and verbs first, it is the reliable method.
Theory
This is the blueprint stage
Every real database project starts here: talk to the client, write down the business in sentences, extract entities, attributes and relationships, draw the E/R diagram, then build the tables. Skip it and you get Meera's tangled spreadsheet. In your BCA project, an E/R diagram is often a required deliverable. Next lesson adds the crucial detail to relationships: how many, one-to-one, one-to-many, many-to-many (cardinality).
Summary
Key takeaways
- The E/R model designs a database before building it, using three blocks.
- Entity: a thing you store (Customer, Item), drawn as a rectangle, becomes a table.
- Attribute: a detail of an entity (name, price), drawn as an ellipse, becomes a column.
- Relationship: an association between entities (BUYS, places), drawn as a diamond, usually a verb.
- Heuristic: nouns become entities/attributes, verbs become relationships.
- Memory hook: read the nouns and verbs of your business out loud.