473,404 Members | 2,178 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,404 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 3691
"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
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?
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.