473,671 Members | 2,251 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 1110
"rAinDeEr" <ta**********@g mail.com> wrote in message
news:11******** **************@ j73g2000cwa.goo glegroups.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
4507
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 (e.g. John Smith) Each User would contain a following Group of tables a)Customers
1
3272
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 commission . The commission could be given per EITHER sales amount of : Group of Products OR Group of Brand. e.g : the data example : For one salesman_A : product_1, product_2, product_3 etc.. => sales = $100 - $200 =>
9
2921
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 a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
2
3546
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 *what the user wants*. I've had brief formal education about data flow diagramming, but I'm looking for ... more, now that I'm actually running into problems I think stem from the fact that my users can't explain what they need done, compounded by...
6
1700
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 saved at all. If so, how does one explain these facts: 1) say I do click Yes to save the table design 2) later I open the table manually and, sure enough, key field is shown in descending order 3) I run this in debug window... ?DLookup("",...
4
3930
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 the element outside of the table and then using cut & paste in HTML View to move it to the desired location, or by manually typing the code in using HTML View. The first technique sometimes does not automatically update the list of elements...
5
1764
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 saved for compatibility as ver. 2000. Basic structure of this tool is dependent from my house departments structure. Each department owes their own table, where they can write inputs necessary and dependent for annual budget analysis and...
4
1961
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 equipment to use for a customer's needs. It basically consists of a table with the following setup: Equipment: Option1: Option2: Option3: Option 4: ... -------- ------- ------- -------- --------
5
4094
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 table in design mode and then add the new field and set its properties. Thanks. --
12
7001
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 foreign Key relationship or does this always indicate some sort of underlying design flaw. Something that requires a re evaluation of the problem domain? The reason I ask is because in our application, the user can perform x
0
8476
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7437
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4407
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2812
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 we have to send another system
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.