Professional Documents
Culture Documents
Deliverables
Your assignment will be graded based on the following.
Assignment
Step
Description
Points
Step 1
15
Step 2
15
Step 3
15
Step 4
15
60
For Steps 1, 2, 3 and 4 create a single Word document and include the answers or solutions
to all problems. Be sure to label your document and include your name and course number in
the heading. Save your document as "yourname_Lab_2.docx."
iLAB STEPS
STEP 1: Create Data Dictionary for provided elements
As the DBA for your company, you have decided to install a new version of the MySQL database to
replace the current database version being used. The old database has become a constant headache
and seems to be causing an overload on the disk drive's I/O channels. Further analysis has also
shown that two primary large tables are the main points of access. The new tables will be DEPT,
EMPLOYEE, and BONUS.
Describe how you plan to compile the Data Dictionary and decide on the tables structure
with the new MySQL database.
Attribute Name
Column name
Data Type
EMPNO
NUMBER(4)
EFNAME
ELNAME
VARCHAR2(20)
JOBCATEGORY
VARCHAR2(4)
Manager
MGR
NUMBER (4)
Hire date
HIREDATE
DATE
Salary
SAL
NUMBER (7.2)
Commission
COMM
NUMBER (7.2)
Department number(FK)
DEPTNO
NUMBER(2)
10
Department name
DEPTNAME
VARCHAR2(14)
11
Location
LOC
VARCHAR2(13)
12
Job title
JOBTITLE
VARCHAR2(20)
13
Job description
JOBDESC
VARCHAR2(20)
NN
Attribute
Name
Column name
Data Type
Data
element
Table
name
Primary
key/
Not
NULL
Default
value
description
Foreign
key
indicator
(P/F)
Bonus
Number
BONO
NUMBER(2)
Bonus
Identificatio
n Number
Bonus
YES
00
1.1
Bonus
Type
BONUSTYPE
VARCHAR2(1
3)
Type of
Bonus
Bonus
1.2
Jab
Category
JOBCATEGOR
Y
VARCHAR2(4)
Job
Category
Number
Bonus
YES
MNGR
Departme
nt number
DEPTNO
NUMBER(2)
Number of
Department
Dept.
YES
00
2.1
Departme
nt Name
DEPTNAME
VARCHAR2(1
4)
Name of the
Department
Dept.
YES
Marketin
g
2.2
Location
LOC
VARCHAR2(1
3)
Dept.
Location
Dept.
YES
2.3
Employee
Number
EMPNO
NUMBER(4)
Employee
record
identificatio
n number
Employe
e
YES
0000
Employee
Number
EMPNO
NUMBER(4)
Employee
record
identificatio
n number
Employe
e
YES
0000
3.1
Employee
First
Name
EFNAME
First Name
of the
employee
Employe
e
YES
Smith
3.2
Employee
Last
Name
ELNAME
VARCHAR2(2
0)
Last Name
of the
employee
Employe
e
YES
John
3.3
Hire Date
HIREDATE
DATE
Date Started
Working
Employe
e
YES
3.4
Salary
SAL
NUMBER (7.2)
Employee
Remuneratio
n
Employe
e
YES
YES
3.5
Commissi
on
COMM
NUMBER (7.2)
Earned
Commission
Employe
e
NO
3.6
Job
Category
JOBCATEGOR
Y
VARCHAR2(4)
Job
Category
Number
Employe
e
YES
MNGR
Jab
Category
JOBCATEGOR
Y
VARCHAR2(4)
Job
Category
Number
Job
YES
MNGR
4.1
Job Title
JOBTITLE
VARCHAR2(2
0)
Title of the
Job
Job
YES
4.2
Job
descriptio
n
JOBDESC
VARCHAR2(2
0)
Description
of the Job
Job
YES
4.3
Departme
nt number
DEPTNO
NUMBER(2)
Number of
Department
Job
YES
00
Press Enter
d) Continue to add all tables;
2.c Foreign key creation
a) Click on the bottom of the Form Foreign key to establish the reference to parent table;
b) Choose the Reference table and Reference column;
c) Choose Foreign key options On Update and On Delete; Enter.
2.d Save database
a)
Important note:
The Setup New Connection form features a Configure Server Management button (bottom left) that
is required for the MySQL connection to perform tasks that requires shell access to the host. For
example, starting/stopping the MySQL instance or editing the configuration file Fill out the
connection details and optionally click Configure Server Management to execute the Server
Management wizard. Click OK to save the connection.
6
Important
All connections opened by MySQL Workbench automatically set the client character set to utf8.
Manually changing the client character set, such as using SET NAMES ..., may cause MySQL
Workbench to not correctly display the characters.
c) New connections are added to the Home page as a tile, and multiple connections may be
opened simultaneously in MySQL Workbench.
Part 2 Configure a New MySQL Connection
a) Click on Local Instance MySQL and enter password;
123
b) Local Instance MySQL screen appears;
c) Click MySQL Workbench Home, click database to be connected;
d) EER Diagram screen appears;
e) Choose Database on Toolbar and Forward Engineering on scroll menu;
f) Forward Engineer to Database screen appears
i) Review the SQL script to be Executed screen appears for your review and saving to file or
copy to Clipboard; Click Next;
l) Click Close.
9
Please add Management, INSTANCE and PERFORMANCE screenshots for the created
database to lab Report.
10
11
12
13
CONSTRAINT `fk_DEPT_EMPLOYEE`
FOREIGN KEY (`EMPLOYEE_EMPNO`)
REFERENCES `mydb`.`EMPLOYEE` (`EMPNO`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
b)
c)
d)
e)
f)
g) Highlight executable rows, choose Query on the Toolbar and Execute (All or Selection);
h) Output will display the results of the execution.
Please select counters and rows in database tables and add screenshots to lab Report.
14