473,386 Members | 1,741 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,386 software developers and data experts.

Table design question.

4
Longtime lurker... first post. These forums have already helped a lot, so thanks.
I have a design issue that is probably easy to figure out for someone with a little more DB experience than myself. Here is what I'm trying to do:
I have an app that will display several grids which consist of some columns that are specific to a given grid and some that are globally identical among the all grids. The globally identical columns will be displayed for all grids but the relative columns may or may not be a part of a given table...if they do show up in more than one grid, their values will be different. A given row may or may not show up in a given grid as well. You can think of this in terms of a jagged datacube. Here is a simplified version of the design (tableName followed by tableColumns)...

________

Columns
ColumnName | ColumnID(PK)

Rows
RowName | RowID(PK)

Grids
GridName | GridID(PK)

Cells
CellContents | ColumnID(FK) | RowID(FK) | TableID(FK)
_______

I plan to handle the global columns by assigning a GridName of All w/ a GridID of 0. Application logic will treat cells with this GridID as belonging to all grids. This achieves 3NF, but here's the problem- and although the app logic won't allow this to happen it would be possible to duplicate a column in a grid, ie have two columns with the same ColumnName but one contains global data and the other contains data relative to the given grid. This seems like a DB design flaw to me. Any suggestions on how to tidy it up?
Mar 7 '08 #1
4 1067
jm1
4
Nothing? Surely this is an easy one... for someone.
Mar 10 '08 #2
ck9663
2,878 Expert 2GB
Try putting some sample data on those structures and paste it here. Then what you want as your output. Let's go from there...

-- CK
Mar 10 '08 #3
jm1
4
I think I've figured it out. The 'Cells' table should only be a junction table. That means CellContents gets broken out into its own table w/ an Identity value as a PK. The identity value gets inserted in place of CellContents and the idea of using 0 as an "All Grids" identifier goes out the window. Rows that were using 0 as a Grid ID get expanded into individual rows- (1 through NumberOfGrids) and all have the same CellID pointing to the appropriate row in the new table.
If that sounds garbled, its because it is. Back to the second sentence in this post. It's just a junction table. I was thinking too hard in the context of the immediate application. The new approach is more flexible for future applications.

The new design looks like this:

________

Columns
ColumnName | ColumnID(PK)

Rows
RowName | RowID(PK)

Grids
GridName | GridID(PK)

CellJunction
CellID(FK) | ColumnID(FK) | RowID(FK) | TableID(FK)

Cells
CellID(PK) | CellContents
_______
Mar 10 '08 #4
jm1
4
[quote=jm1]I think I've figured it out. The 'Cells' table should only be a junction table. That means CellContents gets broken out into its own table w/ an Identity value as a PK. The identity value gets inserted in place of CellContents and the idea of using 0 as an "All Grids" identifier goes out the window. Rows that were using 0 as a Grid ID get expanded into individual rows- (1 through NumberOfGrids) and all have the same CellID pointing to the appropriate row in the new table.
If that sounds garbled, it probably is. Back to the second sentence in this post- It's just a glorified junction table. I was thinking too hard in the context of the immediate application. The new approach is more flexible for future applications of the same tables.

The new design looks like this:

________

Columns
ColumnName | ColumnID(PK)

Rows
RowName | RowID(PK)

Grids
GridName | GridID(PK)

CellJunction
CellID(FK) | ColumnID(FK) | RowID(FK) | TableID(FK)

Cells
CellID(PK) | CellContents
_______
Mar 11 '08 #5

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

Similar topics

7
by: mr_burns | last post by:
hi, is the table percent value for height used for displaying in browsers. i have a table i want to run to the bottom of the screen so it seemed best to set the height value to 100%. when i...
0
by: 2trax | last post by:
Hi all, I am trying to mimic the unix security model (users and groups) in a web app. I have thought of two ways of implementing this, but am unsure which would be better. The first design...
15
by: kimi | last post by:
I have just started working on a project that is partially complete. It is an application that is using access to store test results. The test results are being stored in two Access 2000 databases....
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
7
by: david | last post by:
I have asked this question before. But it does not work for me. Given radion buttons in the web form design page. What I did is described as follows. A panel control is dragged into the design...
1
by: Mark | last post by:
Hi there gurus, can you please add your 2 cents on this design? We're having trouble relating these tables in a diagram because of the keys. Is it necesary to have the references setup? I would...
4
by: yanjie.ma | last post by:
Hi, I've got a two part question on table and form design (sorry for the length but it takes a bit to explain). Our sales department uses a look-up table to help the them select the best...
54
by: csolomon | last post by:
Hello: I was wondering if I could get some input on how to address a design issue, involving my composite table. I have one portion of my project complete. The following forms and reports I...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.