Data Modelling

3 downloads 233 Views 545KB Size Report
9) Now right click on Component View→Data Modeler→New→Database and press ... 18) Now for generating the SQL script
Data Modelling 1) Start Rational Rose

2) On the window that appears click Cancel

3) By default the Class Diagram window appears. If not then click BROWSE--> Class Diagram 4) Create Classes as per the requirement. Right Click on a class and Select New Attribute to add attributes to the respective class. 5) Now make the class Persistent by right clicking on the ClassOpen SpecificationDetails tabPersistent radio button and Click OK. Repeat the same for all the Classes

6) Save the Class Diagram. 7) Now on the left sidebarright click on Logical ViewNewPackage.

Give any name to the package

8) Drag and drop all the classes from the logical view to the package just created.

9) Now right click on Component ViewData ModelerNewDatabase and press Enter A database (DB_0) is created. Right Click and Select Open Specification. Select Target as ANSI SQL 92 and press OK

10) Now two new packages are automatically created in Logical View by the names Global Datatype and Schema. Expand Schema.

11) Next right click on the package earlier created by you and Select Data ModelerTransform to Data Model…

12) In the dialog box select the Target Database you created earlier (DB_0). Press OK

13) You can see that new Schema (S_0) is generated in Schemas. Expand it.

14) Now Right Click on the Schema (S_0)Data ModelerNewData Model Diagram

15) A new Data model diagram is generated. Double Click on it.

16) In the new Window drag and drop all the tables from the schema to the screen.

17) In the table, the datatype for name is given as INT. Double click on the datatype. In the dialog box select the Columns tabChange the datatype to varchar.

Change the length of the datatype by double clicking on attribute nameselect Type TabLengthPress Ok

18) Now for generating the SQL script right click on Schema (S_0)  Data ModelerForward Engineering

19) A dialog box appears. Click Next.

20) Select the options of your choice. Click Next.

21) Click on Browse and give a filename to your SQL script and Click on Save. Click Next.

22) Click Finish. Open the SQL script generated in Notepad to view it.