473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Good relational database design

I'm designing a database because I have to do it for the preperation work
for my A-Level ICT exam.

The database is for a building company. It has to store information on
building projects (tblProject) and employees (tblPersonnel) then link them
together.

The entities and attributes I have designed for my database are as follows:

tblProjectNumber (ProjectNumber)

tblProject (ProjectID, ProjectNumber, Stage, Foreman, TeamMember1,
TeamMember2, TeamMember3, TeamMember4, StageStartDate, StageEndDate)

tblStage (Stage)

tblPersonnel (StaffNumber, Name, Address, TelNumber, JobFunction ExpLevel,
StartDate, LeaveDate, GrossSalary, TaxCode, SickPay, HolidayEntitlement,
Qualifications, CourseAttended)

The database only needs to be in first normal form. So my question is, is
my design 'ok' as a relational database design? Am i allowed to have only
one attribute in an entity?

Thanks

Cass

Nov 12 '05 #1
3 2002
Cass,

The first three normal forms all sort of blur in my mind, but there are some
repeating fields in here, which I would eliminate. Since you've said this is
homework, I won't suggest a fix, but I will offer some good reading:
Fundamentals of Relational Database Design. It's a short article by Paul
Litwin that I've posted (with permission) in the Developers' section of my
website.

Jeremy

--
Jeremy Wallace
AlphaBet City Dataworks
http://www.ABCDataworks.com
"cassandra.flowers" <ca***************@btopenworld.com> wrote in message
news:c0**********@sparta.btinternet.com...
I'm designing a database because I have to do it for the preperation work
for my A-Level ICT exam.

The database is for a building company. It has to store information on
building projects (tblProject) and employees (tblPersonnel) then link them
together.

The entities and attributes I have designed for my database are as follows:
tblProjectNumber (ProjectNumber)

tblProject (ProjectID, ProjectNumber, Stage, Foreman, TeamMember1,
TeamMember2, TeamMember3, TeamMember4, StageStartDate, StageEndDate)

tblStage (Stage)

tblPersonnel (StaffNumber, Name, Address, TelNumber, JobFunction ExpLevel,
StartDate, LeaveDate, GrossSalary, TaxCode, SickPay, HolidayEntitlement,
Qualifications, CourseAttended)

The database only needs to be in first normal form. So my question is, is
my design 'ok' as a relational database design? Am i allowed to have only
one attribute in an entity?

Thanks

Cass

Nov 12 '05 #2
In message <c0**********@sparta.btinternet.com>, cassandra.flowers
<ca***************@btopenworld.com> writes
The database is for a building company. It has to store information on
building projects (tblProject) and employees (tblPersonnel) then link them
together.

The entities and attributes I have designed for my database are as follows:

tblProjectNumber (ProjectNumber)

tblProject (ProjectID, ProjectNumber, Stage, Foreman, TeamMember1,
TeamMember2, TeamMember3, TeamMember4, StageStartDate, StageEndDate)
This is possibly valid but unusual. Hint: do you know for sure and
certain that a project will never have more than four team members?

tblStage (Stage)

tblPersonnel (StaffNumber, Name, Address, TelNumber, JobFunction ExpLevel,
StartDate, LeaveDate, GrossSalary, TaxCode, SickPay, HolidayEntitlement,
Qualifications, CourseAttended)

The database only needs to be in first normal form. So my question is, is
my design 'ok' as a relational database design? Am i allowed to have only
one attribute in an entity?


It's allowed but unusual. It appears that the ProjectNumber and the
ProjectID have exactly the same function. If so, choose one of them and
put it into tblProject. Why do you think you need both?

It would be more usual to create an entity like

Stage(StageID, StageDescription)

Where the StageID is a brief code and the StageDescription is a longer
text description. There is a 1:1 relationship between ID and description
and descriptions are always unique. In theory you don't need the ID
field at all, but there are practical problems in using long, free-text
fields as keys.

I suggest that you redraft the design and repost it, explain what
changes you have made and why. For a lot of people explaining something
to someone else is the best way of learning it.


--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 12 '05 #3
"cassandra.flowers" <ca***************@btopenworld.com> wrote in message
news:c0**********@sparta.btinternet.com...
I'm designing a database because I have to do it for the preperation work
for my A-Level ICT exam.

The database is for a building company. It has to store information on
building projects (tblProject) and employees (tblPersonnel) then link them
together.

The entities and attributes I have designed for my database are as follows:
tblProjectNumber (ProjectNumber)

tblProject (ProjectID, ProjectNumber, Stage, Foreman, TeamMember1,
TeamMember2, TeamMember3, TeamMember4, StageStartDate, StageEndDate)
tblStage (Stage)

tblPersonnel (StaffNumber, Name, Address, TelNumber, JobFunction ExpLevel,
StartDate, LeaveDate, GrossSalary, TaxCode, SickPay, HolidayEntitlement,
Qualifications, CourseAttended)

The database only needs to be in first normal form. So my question is, is
my design 'ok' as a relational database design? Am i allowed to have only
one attribute in an entity?

Thanks

Cass

Cass,

I believe the structure you have described is too cumbersome. I worked with
a similar structure when I first began working with dBase ten years ago and
it was . . . well, . . . impossible. The developer had originally set up
fifteen separate "account" fields as part of a check-writing database.
Unfortunately there were rare instances where a check had to be coded to
sixteen accounts. Too bad, so sad! Another problem existed if I wanted to
report on all entries to a particular account. Since the account number
could appear in any of the fifteen fields, each field had to be queried for
the account number.

I believe a more flexible solution would be to remove the TeamMember fields
from tblProject and set up a table that relates tblProjects with
tblPersonnel. .For example

tblProjectAssignments(ProjectID, StageID, EmployeeID, EmpProjStartDate,
EmpProjEndDate, EmpProjTitle)

allows for an almost unlimited number of employees to be assigned to a
project, it allows each employee to simultaneously work on a number of
different projects and/or project stages, and it allows an employee to act
in different capacities during the lifetime of the project. And the beauty
of the relational database is that you simply have to link the related
tables (tblProject, tblePersonnel, and tblProjectAssignments) and query on
the EmployeeID field to determne the projects that an employee worked on for
any given period of time and the capacities in which he served.

Is it okay to have only one attribute to an entity? I don't really know. I
have used a table with one field when I wanted to limit the values that
could be entered into the field of another table. It just seemed easier
than maintaining program code.

Steve

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Patrick K. O'Brien | last post by:
I'm looking for a good schema to use as an example for an object database system. Something like a books/authors/publishers or teachers/students/courses kind of thing. There are plenty of...
34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
36
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am...
49
by: Mike MacSween | last post by:
I frequently hear that there isn't a commercially available dbms that fully implements the relational model. Why not? And which product comes closest. Mike MacSween
1
by: John | last post by:
Using these tables as an example, where the first key is the Primary Key and subsequent keys are Foreign Keys: tbl_A, PrimaryKey_A tbl_B, PrimaryKey_B, PrimaryKey_A tbl_C, PrimaryKey_C,...
17
by: deko | last post by:
Is there a Pattern or best Practice for getting relational data out of a database and into an object? The object in question has public properties that look like this: _stringName _ArrayList...
5
by: sh | last post by:
I am working on a database project, and I'm trying to think "objectively". Are there any tools that will map my "objects" to relational tables? I'd prefer a freebie, or something faily low-cost to...
18
by: Jens | last post by:
I'm starting a project in data mining, and I'm considering Python and Java as possible platforms. I'm conserned by performance. Most benchmarks report that Java is about 10-15 times faster than...
13
by: sulyokpeti | last post by:
I have made a simple python module to handle SQL databases: https://fedorahosted.org/pySQLFace/wiki Its goal to separate relational database stuff (SQL) from algorythmic code (python). A SQLFace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.