MySQL Database Creation with CASE Tools
CASE (computer-aided software engineering) can be very helpful when creating new software or a Web application, with many features that can increase productivity and speed up the creation process. There are many CASE tools available, with some specialized for certain parts of software development. For example, CASE tools can be used for database programming. Because database modeling is an integral part of every program and MySQL is a very popular database server, in this article I will explain how to use CASE software to create a MySQL database.
Why Use CASE Software to Create a MySQL DB?
If you are accustomed to creating your SQL code manually and visualizing your MySQL database model in your head, you may ask yourself what the advantages of using CASE tools are. Well, MySQL CASE tools have many benefits:
- You don't have to write code--this is done automatically. By clicking export when the modeling is finished, you will get your SQL create script.
- The database diagrams created are much easier to work with than code; they help you see the whole database and its table relations much better.
- Database relations and data types are pre-made, which means minimal repetitive tasks and wasted time.
- Once created, a MySQL database diagram can be saved as an image or XML file, which means that you can easily send it to your colleagues.
- You can connect to the database and synchronize it.
In short, use MySQL CASE software to become a better and faster coder.
MySQL Database Diagrams
Database creation is not a one-step task. In order to create a good database, you have to make an abstract model of it before generating your SQL code. This abstract model is known as an EER (extended entity relationship) diagram. Let's review its main characteristics.
While creating the diagram, you have to think of your database as a whole and identify the objects in your application as well as the relationships between them. There are a few relationship types:
- One-to-one: exactly 1 object corresponds to exactly 1 other object
- One-to-many: 1 object is related to many other objects
- Many-to-many: Both objects can be related to many objects of different types
For example, if you are creating a website about car prices, car, make and dealer would be some of the objects. A car can have only one manufacturer, but the manufacturer can make many car models (one-to-many relation); while a dealer can sell many different cars and one car can be found in many dealer shops (many-to-many). Here is an example of an EER diagram.
There are two more types of relations: generalization and specialization. They are very important for reducing redundancy and creating class hierarchy later. Generalization is the process of grouping two similar objects into one more general object. Specialization is the opposite process. Let's take ad networks for example. They have two types of users: publishers and advertisers. Since both advertisers and publishers are actually users, they have some identical attributes, which are grouped (generalized) as users.