We will start by describing the entities or tables in the Databases world, as in art databases brings into another language information or an entity that is representative in the real world. In other world we model aspects of the real world, so we have the need to represent a physical thing or just a fact.
As you may have seen on my previous UML posts you remember the meaning of this, if you haven’t read it then go back or at least you need minimum knowledge from databases and UML.

First, we have understand that UML is considered a tool used mainly fro oriented software systems, so in this kind of tutorial I’ll try to use a class or an object or entity as I have previously named it, to convert it to a table fro any database. Off course sintaxis it is not our main focus here.
The following image represents a class diagram that we should be able to understand and transcript into a table on a database. So we have to consider different things, first the name: as a noun represent a thing or fact, description: the description on natural language, it helps you to comprehend to know

The UML notation for a class is a three-element rectangle that shows the class name (always a singular noun) at the top of the rectangle, its list of attributes with a data type in the mid section, and a list of methods at the bottom. Since the classes used in this tutorial are modeling information and not behavior or actions that objects can take, the diagrams will exclude the third section listing methods. In addition, for the sake of brevity and clarity, some of the diagrams may not list the attributes’ data types and readers are encouraged to add the appropriate data types.

An object is the instance of a class. Methods can be invoked on an object to inspect and manipulate its properties. Unlike in OO systems, traditional relational databases store information as records of data, not as objects. Thus, for now, we are interested in learning how to model the attributes of a class without being concerned with the methods, thus explaining why these were excluded from the class diagram. In building a relational database, each class is first translated (mapped) into a relational model scheme. The scheme is identified by the plural form of the class name, and lists all of the attributes in the class diagram.
What is mapping?
Is the act of determining how objects and their relationships are persisted in permanent data storage, in this case relational databases.
On a relationship mapping describes how to persist a relationship (association, aggregation, or composition) between two or more objects.
It’s important to recognize that defining schemes or domains as sets of elements automatically tells us a lot more about them, from the mathematical properties of sets.
- A set cannot contain duplicate elements.
- The elements in a set are unordered.
- Given a set, rules can be developed to determine when an element can be included or excluded from it.
- We can define subsets of them; for example, we can display only a selected set of attributes from a scheme, or we can limit the domain of an attribute to a specific range of values.
- They may be manipulated with the usual set operators: union, intersection, etc. For example, given a set of customers from one company and a second set of customers from a different company, the intersection of these gives the set of customers in common to both companies.
When we actually build the database, each relation scheme becomes the structure for one table. The SQL syntax for creating the table includes a data type for each attribute, which is needed for the database but a data type is not the same as the domain of the attribute.

Leave a comment