LAB Logical Database Design
LAB Logical Database Design
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"(
-! " 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!
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 ., ) 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,
"#D
' OL*M#)
Drag and drop an entit+ onto the page! below! 1ill it out as follows,
.<=
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
co#str&i#t(
-! 'lic: on the e)*+o$ees table! .! )elect c'ec from the database properties window! 6! 'lic: the A%% button!
/<=
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<=
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&++!
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!
(4E
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!
=<=