0% found this document useful (0 votes)
55 views10 pages

ER Model Test

Uploaded by

melsew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views10 pages

ER Model Test

Uploaded by

melsew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Year_Of_Graduation

Institution
Specialization Cr_Hr

EDUC_LEV Room_No C_Code


TfName
Build_No
TmName C_Name

N Offers N
TlName TEACHER COURSE
1 1 N Date_employed N
N
TidNo

Works Has
TSex Year
Manage
Depn_relationship
D_Head
1 1 1 Semester
TDOB Takes
DEPARTMENT D_Name Depn_Name
Grade
1
D_Location
Register
Has
D_Number N DEPENDANT

Advisee RegDate N SFName


1
N

N
STUDENT SMName
SName
SLName
SIDNum
SSex
1. Assume that you are working for ABC Collage as Database Administrator.
ABC Collage needs to store the information of its Student, having (Stud ID, FirstName,
LastName, Age) taking a Course (Coursecode, CourseName, Cradit hrs) in different
Department with (DeptID, DeptName, officeNo).
Case1: Many students can take many courses and many courses can be taken by many
students
Case2: A student can have enrolled at one Department at a time and a department can have
many students
Case3: Course is given by a single department while a department can have many courses

2. Assume that you are working for ABC company as Database Administrator. The
company is organized into department. Each department has unique deptid, deptname
and several locations. A department controls a number of project. Each project has a
unique Pno, name and is located at a single location. We store each employee’s
unique Eno, name, salary, sex, and birthdates. Many employee works for one
department and may work on several projects.
Based on the above scenario Assess the business requirement of the prescriptions and
perform the following task by using Microsoft office vision 2007 or edraw max 2007
software
1. Identify the database Entities of the organization
2. Identify a type of Attributes for each entity
3. Draw entity relationship (ER) diagram for the identified entities with type of
Attributes

3. The company is organized into DEPARTMENTS. Each department has a name


number and an employee who manager. A department may have several locations.
Each department controls a number of PROJECTS. Each project has a unique name,

Page 1 of 10 DMU Department of Information Technology


unique number and is located at a single location. We store each EMPLOYEE’S
socio security number, address, salary, sex, and birthdates. Each employee works for
one department but may work on several projects. We also keep track of the direct
supervisor of each employee. Each employee may have a number of Dependents for
each dependent; we keep track of their name, sex, birthdate, and relationship to the
employee.
4. Flowcharts: a diagram consisting of labeled symbols, together with arrows connecting one
symbols to another.
Basic flowcharting symbols are:

Terminal point: marks the beginning or end of a program

Decision: Indicates a yes/no decision to be made by the program


Process: indicates any arithmetic computations or data movement
On-page Connector: used to connect two points without drawing a flow line

Input/output: is used to show input or output data

Flow line: is used to show the direction of logical flow

Annotation flag: used to add clarifying comments or descriptions

Inter-page Connector: used as exit or entry from a flowchart on


one page to a flowchart in another page

5. Predefined Process: indicates a process defined elsewhere


Example: A certain company plan to give a 10% bonus to each of its employees at the end of every
year. If an employee has been working 10/more years at the company, she/he is to get an additional birr
100. Draw a flowchart of an algorithm to calculate and print the bonus for a given employee.
Solution:
Analysis: the problem is to compute bonus for employee. To do so, the salary and number of
service years of the employee must be known. Let the salary be denoted by SAL, service be
denoted by YEAR and bonus by BONUS. To compute the bonus, we multiply the salary by 10%
and assign the result to BONUS. Thus, BONUS = SAL * 0.10. If the employee has served at least
10 years, birr 100 is added to the computed bonus of the employee and the result is displayed.
Otherwise the originally computed bonus is displayed.

Algorithm: uses English to write operations in a group.


1. Read employee’s salary and year of service
2. Calculate the employee’s bonus
3. If years of service is greater than or equal to 10 then increase the bonus.
Otherwise only print the bonus
Eg 1)A flowchart for calculating bonus

START

READ
SAL,
YEAR

Bonus= SAL*.1

Yes
YEAR> Bonus= Bonus+100
=10
No
dsfadfdaffgsgfsgfggff

WRITE
BONU
S

2) A flow chart for calculating interest amount


STOP
Start

Read NAME,
BALANCE, RATE

Interest=BALANCE *RATE
3) A program that identifies a larger and smaller number from two numbers
Start

Read A, B

Yes Big=B
A<B?
Small=A

No

Big=A
Small=B

Display Big, Small

Stop
4) Calculate grade for ten students based on the scale:
>80-A Start
>60-B
>50-C
Count=1 >40-D
<40-F

Read NAME, MARK


1.

Yes
MARK>80 ? GRADE-A

No

Yes GRADE-B
MARK>60 ?

No

Yes GRADE-C
MARK>50 ?

No

Yes GRADE-D
MARK>40 ?

No
GRADE-F

Increment Count
Pseudo-code:
It is much similar to real code. We use verbs to write pseudo-code. Capitalize important words that show actions.
Eg 1) A pseudo-code to calculate interest rate
ACCEPT Name, Principal, Rate
Interest=Principal X Rate
DISPLAY Name, Interest
2) A pseudo-code to calculate bonus
ACCEPT Name, Salary
Bonus=SalaryX0.1
ACCEPT Serviceyear
IF Serviceyear>10 Then
Bonus+100
ENDIF
DISPLAY Bonus
3) A pseudo-code that calculates grade
ACCEPT Mark, Name
IF Mark>80 Then
GradeA
ELSE IF Mark>=70 Then
GradeB
ELSE IF Mark>=60 Then
GradeC
ELSE IF Mark>=50 Then
GradeD
ELSE
GradeF
ENDIF
DISPLAY Grade, Name
Solution 5
Check here: http://sqlwithmanoj.com/2014/09/15/db-basics-what-are-candidate-primary-composite-super-keys-and-difference-between-
them/[^]

I'll take example of an Employee table:


Employee (
Employee ID,
FullName,
SSN,
DeptID
)

1. Candidate Key: are individual columns in a table that qualifies for uniqueness of all the rows. Here in Employee table EmployeeID &
SSN are Candidate keys.

2. Primary Key: is the columns you choose to maintain uniqueness in a table. Here in Employee table you can choose either EmployeeID or
SSN columns, EmployeeID is preferable choice, as SSN is a secure value.
3. Alternate Key: Candidate column other the Primary column, like if EmployeeID is PK then SSN would be the Alternate key.

4. Super Key: If you add any other column/attribute to a Primary Key then it become a super key, like EmployeeID + FullName is a Super
Key.

5. Composite Key: If a table do have a single columns that qualifies for a Candidate key, then you have to select 2 or more columns to make
a row unique. Like if there is no EmployeeID or SSN columns, then you can make FullName + DateOfBirth as Composite primary Key. But
still there can be a narrow chance of duplicate row.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy