Data modeling of Enterprise Architect 8 (CREATE TABLE)
----------
1. We create a view of the database modeling
1.1 The New Diagram window, select Extended on the left select from and select data types in the right diagram modeling.
1.2 Open the Diagram window, you can choose the left data modeling in the Table,view,procedure and so on database design.
2. Create a table
2.1 Click the table in the left data modeling and put it in the view
2.1 Enter the name of the table on the Name property of the General tab in the Expand Table Properties dialog box, and select the type of database you want to use on the DB property.
Then click Apply to Save
3. Set MySQL option (if using MySQL)
In MySQL, using the foreign key, you must define the type of the table as InnoDB, as follows:
3.1 In the table's Properties pop-up box, select Tagged Values page sign.
3.2 Click the new tag button and eject the Tagged value pop-up box.
3.3 Enter the tag name in the tag input box: Type, in the Value text box: InnoDB
3.4 Click OK to save this option, the table type is included in the SQL script when the DDL is generated.
Allow later versions of MySQL to add additional table options in the same way:
Tag |
Value (Example) |
ENGINE |
InnoDB |
CHARACTER SET |
Latin1 |
CHARSET |
Latin1 |
COLLATE |
Latin1_german2_ci |
4. Set the Oralce property (if Oracle is used)
If you are using an Oracle database, we will set the properties of the table and set the method with the above MySQL settings option.
List of all available attributes in Oracle:
Property/tag |
Value |
Buffer_pool |
DEFAULT |
CACHE |
NoCache |
Dbversion |
9.0.111 |
Freelists |
1 |
GRANT OWNER1 |
SELECT |
GRANT OWNER2 |
DELETE, INSERT, SELECT, UPDATE |
INITIAL |
65536 |
Initrans |
1 |
LOGGING |
LOGGING |
Maxextents |
2147483645 |
Maxtrans |
255 |
Minextents |
1 |
Monitoring |
Monitoring |
OWNER |
OWNER1 |
PARALLEL |
Noparallel |
PCTFREE |
10 |
Pctincrease |
0 |
Pctused |
0 |
Synonyms |
Public:table_pub;owner2:table_owner2 |
Tablespace |
My_tablespace |
Temporary |
YES |
5. Create a column
Note: If it is MySQL, first add the enum and set data types before creating the column. Select Settings-->database datatypes, in the Database Datatypes pop-up box, select MySQL in the Product name field, and then add an enum and set data type ( This complex type can select the default type of data to include.
Follow the steps below to create a column:
5.1 Right-click on the table on the view to open the menu, select the Attributes option to open <Tablename> columns pop-up box.
5.2 Name text box, enter the name of the column you want to add
5.3 The data Type Drop-down list, select a datatype and click the Save button
Tip: If the Drop-down list is empty, it is because no target database is specified for the table, you can double-click the table to select it in the pop-up box.
Optional for 5.4 columns
--primary key: Represents a primary key
--not null: null is not allowed
--unique: Unique Constraint
--initial: Initial Default value
--alias: Alias
--notes: Notes
Note: Some data types, such as the Oracle number type, also require precision and scale, as in example: Create number by setting Precision = 8 and Scale = 0
The options for columns are also available, and when you select a drop-down list of data types, they appear according to the type you want. It also provides a length input box like Varchar,char.
For MySQL enum and set data types, when initializing values, use a comma-delimited list of formats such as: (' One ', ' two ', ' three '), if a value is default, then ' three ' by default.
5.5 If you need to build sequence, like Oracle's sequence as the primary key, select the new column in the pop-up box (which will be the primary key), click the Database Columns Properties button, and then select the Autonum property, set to True. If you want, you can set the Startnum (start number) and increment (increment).
5.6 Click the Save button, and then you can create the next field in the same way, and then close it at the end.