Upcoming SlideShare
×

# Cis336 week 1 i lab 1

373 views

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
373
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
3
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Cis336 week 1 i lab 1

1. 1. CIS 336 Week 1 iLab 1 Devry UniversityClick this link to get the tutorial:http://homeworkfox.com/tutorials/general-questions/4148/cis-336-week-1-ilab-1-devry-university/LABOVERVIEWScenario/SummaryThis lab will introduce you to the processes involved in defining one of the key components of adata model; the relationship diagram (RD). In this lab, you will draw a relationship diagram fortwo of the steps shown. Keep in mind when you are trying to decide which side of therelationship should be the "one" side and which should be the "many" that you must first decidewhich side has the primary key, or unique identifier. Once you have decided the primary key ofthe relationship, you have identified the "one" side of the relationship. Note that for an RD, theforeign key "many" side of the relationship points to the primary key "one" side. The "one" sideshould have the arrowhead point of the connecting line. This is different than anentity/relationship diagram (ERD) that we will draw next week, where the "many" side hascrows feet.This will familiarize you with how to set up MS Visio to draw database diagrams. Steps 1 - 3below use the Customer, Order, and Employee tables of a simplified Order Entry database. TheCustomer table records clients who have placed orders. The Order table contains the basic factsabout customer orders. The Employee table contains facts about employees who take orders. Theprimary keys of the tables are CustNo for Customer, EmpNo for Employee, and OrdNo forOrder.The following are the TABLE definitions for the first three tables showing the PRIMARY KEYconstraints.TABLE Customer has the following attributesCustNo NUMBER(5)CustFirstName VARCHAR2(20)CustLastName VARCHAR2(30)CustCity VARCHAR2(30)CustState CHAR(2)CustZip CHAR(10)CustBal NUMBER(12,2)CustNo is the PRIMARY KEY
2. 2. TABLE Employee has the following attributesEmpNo NUMBER(5)EmpFirstName VARCHAR2(20)EmpLastName VARCHAR2(30)EmpPhone CHAR(15)EmpNo is the PRIMARY KEYTABLE Order has the following attributesOrdNo NUMBER(5)OrdDate DATECustNo NUMBER(5)EmpNo NUMBER(5)OrdNo is the PRIMARY KEYYour task for this lab is to create the required relationship diagram for steps 1 and 2 usingMicrosoft Visio. Step 3 will require you to analyze the scenario given and present your ownresolution to the question. Step 4 is an individual assignment that will introduce you to the groupproject and the process of identifying entities and attributes. When finished with the lab, youshould have a complete diagram using all 5 entities, a written explanation for #3, and two lists(entities and attributes) for Step 4.DeliverablesThe deliverable for this lab is a single MS Word document named "Lab1_solution_yourname"with the diagram for problems 1 and 2, the written answer for the question in Step 3, and the listsof entities and attributes for the Initial Project Exercise (Step 4). You should copy and paste thediagram from MS Visio into a Word document and use this document for Steps 3 and 4. LABSTEPSSTEP 1: Drawing your first ER diagram TitleIdentify the foreign key columns in the table structures above and draw a relationship diagramdepicting the relationships between the tables. In the Order table , the CustNo column referencesthe Customer table and the EmpNo column references the Employee table. For each relationship,identify the table on the "1" side of the relationship and the table on the "Many" side.
3. 3. STEP 2: Extending the ER diagramExtend your relationship diagram from problem 1 by adding two tables (OrdLine and Product).Table definitions for the table structures and primary keys constraints are shown below. You willneed to identify the FOREIGN KEY(s) to complete this problem. When finished you shouldhave a total of 5 tables represented in your diagram for this problem. To copy and paste thediagram into Word, select Edit from the menu and then Copy Diagram. Open a Word documentand use CTRL-V to paste the diagram.TABLE Product has the following attributesProdNo CHAR(8)ProdName VARCHAR2(20)ProdNo is the PRIMARY KEYTABLE OrdLine has the following attributesOrdNo CHAR(8)ProdNo CHAR(8)Qty NUMBER(5)The combination of OrdNo and Prodno is the PRIMARY KEYSTEP 3: Should a NULL be allowed?From examination of the sample data and your current understanding of businesses in whichorders could be placed either in person, over the phone, or over the Internet, determine if itwould be permissible for null values to be allowed for the foreign key EmpNo in the Order table.This column would reference back to the EmpNo column in the employee table. Why or whynot?OrdNo OrdDate CustNo EmpNoO1656777 02/11/2000 C8543321O7959898 02/19/2000 C8543321 E8544399STEP 4: Initial Project ExerciseAlthough the overall project itself will be done as a group, this first exercise is designed as anindividual effort and is intended to; (1) get you to read the project specifications, and; (2)introduce you to the first step in designing a database from scratch. This little exercise will have
4. 4. you see how many entities and attributes you can find in the project specifications. In week three,you will work with your assigned project team and compare notes on what you have found. Thisis not rocket science here so remember, you are looking for people, places, things, and events(entities) and the attributes that describe them.