0% found this document useful (0 votes)
152 views

LAB Logical Database Design

This document provides an overview of how to create logical data models in Microsoft Visio. It outlines the steps to set up a new Visio document for logical modeling, add tables and columns, define primary and foreign keys through relationships, and add constraints like checks, unique constraints, and default values. The goals are to learn how to build logical models in Visio and create the logical models from conceptual models drawn in a previous lab by mapping them in Visio and submitting the files.

Uploaded by

Anas Sakr
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views

LAB Logical Database Design

This document provides an overview of how to create logical data models in Microsoft Visio. It outlines the steps to set up a new Visio document for logical modeling, add tables and columns, define primary and foreign keys through relationships, and add constraints like checks, unique constraints, and default values. The goals are to learn how to build logical models in Visio and create the logical models from conceptual models drawn in a previous lab by mapping them in Visio and submitting the files.

Uploaded by

Anas Sakr
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

L AB F OR LU10 D ATA A NALYSIS O VERVIEW

AND

D ATA M ODELING

IN

V ISIO

In this lab, we will learn to map and then draw the Logical models with Microsoft Visio using the ERDs we created in the pre ious lab!!

L E"R#I#$ O %&E'(IVE)
*pon completion of this learning unit +ou should be able to,

*nderstand the concept of logical data modeling 'onstruct Relational Model Diagrams Demonstrate how to map ideas from the conceptual model into the logical model! De elop entit+ relationships and define arious t+pes of attributes

L "% $ O"L)
Our lab goals are to, -! Learn to build Logical models in Microsoft Visio! .! 'reate the / Logical models from the ERD +ou drew in the pre ious lab! 0ou will accomplish this b+ drawing the / diagrams from the pre ious lab as logical models! Draw each logical model in its own Visio document and hand in all / diagrams b+ 1(2ing them to +our account space on the I)()(*DE#() ser er! (o submit in the learning unit assessment, paste the *RL to the Visio file in the te3t bo3 of the L*"!

W 4"(

0O* WILL #EED (O %E$I#

-! " cop+ of Microsoft Visio .556 7or higher8 .! "ccess to +our 1(2 account on I)()(*DE#() 7same logon and password as +ou use for )9L )er er8 6! (he Digital copies or printouts of +our / conceptual models from last wee:! /! 0ou might need this wee:s reading and 2ower2oint to figure out how to map the 'onceptual Model into the logical Model!

2 "R( -, * )I#$ M I'RO)O1( V I)IO O VERVIEW

1OR

L O$I'"L M ODELI#$

(his section will e3plain 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! (he following is a Demo of how to create a logical model,

) (E2 -, ' RE"(E # EW D O'*ME#(


(he first step is to create a new document! 1rom the Visio Menu, choose, 1ile #ew Database Database Model Diagram (his will create +our blan: Visio page, and load the default database toolset!

) (E2 ., ) E((I#$

*2

V I)IO

1OR

L O$I'"L M ODELI#$

-! 1rom the menu, choose Database Options Dri er and select Microsoft SQL Server then clic: O ! .! 1rom the menu, choose Database Options Document, and be sure to set;up the settings as follows,

6! (hen when +oure done, clic: O !

) (E2 6, " DD ( "%LE)

"#D

' OL*M#)

Drag and drop an entit+ onto the page! below! 1ill it out as follows,

0ou should see a database properties window

.<=

#e3t add columns and set data t+pes as follows,

0ou want +our table to loo: li:e this,

#ow tr+ to add another entit+, and set it up li:e this,

0oure read+ to tr+ a 1> relationship!

) (E2 /, " DDI#$

1OREI$# >E0)

*se the relationship tool to add a foreign :e+! (o do this, drag and drop the line on the page and then connect the arrow head to the primar+ :e+ side 7i!e! the one side of the relationship8 and the tail to the foreign :e+ side 7i!e! the man+ side of the relationship8! 1or e3ample, since a department emplo+s man+ emplo+ees, the arrow should point towards the departments table li:e this,

6<=

#otice how when +ou connected the arrow to both entities the forei"# e$ was automaticall+ added to the emplo+ees table! If +ou need to ma:e emplo+ees ?e3istence dependent < wea:@ then ma:e sure to set the departmentAid to reBuired,

#e3t clic: on the relationship line, and +ou will see the following,

(his dialog shows that +ou can change the foreign :e+ around as +ou wish b+ selecting the columns and clic:ing %isco##ect and &ssoci&te

) (E2 C, " DDI#$


To &%% & c'ec

'4E'> 'O#)(R"I#() , DE1"*L() , "#D *#I9*E 'O#)(R"I#()

co#str&i#t(

-! 'lic: on the e)*+o$ees table! .! )elect c'ec from the database properties window! 6! 'lic: the A%% button!

/<=

/! In the code editor window, under Bo%$, t+pe

C! In the code editor window, under ,ro*erties t+pe

D! If +oure successful +ou should see the following in the database properties window,

To &%% & U#i-.e /o#str&i#t( -! 'lic: on the e)*+o$ees table! .! )elect I#%e0es from the database properties window! 6! 'lic: the Ne12 button!

C<=

/! In the /re&te I#%e0 dialog, enter,

and clic: O ! C! In the ,ro*erties window, select U#i-.e co#str&i#t o#+$ for the inde3 t+pe, and add emplo+eeAssn to the inde3ed columns li:e this,

To &%% & Def&.+t V&+.e( -! 'lic: on the e)*+o$ees table! .! )elect /o+.)#s from the database properties window! 6! 'lic: on the e)*+o$ee3'ire%&te column row, and clic: the E%it2 button! /! In the column properties page on the Defi#tio# tab! Enter "et%&te45 and then select is &# e0*ressio# or f.#ctio# c&++!

When +oure read+ clic: O !

D<=

) *MM"R0
(his concludes how to implement a logical model in isio! When +oure done +ou should ha e something li:e this,

If +ou would li:e to generate a data;dictionar+ from this logical model, then do the following, To Ge#er&te & D&t& Dictio#&r$ fro) t'is Lo"ic&+ Mo%e+( -! 1rom the menu, choose Database Report .! 1rom the Ne1 Re*ort 6i7&r%, choose a T&8+e Re*ort and clic: Fi#is'! 6! 'hange the pre;defined report to /o)8i#e% Re*ort this shows the most information! /! 2rint, 2re iew, or E3port the report to R(1 to edit further!

2 "R( /, ' RE"(I#$

(4E

DI"$R"M) 1ROM 'L")) EEER'I)E

4"#DI#$ I( I# !

(a:e the / diagrams from class +ou drew last wee: and map and draw them as logical models! One document per diagram! 7/ Visio Documents total8 #ame each file one with the appropriate number at the end lu-5;-! sd for e3ample! *pload the document to +our space on I)()(*DE#() using 1(2 Verif+ +ou can access the document o er 4((2, http,<<ist;s;students!s+r!edu<+ourlogon< lu-5;-! sd Once +ou are done paste the url in the te3tbo3 for the learning unit assessment to turn in the lab!

=<=

You might also like