473,395 Members | 1,675 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.

Sensible table structure?

I'm working on an access application, part of which involves assigning personnel to different projects for different amounts of time. So far, so good.

The problem I'm having is that the projects can be either projected (tendered for) or firm. Projects that have been tendered for have different attributes to those that are firm.

The way I've tried to do this is having a Tender table, a Projects table, a Timespan table, and a Persons table.

The Timespan table contains a lookup to Persons.
There are two join tables, one between Timespan and Tender, and one between Timespan and Project.

One problem is that there's nothing to stop a Timespan being joined to both a Tender and a Project, which is not really ideal.

My main problem, though, is that it just doesn't seem logically sensible to me to order it like this. It's making it irritating to put sensible queries together (I'm not particularly experienced or skilled with Access).

If anybody has any suggestions as to how I can arrange things more sensibly, I would be extremely grateful.

Many thanks,
Jan 21 '08 #1
10 1773
jaxjagfan
254 Expert 100+
I'm working on an access application, part of which involves assigning personnel to different projects for different amounts of time. So far, so good.

The problem I'm having is that the projects can be either projected (tendered for) or firm. Projects that have been tendered for have different attributes to those that are firm.

The way I've tried to do this is having a Tender table, a Projects table, a Timespan table, and a Persons table.

The Timespan table contains a lookup to Persons.
There are two join tables, one between Timespan and Tender, and one between Timespan and Project.

One problem is that there's nothing to stop a Timespan being joined to both a Tender and a Project, which is not really ideal.

My main problem, though, is that it just doesn't seem logically sensible to me to order it like this. It's making it irritating to put sensible queries together (I'm not particularly experienced or skilled with Access).

If anybody has any suggestions as to how I can arrange things more sensibly, I would be extremely grateful.

Many thanks,
I assume by "tendered" you mean they are slated for future - just not an active project OR it could be yes/no (Tender or Not).

Does your TimeSpan table contain timespans for your organization or timespans for the tender/projects? Can't a project and a tender occur at the same time?

If you think about it a bit - a tender may not have different attributes from projects but only different values assigned to an attribute.

Here are a few tables I have in a project database (it actually has about 40 tables). Each project can be a different size and type. Each can have it's own Milestones and Personnel assigned. The company I did this for has set release dates for projects depending on project size and complexity. Personnel can have different roles on different projects (could be developer on one and project lead on another)

tblProjects ((pk)ProjID, (fk)ProjTypeID, (fk)StatusID) - projects
tblPersonnel ((pk)PersID) - org personnel
tblProjPers ((fk)ProjID, (fk)PersID, (fk)RoleID) - pers assigned to projects
tblProjTypes ((pk)ProjTypeID) - organization project types
tblMilestones ((pk)MilestoneID)
tblProjMilestones ((fk)ProjID, (fk)MilestoneID)
tblProjStatus ((pk)StatusID)
tblRoles ((pk)RoleID)

I don't really expect an answer unless you have more questions. Just trying to spark some more thought... :D
Jan 21 '08 #2
missinglinq
3,532 Expert 2GB
I would think that much of your data would be duplicated in your Tender/Projects tables; a Tender, after all, will hopefully become a Project, correct? What do you do when it becomes an approved Project? Why not simply have a single table for both, and have a Checkbox, named something like Approved, that is checked if the Tender is accepted? You can easily have forms based on queries that display Tenders, Projects, or both. We both displayed, you can see active Projects with proposed Projects, side by side.

Welcome to TheScripts!

Linq ;0)>
Jan 21 '08 #3
NeoPa
32,556 Expert Mod 16PB
If you haven't already, I'd take a short while to go through Normalisation and Table structures. I think it may help you to get a better grasp of how and why things are better ordered in the ways suggested. I certainly found it helpful.
Jan 22 '08 #4
Many thanks to all three of you.

Does your TimeSpan table contain timespans for your organization or timespans for the tender/projects? Can't a project and a tender occur at the same time?
My timespan table contains timespans for which a person to be assigned to either a project or (provisionally) to a tender - the main function of the application is to keep track of a large number of personnel. Hence, a person can be assigned to many projects (both in the present and the future) and many persons can be assigned to a project. Many different projects and tenders occur simultaneously, which the current structure I have allows for.

If you think about it a bit - a tender may not have different attributes from projects but only different values assigned to an attribute.
and
I would think that much of your data would be duplicated in your Tender/Projects tables; a Tender, after all, will hopefully become a Project, correct? What do you do when it becomes an approved Project? Why not simply have a single table for both, and have a Checkbox, named something like Approved, that is checked if the Tender is accepted?
True to some extent - but there are some different attributes: The Tenders and the Jobs have a different numbering system: Tender number vs Job number (although the tender number is preserved in the Jobs table as well). I can now see I've bodged that a bit.

Problem is, Projects have attributes that a Tender won't have, such as a mobilisation date (cannot be known at tender stage), while a tender has "Tender Deadline" and "Tender to leave office" dates. The two tables will need to have different types of attached files as well. I'm not sure what to do about this.

I may also want to be able to declare a person unavailable for a timespan with a reason (on holiday; working for somebody else, etc) - which complicates things further. I've provisionally created a join table between Timespan and a new table 'Status', but this of course is the same principle as what I have already been doing that has been causing me problems.

If you haven't already, I'd take a short while to go through Normalisation and Table structures. I think it may help you to get a better grasp of how and why things are better ordered in the ways suggested. I certainly found it helpful.
It's very useful - thanks. There's a point made in it as well which illustrates the problem I have:
A relational table is in third normal form (3NF) if it is already in 2NF and every non-key column is non transitively dependent upon its primary key.
In short, I'm finding it hard to determine which of these dependencies are transitive.


Many thanks for all your responses, it's very kind of you.
Jan 24 '08 #5
NeoPa
32,556 Expert Mod 16PB
I think we're all pleased if we can help :)
I would consider a couple of points.
  1. Unless the fields in the Project state have to have mutually incompatible statuses from those when in the Tender state, you can still have a table which includes all the possibly required fields. They would simply be unused for the particular state they're not required for. Incompatible might be if it's only required for the Project state - but in that state it's mandatory.
  2. Staus table. This could also be treated as a special project. Illness could be a project, as well as holiday and other reasons to be unavailable. This may not fit in your scenario depending on some of the details, but it's a concept to consider.
Jan 24 '08 #6
Ok then, thanks.

Re: treating the status as a type of project, is it ok to have so many of the table fields left blank (as they would end up in this situation, unless I misunderstand you) ?
Jan 25 '08 #7
NeoPa
32,556 Expert Mod 16PB
It's a balance.
Blank (empty) fields generally take up very little space. As long as your code isn't likely to fall over expecting data in them, it should be ok.
Ultimately it's what you're happy with that matters most in this sort of case.
If you think of the table storing data of the things that time is spent on, rather than projects exactly, it could work for you.
Jan 25 '08 #8
Great, I'll give this way a go. Should I have a field 'projecttype' with three possible values ('tender' 'job' and 'special') to distinguish between them in that case, or should I rely on checking which fields are filled and which fields are not to determine this?
Jan 28 '08 #9
NeoPa
32,556 Expert Mod 16PB
Definitely have a flag type field indicating the ProjectType. That way any queries built to use it interface directly with the data and the WHERE clause doesn't need to refer to calculations (generally to be avoided if possible as it can invalidate optimisations). In fact I'd go as far as to say this field [ProjectType] should probably be included in one of your indexes at least, if not more.
Jan 28 '08 #10
Many thanks for all your help.

Now I only need to solve the problem of having my specification changed every couple of days :)
Feb 5 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: QWERTY | last post by:
--------------Boundary-00=_O5I3QL80000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_O5I3LVC0000000000000" --------------Boundary-00=_O5I3LVC0000000000000...
0
by: Randall Sell | last post by:
Hello all, I am migrating a Paradox application to SQL Server. My problem is that the existing Paradox table structure is limited. Correcting it will mean a re-write of the application (Delphi...
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...
3
by: Ben | last post by:
Hi everyone, Now I am using Visual Basic.net to write a program but having some headaches. The situation is as follows: I am using ODBC connection to connect one database( non-SQL server) ,...
4
by: Laphan | last post by:
Hi All Wonder if you could help, I have a bog standard table called STOCKPRICES that has served me well for a while, but now I need to change the structure of it and because a number of users...
4
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
5
by: brett valjalo | last post by:
Hey Gang! SORRY ABOUT THE LENGTH! Nice to see some of the same faces around this place from way back when ... Whatta buncha CDMA addicts some o' y'all are ;) Don't get me wrong, I...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
2
by: Dave Ekhaus | last post by:
hi i'm new to javascript. i'm hoping to get some help and find out if what i want to do is possible and - assuming it is, get some tips on how to accomplish the task. ok - assume i have a...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.