A relational database implements the Relational Model. By model we mean by model is that it serves as an abstraction to the complex real-world. Usually we will abstract data.
A relation, as defined by E. F. Codd., is a set of tuples (d1; : : : ; dn) where each element dj is a member of Dj.
A relation is approximately a table – so a relational database uses tables to represent data.
Relational Databases are an implementation of Relational Algebra, a theory for modelling data and defining queries on such data.
The following summarises a set of rules for Relational Databases.
The Relational Model is not the same as the Entity Relationship Model. An ER Model helps us model concepts, usually as part of the design of a Relational Database. SQL is a standard that attempts to implement the Relational Model.
3.02 Drawing a database: Basic Entity-Relationship diagrams
Some terms we need to know.
How do we draw an entity? An entity is basically a box, with a word in it. eg:
An attribute is similar but we use an ellipse instead.
So to show an entity with an attribute we simply show them both with a line between the two.
In a database design you would see a box with lots of ellipses coming off it, because an entity would have many different attributes.
To show a relationship we draw a diamond, like this:
As we mentioned above, a relationship is a connection or dependency between two entities. So we can draw lines connecting entities to the relationship, like this:
We use words like “has student” to describe the relationship. In a simple example like this we could use “teaches”, etc – whatever it is that describes the relationship. You can give it a name that’s useful to you.