I have no problem with converting ER to SQL tables, but I don't know how can I convert EER to SQL tables? as you Know that EER has "is a" specif开发者_开发问答ication and inheritance, but I don't know how relational databases can connect with inheritance specification
I'm not sure how to convert all the EER to SQL table in one user action, but this should work:
- Right click on a table,
- Copy the table creation script to clipboard,
- Paste this script in the shell command.
This will create the table.
Hope this helps.
I'd say look into the Hibernate storage strategies.
Hibernate is an ORM system that persists objects in an SQL database. In the link that I sent you it gives you a table schema for how the storage strategy is persisted in the SQL database.
If you use Appfuse or Groovy it can generate these relationships for you.
Then you might want to map the schema into a CASE tool of some sort to turn it into an Entity Relationship Diagram.
Simplest answer is:
The subtype table will use id of supertype as their id. This will guarantee subtype 'is a' supertype, instead of subtype 'is associated with' super type.
There are other rules for you to convert EERD generalization/specialization hierarchies (if you are interested, reply and I will send you a link to learn about all rules). However, most of the cases, following two rules are going to work
- Create a relation for a supertype, create each relation for each subtype, id of the subtype relation is the id of the supertype relation (this option generally work for all cases). Store all common attributes in the super relation, store only special attributes in the subtypes.
- For "Disjoint Mandatory Specialization/Generalization Hierarchy", you could have the option to create a table for each subtype (without having to create a relation for the supertype).
Hope this helps.
精彩评论