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

Database design


We need to create a lookup structure that can contain a flexible amount of
attributes.

We have discussed different design solutions for lookup-functionality, and
come up with this suggestion:

The "lookup" structure will be defined by three tables. The "Element" table,
the "Attribute" table and the "Value" table.

I will specify with an example:
Lets say we want to define a lookup-element called vendor. First we insert a
row in the "Element" table. In the "Attribute" table we create one row for
every "information-piece" we want to be able to define for a vendor, e.g.
Name, number, country.
The "Value" table will contain the actual attribute-values, one row for each
value(3 rows for each vendor)

This creates a very flexible structure that can store many different types
of lookup-elements with different demands when it comes to number of
attributes("columns"). The structure supports an infinite number of
attributes.
On the downside this will potentially create a huge number of rows in the
"Value" table. Also the design concept is more abstract and where-statements
in query's might be more complex.

The alternative is the more usual structure with two tables. The "Element"
and the "Value" tables.
The "Value" table will then have one column for each attribute, and we would
specify as many columns as
we think we will ever need.
Any comments, thoughts and suggestions would be appreciated.
Jul 19 '05 #1
2 3690
"Anders" <an*************@news.com> wrote in message news:<UJ******************@news2.e.nsc.no>...
We need to create a lookup structure that can contain a flexible amount of
attributes.

We have discussed different design solutions for lookup-functionality, and
come up with this suggestion:

The "lookup" structure will be defined by three tables. The "Element" table,
the "Attribute" table and the "Value" table.

I will specify with an example:
Lets say we want to define a lookup-element called vendor. First we insert a
row in the "Element" table. In the "Attribute" table we create one row for
every "information-piece" we want to be able to define for a vendor, e.g.
Name, number, country.
The "Value" table will contain the actual attribute-values, one row for each
value(3 rows for each vendor)

This creates a very flexible structure that can store many different types
of lookup-elements with different demands when it comes to number of
attributes("columns"). The structure supports an infinite number of
attributes.
On the downside this will potentially create a huge number of rows in the
"Value" table. Also the design concept is more abstract and where-statements
in query's might be more complex.

The alternative is the more usual structure with two tables. The "Element"
and the "Value" tables.
The "Value" table will then have one column for each attribute, and we would
specify as many columns as
we think we will ever need.
Any comments, thoughts and suggestions would be appreciated.


you seem to want to create a relational DB on top of ORACLE.

WHY would you want to do this when ORACLE already does it so much better?

So IMHO, it is a bad idea.

Hey, you asked.8^)

have a good day,
ed
Jul 19 '05 #2
I have seen situations where this kind of design was used to capture generic
data modelling requirements, such as how many and what type of items would
appear on an exam question, or how many steps were required for a
manufacturing process, and in what sequence.

However, by *entirely* genericizing your schema, you will lose all sorts of
Oracle functionality, not the least of which is the ability to optimize
semantically different queries in different ways. Furthermore, any query
that cannot efficiently use indexes will scan *all* your data to get
whatever results are required.

So while this may be an interesting idea to you in principle, it may be
painful to live with unless your database is very, very small.

--
Cheers,
Chris

___________________________________

Chris Leonard, The Database Guy
http://www.databaseguy.com

Brainbench MVP for Oracle Admin
http://www.brainbench.com

MCSE, MCDBA, OCP, CIW
___________________________________

"Anders" <an*************@news.com> wrote in message
news:UJ******************@news2.e.nsc.no...

We need to create a lookup structure that can contain a flexible amount of
attributes.

We have discussed different design solutions for lookup-functionality, and
come up with this suggestion:

The "lookup" structure will be defined by three tables. The "Element" table, the "Attribute" table and the "Value" table.

I will specify with an example:
Lets say we want to define a lookup-element called vendor. First we insert a row in the "Element" table. In the "Attribute" table we create one row for
every "information-piece" we want to be able to define for a vendor, e.g.
Name, number, country.
The "Value" table will contain the actual attribute-values, one row for each value(3 rows for each vendor)

This creates a very flexible structure that can store many different types
of lookup-elements with different demands when it comes to number of
attributes("columns"). The structure supports an infinite number of
attributes.
On the downside this will potentially create a huge number of rows in the
"Value" table. Also the design concept is more abstract and where-statements in query's might be more complex.

The alternative is the more usual structure with two tables. The "Element"
and the "Value" tables.
The "Value" table will then have one column for each attribute, and we would specify as many columns as
we think we will ever need.
Any comments, thoughts and suggestions would be appreciated.

Jul 19 '05 #3

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

Similar topics

3
by: Rushikesh | last post by:
I am designing a WEB BASED Accounting Software with ASP and SQL Server. For this I need some help for the Database design. My design is as follows. I)User table: User_id, UserName..... Users...
5
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of...
1
by: Lane Beneke | last post by:
All, New to the list and a relative newbie to PostgreSQL. Please forgive stupid questions. Designing an application server for a work order processing (et al) database. I have a good handle...
5
by: trynittee | last post by:
Hello, It's been a while since I've posted. I am an intermediate user of Access. I can read simple VB code, have done complex queries, comfortable with event procedures, designing forms and...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
3
by: vicky | last post by:
Hi All, Can u please suggest me some books for relational database design or database modelling(Knowledgeable yet simple) i.e. from which we could learn database relationships(one to many,many to...
0
by: Laurynn | last post by:
# (ebook - pdf) - programming - mysql - php database applicati # (Ebook - Pdf)Learnkey How To Design A Database - Sql And Crystal Report # (ebook-pdf) E F Codd - Extending the Database Relational...
1
by: abhijitbkulkarni | last post by:
Hello, I am designing a .NET database application that uses 3 tier architecture. Starting initially, this application will be desktop application but I will convert it into a website later but...
0
by: sam | last post by:
Hi, Hope you are doing well !!!! One of our clients is looking to augment their team with “Database Architect – DB2" please find below the details and respond with
2
by: programmerx101 | last post by:
Ok, I'm looking for expert advice on this one. I have a database which keeps going into read_only mode. Sometimes it goes into read_only / single user mode. Once it was taken offline completely....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
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
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...
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.