Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 suggestions for table structure

Author  Topic 

mallethead
Starting Member

2 Posts

Posted - 2011-10-03 : 12:56:22
Hello,

I have a requirement to construct an application that is very different from others I've done. I thought I'd put this out to see if someone can give me a suggestion on how to structure the tables.

This is an HTML report that will be viewed in the web-browser or printed by users for reference. I am also doing the form to enter the data.

Basically,.......

I have
1. jobnumber
2. jobnumber has an format type
3. that format type has from 5 to 15 required components

So, when the user enters a jobnumber they will select a "format type" and only the required components necessary for that format type should be displayed.

The required components are a limited set such as: text, picture, logo, disclaimer, etc. and different formats will have various combinations of those components.

I think I need:
1. a table of jobs
2. a table of formats (already exists)
3. a table of required components
4. a table of the components for a particular format type

This 4th table would be like:
job: 1432
format: movie
required components for movie: 1,2,4 (for text, picture disclaimer)

Etc.

In the end I have to show each job listed and then only the required components for that particular type of job and their particular data such as received, comlete, OK'd, etc.

Thanks in advance to anyone who has an idea. Possibly it's not easy to represent the structure in words so I'll get a data modelling tool going.

Thanks, Mallethead

Rich_z7
Starting Member

5 Posts

Posted - 2011-10-11 : 07:35:21
Hi,

I wouldn't be thinking about one table for this, but quite a few (15....)

Your main table would contain the Job details such as teh Job name, description, format type, owner ??, creation date etc etc etc, and finally an incrementing NUMC field which is populated when the record is inserted in the database.

The NUMC field would then be used as a Primary key linking the text, picture, logo, disclaimer tables to the main job. Entries would only be created in these subsidiary tables if the format type requires them.



Regards

Rich
Go to Top of Page

mallethead
Starting Member

2 Posts

Posted - 2011-10-11 : 09:08:27
Rich_z7,

Thanks for the input. It's been a bit since I originally posted this and came up with a plan. I ended up with 4 tables as I didn't want to split all the individual categories up into their own tables.

I'm using a cross-reference table to link one activity to many components and then storing the data for each projects components in a separate table using foreign keys to identify project number and component name.

Seems to be working well.

Thanks, Jerry
Go to Top of Page
   

- Advertisement -