What is an MCD? The Merise conceptual data model
MCD stands for modèle conceptuel de données, the conceptual data model of Merise, a database design method taught across France, Belgium and much of the French-speaking world. If you know entity-relationship diagrams, you already know most of it.
What goes in it
An MCD describes what a system needs to remember and how those things relate. It should make sense to someone who has never written SQL, so there are no tables, foreign keys or column types yet. Those come in the next step, the MLD (logical data model).
People also call it an MCD diagram or an entity-association model. Compared with a typical ER diagram, the main differences are the vocabulary and where cardinalities sit. Merise writes them as min,max next to the entity they describe.
Vocabulary
- An entity is a thing worth describing, like a customer or a product. It's drawn as a rectangle.
- An attribute is a piece of information about it, such as a name, a price or a date.
- The identifier is the attribute that tells occurrences apart. It's underlined.
- An association links entities and is named with a verb (places, contains). It can have attributes of its own.
- Cardinalities sit on each leg of an association: the minimum and maximum number of times one occurrence takes part in it. They're 0,1, 1,1, 0,n or 1,n.
An example
An online shop. A customer places orders, an order contains lines, and each line refers to a product in some quantity.
A customer may not have ordered anything yet, hence the 0 in 0,n. An order belongs to exactly one customer, so 1,1.
The brackets in (1,1) on the Line side mean relative identification. A line number alone doesn't find a line; you also need its order. In ER terms, Line is a weak entity.
Quantity belongs to the concerns association rather than to an entity, because it depends on both the line and the product.
Under the diagram, the MLD shows the resulting tables. Primary keys are underlined and foreign keys start with #.
How to build one
- Go through the brief and list what must be remembered. Nouns tend to become entities or attributes, verbs become associations.
- Group the attributes into entities and give each one an identifier.
- Connect the entities with associations.
- For each leg, ask how many times at least and at most. Can a customer exist with no orders? Then it's 0,n, not 1,n.
- Check that each attribute appears only once and can't be computed from the others.
To practise, the macgram editor runs in the browser. The MLD is written under your diagram as you draw, so you see straight away what a cardinality changes.
Before the MCD, you often write the user stories and draw the use case diagram. macgram keeps them in the same document as the diagram.