Download Logical Modeling in Microsoft Visio

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Jet Database Engine wikipedia , lookup

Database wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Functional Database Model wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
L AB F OR LU10 – D ATA A NALYSIS
AND
D ATA M ODELING
IN
V ISIO
O VERVIEW
In this lab, we will learn to map and then draw the Logical models with Microsoft Visio using the ERD’s we created
in the previous lab..
L EARNING O BJECTIVES
Upon completion of this learning unit you should be able to:

Understand the concept of logical data modeling

Construct Relational Model Diagrams

Demonstrate how to map ideas from the conceptual model into the logical model.

Develop entity relationships and define various types of attributes
L AB G OALS
Our lab goals are to:
1.
Learn to build Logical models in Microsoft Visio.
2.
Create the 4 Logical models from the ERD you drew in the previous lab.
You will accomplish this by drawing the 4 diagrams from the previous lab as logical models. Draw each logical
model in its own Visio document and hand in all 4 diagrams by FTPing them to your account space on the
ISTSTUDENTS server. To submit in the learning unit assessment, paste the URL to the Visio file in the text box of
the LUA.
W HAT
YOU WILL NEED TO BEGIN
1.
A copy of Microsoft Visio 2003 (or higher)
2.
Access to your FTP account on ISTSTUDENTS (same logon and password as you use for SQL Server)
3.
The Digital copies or printouts of your 4 conceptual models from last week.
4.
You might need this week’s reading and PowerPoint to figure out how to map the Conceptual Model into
the logical Model.
P ART 1: U SING M ICROSOFT V ISIO
FOR
L OGICAL M ODELING
O VERVIEW
1/7
This section will explain how to use Microsoft Visio to create Logical Models. Microsoft Visio has built-in database
tools for creating logical data models so this should be more comfortable than creating conceptual models. The
following is a Demo of how to create a logical model:
S TEP 1: C REATE N EW D OCUMENT
The first step is to create a new document.
From the Visio Menu, choose: File  New  Database  Database Model Diagram
This will create your blank Visio page, and load the default database toolset.
S TEP 2: S ETTING
UP
V ISIO
FOR
L OGICAL M ODELING
1.
From the menu, choose Database  Options  Driver and select Microsoft SQL Server then click Ok.
2.
From the menu, choose Database  Options  Document, and be sure to set-up the settings as follows:
3.
Then when you’re done, click Ok.
S TEP 3: A DD T ABLES AND C OLUMNS
Drag and drop an entity onto the page.
follows:
You should see a database properties window below. Fill it out as
Next add columns and set data types as follows:
2/7
You want your table to look like this:
Now try to add another entity, and set it up like this:
You’re ready to try a FK relationship.
S TEP 4: A DDING
FOREIGN KEYS
Use the relationship tool to add a foreign key.
To do this, drag and drop the line on the page and then
connect the arrow head  to the primary key side (i.e. the one side of the relationship) and the tail to the foreign
key side (i.e. the many side of the relationship). For example, since a department employs many employees, the
arrow should point towards the departments table like this:
Notice how when you connected the arrow to both entities the foreign key was automatically added to the
employees table. If you need to make employees “existence dependent / weak” then make sure to set the
3/7
department_id to required:
Next click on the relationship line, and you will see the following:
This dialog shows that you can change the foreign key around as you wish by selecting the columns and clicking 
disconnect  and  associate 
S TEP 5: A DDING
CHECK CONSTRAI NTS , DEFAULTS , AND UNIQUE CONSTRAINTS
To add a check constraint:
1.
Click on the employees table.
2.
Select check from the database properties window.
3.
Click the Add button.
4.
In the code editor window, under Body, type
4/7
5.
In the code editor window, under Properties type
6.
If you’re successful you should see the following in the database properties window:
To add a Unique Constraint:
1.
Click on the employees table.
2.
Select Indexes from the database properties window.
3.
Click the New… button.
4.
In the Create Index dialog, enter:
and click Ok.
5/7
5.
In the Properties window, select Unique constraint only for the index type, and add employee_ssn to the
indexed columns like this:
To add a Default Value:
1.
Click on the employees table.
2.
Select Columns from the database properties window.
3.
Click on the employee_hiredate column row, and click the Edit… button.
4.
In the column properties page on the Defintion tab. Enter getdate() and then select is an expression or
function call.
When you’re ready click Ok.
S UMMARY
6/7
This concludes how to implement a logical model in visio. When you’re done you should have something like this:
If you would like to generate a data-dictionary from this logical model, then do the following:
To Generate a Data Dictionary from this Logical Model:
1.
From the menu, choose Database  Report
2.
From the New Report Wizard, choose a Table Report and click Finish.
3.
Change the pre-defined report to Combined Report this shows the most information.
4.
Print, Preview, or Export the report to RTF to edit further.
P ART 4: C REATING
THE
4
DIAGRAMS FROM CLASS EXERCISE
&
HANDING IT IN .
Take the 4 diagrams from class you drew last week and map and draw them as logical models.

One document per diagram. (4 Visio Documents total) Name each file one with the appropriate number at
the end lu10-1.vsd for example.

Upload the document to your space on ISTSTUDENTS using FTP

Verify you can access the document over HTTP:
http://ist-s-students.syr.edu/yourlogon/ lu10-1.vsd

Once you are done paste the url in the textbox for the learning unit assessment to turn in the lab.
7/7