473,512 Members | 15,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Design of a table

Hi,

I want to design a Table with the following condition:

The table is used to store Department Information.
There are 3 types of Department- Dept A, Dept B and Dept C

The table structure is:

Dept Number
Dept Type
Dept Name

The problem is Dept A and Dept B has its own Dept Number but for Dept C
we have to generate a sequence.

So how do I store the dept number from Dept C as a sequence still
allowing Dept number from Dept A and Dept B which can vary.

I can always add another field but is there a way out...Just wanted to
know...

Thanks in Advance,
rAinDeEr

May 12 '06 #1
3 1104
"rAinDeEr" <ta**********@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
Hi,

I want to design a Table with the following condition:

The table is used to store Department Information.
There are 3 types of Department- Dept A, Dept B and Dept C

The table structure is:

Dept Number
Dept Type
Dept Name

The problem is Dept A and Dept B has its own Dept Number but for Dept C
we have to generate a sequence.

So how do I store the dept number from Dept C as a sequence still
allowing Dept number from Dept A and Dept B which can vary.

I can always add another field but is there a way out...Just wanted to
know...

Thanks in Advance,
rAinDeEr


You can use an identity column that is generated by default. If you don't
supply a value, then DB2 will generate one for you. However, you will need
to reserve a range of numbers to be automatically generated that will not
conflict with the ones you supply.
May 12 '06 #2
Thanks Mark for your prompt reply
rAinDeEr

May 12 '06 #3
>So how do I store the dept number from Dept C as a sequence still
allowing Dept number from Dept A and Dept B which can vary.


Besides Mark's solution, you can also use two separate TABLEs, and pull
them together in a view.

B.

May 12 '06 #4

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

Similar topics

3
4484
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...
1
3267
by: Krist | last post by:
Hi All, There is some additional info I forget on this same topic I just posted. I have a database design question, pls give me some help.. I want to define tables for salesman's sales target...
9
2912
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
2
3537
by: Pete | last post by:
Before I get started with the question, does anyone have a (single) good book recommendation for database design? Not an Access-specific book, but something geared toward helping me figure out...
6
1691
by: MLH | last post by:
If I open an A97 table, resort its key-field to descending order and attempt to close the table, A97 asks me if I wish to save the table DESIGN? Now really, I don't think the table design is being...
4
3919
by: Nathan Sokalski | last post by:
When editing an ASP Table, Visual Studio does not allow me to edit it in Design View. This makes it harder to add elements, because I must add every element either by using Design View to create...
5
1759
by: A_M_IS | last post by:
Dear valuable experts, I truly hope than You can suggest for me Your ideas how to resolve design. I developing relative small Access VB tool, for single user use only. Access version 2003, but db...
4
1947
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...
5
4083
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
12
6967
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...
0
7153
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
7432
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
7517
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
5676
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,...
1
5077
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...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.