I want to store codes in a database i.e title code, status code, etc. I want to do this without affecting the performance of the database. I want u guys to tell me the most advisable way of doing this. I want to retrieve the actual code descriptions using these codes in the fastest time possible. I'm wondering if i should store them in multiple tables or in one. Ans how do i go about doing that.

Thank you

Recommended Answers

All 7 Replies

It is always faster accessing 1 table instead of multiple tables. Not quite sure what else you want in the table but try something like this would most likely be best

ID Code Code_Description ...Other fileds
1 Status desc
2 Title desc
....

From your post i am not sure what exactly you are looking for . Why you need to store the codes in database . What is the database that you are using ?

From your post i am not sure what exactly you are looking for . Why you need to store the codes in database . What is the database that you are using ?

I need to store codes such as title code, status codes, etc. I need to use this codes to retrieve their respective information. This needs to happen as fast as possible as i'm working on a web-based system. I was thinking of storing them in different tables but i don't know if this is going to affect the performance of the database. I am using Oracle.

Like I told you in my earlier post, 1 table is always faster.

You should also use an index if you want to increase scanning speeds as index scans are faster than table scans.

It is not advisable to store all the code into one table. but if you want store those with some flag setting . Always create index for faster access of data.

I want to store codes in a database i.e title code, status code, etc. I want to do this without affecting the performance of the database. I want u guys to tell me the most advisable way of doing this. I want to retrieve the actual code descriptions using these codes in the fastest time possible. I'm wondering if i should store them in multiple tables or in one. Ans how do i go about doing that.

Thank you

@debasisdas The user is looking to setup a lookup table for his status codes not store all his data in one table.

That's why i suggested to use some flag settings .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.