Académique Documents
Professionnel Documents
Culture Documents
Course: CSC271
Student: Nasir Majeed Kayani 40962
Fa15mcs016
Q. No.1: Identify all possible relations with attributes of a University database. Also mention the
following of each relation
Super key
Candidate key
Primary key
Alternate key
Foreign key
Cardinality
Degree
Answer:
ORGANIZATION
Attributes:
1. OrganizationID
2. OrganizationName
3. Founded
4. Website
Organization Relation normally will have only one record in University Database but it can be easily
made scalable to handle more than one university record by adding OrganizationID attribute in rest of
relations as Foreign Key, just like in Campus Relation.
OrganizationID
1
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
OrganizationName
University of the Punjab
None
1
4
Founded
1882
Website
www.pu.edu.pk
OrganizationID
OrganizationID, Founded
OrganizationID, Website
OrganizationName, Website
OrganizationName, Founded, Website
OrganizationID, OrganizationName, Website
OrganizationID, OrganizationName, Founded
OrganizationID, OrganizationName, Founded, Website
OrganizationID
OrganizationName, Website
OrganizationID
OrganizationName, Website
CAMPUS
Attributes:
1.
2.
3.
4.
CampusID
OrganizationID
CampusName
Address
CampusID
1
2
3
OrganizationID
1
1
1
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
CampusName
Quaid-e-Azam
Gujranwala
Jhelum
Address
123, Canal Raod, Lahore
111, Main Road, Gujranwala
55, City Road, Jhelum
CampusID
CampusID, OrganizationID
CampusID, OrganizationID, CampusName
CampusID, OragnizationID, CampusName, Address
CampusID, CampusName, Address
CampusID, CampusName
CampusID, Address
OrganizationID, CampusName
OranizationID, CampusName, Address
OrganizationID, Address
CampusName, Address
CampusID
OrganizationID, CampusName
CampusID
OrganizationID, CampusName
OrganizationID
3
4
DEPARTMENT
Attributes:
1. DepartmentID
2. DepartmentName
3. Description
DepartmentID
1
2
3
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
DepartmentName
Human Resource
Accounts
English
None
3
3
Description
HR Department for all campuses
Main Accounts Department
English Language and Linguistic Department
DepartmentID
DepartmentID, DepartmentName
DepartmentID, DepartmentName, Description
DepartmentID, Description
DepartmentName, Description
DepartmentID
DepartnameName, Description
DepartmentID
DepartmentName, Description
CONTACT
Attributes:
1.
2.
3.
4.
5.
ContactID
CampusID
ContactName
Description
ContactNumber
ContactID
1
CampusID
1
ContactName
Registrar Office L
2
3
1
2
Registrar Office F
Reception &
Information Cell L
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
3
5
Description
Registrar Office
Telephone Number
Registrar Office Fax
First Point of Contact
Telephone
ContactNumber
0092-42-12345678
0092-42-12355555
0092-431-1247777
ContactID
ContactID, CampusID, ContactName, Description
ContactID, CampusID, ContactName, Description, ContactNumber
ContactID
CampusID, ContactName, ContactNumber
ContactID
CampusID, ContactName, ContactNumber
CampusID
EMPLOYEE
Attributes:
1.
2.
3.
4.
5.
6.
EmployeeID
FullName
CNIC
DateOfBirth
ContactNumber
EmailAddress
EmployeeID
1
2
3
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
FullName
Ahmed Ali
Abdul Basit
Ali Nawaz
None
3
6
CNIC
1234-678912-5
2222-555555-9
1111-555555-2
DateOfBirth
01-03-1985
03-03-1985
04-04-1980
ContactNumber
00923335555666
00923005554446
00923335544666
EmailAddress
abc@abc.com
abdul@test.com
ali@test.com
EmployeeID
CNIC
EmailAddress
EmployeeID, FullName
EmployeeID, FullName, CNIC
EmployeeID, FullName, CNIC, DateOfBirth
EmployeeID, FullName, CNIC, DateOfBirth, ContactNumber
EmployeeID, FullName, CNIC, DateOfBirth, ContactNumber, EmailAddress
FullName, CNIC
FullName, CNIC, DateOfBirth
FullName, CNIC, DateOfBirth, ContactNumber
FullName, CNIC, DateOfBirth, ContactNumber, EmailAddress
CNIC, DateOfBirth
CNIC, DateOfBirth, ContactNumber
CNIC, DateOfBirth, ContactNumber, EmailAddress
CNIC, EmailAddress
CNIC, ContactNumber
EmployeeID
CNIC
EmailAddress
CNIC, EmailAddress
EmployeeID
CNIC
EmailAddress
CNIC, EmailAddress
FACULTY
Attributes:
1.
2.
3.
4.
FacultyID
EmployeeID
DepartmentID
Designation
FacultyID
1
2
EmployeeID DepartmentID
2
3
3
3
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
2
4
Designation
Professor
Associate Professor
FacultyID
FacultyID, EmployeedID
FacultyID, EmployeedID, DepartmentID
FacultyID, DepartmentID , Designation
FacultyID, EmployeedID, DepartmentID, Designation
EmployeedID, DepartmentID
EmployeedID, DepartmentID, Designation
FacultyID
EmployeeID, DepartmentID
FacultyID
EmployeeID, DepartmentID
EmployeeID
DepartmentID
CLASS
Attributes:
1.
2.
3.
4.
ClassID
ClassName
ClassSection
NoOfStudent
ClassID
1
2
ClassName
MA English
MA English
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
None
2
4
ClassSection
A
B
NoOfStudent
25
23
ClassID
ClassID, ClassName
ClassID, ClassName, ClassSection
ClassID, ClassName, ClassSection, NoOfStudent
ClassName, ClassSection
ClassName, ClassSectin, NoOfStudent
ClassID
ClassName, ClassSection
ClassID
ClassName, ClassSection
COURSE
Attributes:
1. CourseID
2. CourseName
3. Description
CourseID
1
2
CourseName Description
MA English
Master Degree Program in English Literature and Linguistic
MA Urdu
Master Degree Program in Urdu Language and Literature
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
None
2
3
CourseID
CourseID, CourseName
CourseID, CourseName, Description
CourseName, Description
CourseID, Description
CourseID
CourseName, Description
CourseID
CourseName, Description
STUDENT
Attributes:
1.
2.
3.
4.
5.
6.
7.
8.
Student
ID
1
2
3
StudentID
FullName
CNIC
RegistrationNumber
DateOfBirth
CourseID
ContactNumber
EmailAddress
FullName
CNIC
Amjad Ali
Raja Basit
Munawar Khan
1234-678912-1
2222-55355-3
1111-554555-6
Super Key
Registration
Number
12345
12346
12347
DateOfBirth
CourseID
ContactNumber
EmailAddress
01-03-1988
03-03-1989
04-04-1989
1
2
1
0092333554446
0092344455555
0092303557894
amjad@test.com
raja@test.com
khan@test.com
StudentID
CNIC
RegistrationNumber
StudentID, FullName
FullName, CNIC
CNIC, RegistrationNumber
StudentID, FullName, CNIC
StudentID, FullName, CNIC, RegistrationNumber
StudentID, FullName, CNIC, RegistrationNumber, DateOfBirth
StudentID, FullName, CNIC, RegistrationNumber, DateOfBirth, CourseID
StudentID, FullName, CNIC, RegistrationNumber, DateOfBirth, CourseID, ContactNumber
StudentID, FullName, CNIC, RegistrationNumber, DateOfBirth, CourseID, ContactNumber, EmailAddress
FullName, CNIC, RegistrationNumber, DateOfBirth
FullName, CNIC, RegistrationNumber, DateOfBirth, CourseID
FullName, CNIC, RegistrationNumber, DateOfBirth, CourseID, ContactNumber
FullName, CNIC, RegistrationNumber, DateOfBirth, CourseID, ContactNumber, EmailAddress
CNIC, RegistrationNumber, DateOfBirth
CNIC, RegistrationNumber, DateOfBirth, CourseID
CNIC, RegistrationNumber, DateOfBirth, CourseID, ContactNumber
CNIC, RegistrationNumber, DateOfBirth, CourseID, ContactNumber, EmailAddress
Candidate
Key
Primary Key
Alternate
Key
Foreign Key
Cardinality
Degree
3
8
StudentID
CNIC
RegistrationNumber
EmailAddress
FullName, CourseID
StudentID
CNIC
RegistrationNumber
EmailAddress
FullName, CourseID
CourseID
SALARY
Attributes:
1.
2.
3.
4.
5.
6.
7.
8.
SalaryID
1
2
3
4
5
6
SalaryID
EmployeeID
SalaryMonth
SalaryYear
BasicSalary
Allowances
Deductions
TotalPayable
EmployeeID
1
2
3
1
2
3
SalaryMonth
JANUARY
JANUARY
JANUARY
FEBURARY
FEBURARY
FEBURARY
SalaryYear
2015
2015
2015
2015
2015
2015
BasicSalary
25000
26000
25000
25000
26000
25000
Allowances
5000
5000
4000
5500
5500
4400
Deductions
2000
2500
2000
2000
2500
2000
TotalPayable
28000
28500
27000
28500
29000
27400
Super Key
Candidate Key
Primary Key
Alternate Key
Foreign Key
Cardinality
Degree
SalaryID
SalaryID, EmployeeID
SalaryID, EmployeeID, SalaryMonth
SalaryID, EmployeeID, SalaryMonth, SalaryYear
SalaryID, EmployeeID, SalaryMonth, SalaryYear, BasicSalary
SalaryID, EmployeeID, SalaryMonth, SalaryYear, BasicSalary, Allowances
SalaryID, EmployeeID, SalaryMonth, SalaryYear, BasicSalary, Allowances,
Deductions
SalaryID, EmployeeID, SalaryMonth, SalaryYear, BasicSalary, Allowances,
Deductions, TotalPayable
EmployeeID, SalaryMonth, SalaryYear
SalaryID
EmployeeID, SalaryMonth, SalaryYear
SalaryID
EmployeeID, SalaryMonth, SalaryYear
EmployeeID
6
8
These are the key Relation in any University Database. It can be further enhanced by including the
detailed relations like StudentCourse, StudentClass, FacultyCourse, FacultyClass, Admission, Result etc.