系统设计与数据库系统 作业三 Normalisation

简介: 系统设计与数据库系统 作业三 Normalisation

Question 1:A college keeps details about a student and the various modules the student studied. These details comprise


regno - registration number (Unique)

name - student name

addr - student address

Tno – Teacher ID

Tname - Teacher name

DC - diploma code

DN - diploma name

MC - module code

MN - module name

Grade - module exam Grade

DC -> DN

Tno -> Tname

Regno, MC -> Grade

name -> addr

mc -> mn

Reduce the relation DETAILS to BCNF

Solution:

DD(DC,DN) DC->DN

TT(Tno,Tname) Tno->Tname

RMG(regno,Mc,Grade) Regno,Mc->Grade

NA(name,addr) name->addr

MM(MC,MM) MC->MM


Question 2: Classify the following relations as UNNORMALISED, 1NF, 2NF or 3NF. If the


relation is not in 3NF, normalize the relation to 3NF.


EMPLOYEE(empno,empname,jobcode)

empno -> empname

empno -> jobcode

Solution:

3NF

Emp(empname, empno)

Job(jobcode, empno)


EMPLOYEE(empno,empname,(jobcode,years))

empno -> empname

empno,jobcode -> years

Solution:

UNNORMALISED:


EMPLOYEE(empno,empname,jobcode,jobdesc)

empno -> empname,jobcode

jobcode -> jobdesc

Solution:

2NF

Emp(empname, empno)

Job_info(jobcode, jobdesc)

Job(jobcode, empno)


EMPLOYEE(empno,empname,project,hoursworked)

empno -> empname

empno,project -> hoursworked

Solution:

1NF

Emp(empname, empno)

Info(hoursworked, project, empno)


Question 3: Identify any repeating groups and functional dependences in the PATIENT


relation. Show all the intermediate steps to derive the third normal form

for PATIENT.

PATIENT(patno,patname,gpno,gpname,appdate,consultant,conaddr,sample)


patno: Patient number

patname: Patient Name

gpno: General Practitioner Number

gpname: General Practitioner Name

appdate: Appointment Date

conaddr: Consultant Address


c81af99a2d2f4e478c7464035def93ea.png

Solution:

1NF:

Patient (patno, patname, gpno, gpname)

Appt (patno, appdate, consultant, conaddr, sample)

2NF:

Patient (patno, patname, gpno, gpname)

Appt (patno, appdate, consultant, sample)

Consultant (consultant, conaddr)

3NF:

Patient (patno, patname, gpno)

GP (gpno, gpname)

App (patno, appdate, consultant, sample)

Consultant (consultant, conaddr)


Question 4: A software consulting firm wishes to keep the following data for an employee and costing database:


employee number

employee name

employee address

salary

current job code

job history (job promotion code + year)

office location

telephone number

project number

project name

task number

task name

project budget

task expenditure to date

department number

department name

There are none, one or more job promotion code/year entries per employee.

The office location uniquely depends on the telephone number, and there

may be more than one employee using the same telephone and more than one

telephone in the one office. Tasks are numbered uniquely only within each

project. An employee may be concurrently assigned to more than one project

and task, but belongs to one department. Reduce this data to third normal

form.


Solution:

1NF:

Employee(employee number, employee name, employee address, salary, current job code, job promotion code, year, office location, telephone number, project number, project name, task number, task name, project budget, task expenditure to date, department number, department name)

2NF:

Department(department number, department name)

Project(project number, project name, project budget)

Office(telephone number, office location)

Task(task number, task name, task expenditure to date, project number)

Employee(employee number, employee name, employee address, salary, current job code, job promotion code, year, telephone number, department number)

3NF:

Department(department number, department name)

Office(telephone number, office location)

Employee(employee number, employee name, employee address, salary, current job code, telephone number, department number)

Job_History(employee number, job promotion code, year)

Project(project number, project name, project budget)

Task(task number, task name, task expenditure to date, project number)

Employee_Task(employee number, task number)

相关文章
|
6月前
|
JavaScript Java 测试技术
大学生体质测试|基于Springboot+vue的大学生体质测试管理系统设计与实现(源码+数据库+文档)
大学生体质测试|基于Springboot+vue的大学生体质测试管理系统设计与实现(源码+数据库+文档)
94 0
|
3月前
|
SQL 关系型数据库 数据库
【python】python社交交友平台系统设计与实现(源码+数据库)【独一无二】
【python】python社交交友平台系统设计与实现(源码+数据库)【独一无二】
119 10
|
5月前
|
关系型数据库 MySQL 数据库
MySQL数据库作业设计之豆瓣音乐
MySQL数据库作业设计之豆瓣音乐
32 0
|
5月前
|
关系型数据库 MySQL 项目管理
数据库大作业——基于qt开发的图书管理系统(四)项目目录的整理与绘制登录页面
数据库大作业——基于qt开发的图书管理系统(四)项目目录的整理与绘制登录页面
|
5月前
|
SQL 关系型数据库 MySQL
数据库大作业——基于qt开发的图书管理系统(三)Qt连接Mysql数据库
数据库大作业——基于qt开发的图书管理系统(三)Qt连接Mysql数据库
136 0
|
5月前
|
SQL 数据可视化 关系型数据库
数据库大作业——基于qt开发的图书管理系统(二) 相关表结构的设计
数据库大作业——基于qt开发的图书管理系统(二) 相关表结构的设计
|
5月前
|
安全 BI 数据库
数据库大作业——基于qt开发的图书管理系统 (一)环境的配置与项目需求的分析
数据库大作业——基于qt开发的图书管理系统 (一)环境的配置与项目需求的分析
|
6月前
|
JavaScript Java 关系型数据库
大学生就业招聘|基于Springboot和vue的大学生就业招聘系统设计与实现(源码+数据库+文档)
大学生就业招聘|基于Springboot和vue的大学生就业招聘系统设计与实现(源码+数据库+文档)
76 1
|
6月前
|
JavaScript 小程序 Java
医药垃圾分类管理系统|基于SSM医药垃圾分类管理系统的系统设计与实现(源码+数据库+文档)
医药垃圾分类管理系统|基于SSM医药垃圾分类管理系统的系统设计与实现(源码+数据库+文档)
61 0
|
6月前
|
小程序 JavaScript Java
马拉松|基于SSM的马拉松报名系统微信小程序的系统设计与实现(源码+数据库+文档)
马拉松|基于SSM的马拉松报名系统微信小程序的系统设计与实现(源码+数据库+文档)
56 0