Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

table design help

 
   Database Help (Home) -> Programming RSS
Next:  List Blocks over Time  
Author Message
rodchar

External


Since: Jan 11, 2008
Posts: 105



(Msg. 1) Posted: Fri May 02, 2008 11:39 am
Post subject: table design help
Archived from groups: microsoft>public>sqlserver>programming (more info?)

hey all,

salary table
-------------
salary date, Salary


employment history table
-----------------------------
job title, employment date


let's say i want to pick a record in the history table and find out what
salary they were making at the time when holding a particular job title.

what's the best way to complete the design of the tables above? (how do i
connect the 2 tables) if possible, please give several possibilities.

thanks,
rodchar

 >> Stay informed about: table design help 
Back to top
Login to vote
Steve

External


Since: Jan 11, 2008
Posts: 36



(Msg. 2) Posted: Fri May 02, 2008 1:20 pm
Post subject: RE: table design help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I can't believe your tables really look like that. It would imply that
everyone gets paid the same salary.



"rodchar" wrote:

> hey all,
>
> salary table
> -------------
> salary date, Salary
>
>
> employment history table
> -----------------------------
> job title, employment date
>
>
> let's say i want to pick a record in the history table and find out what
> salary they were making at the time when holding a particular job title.
>
> what's the best way to complete the design of the tables above? (how do i
> connect the 2 tables) if possible, please give several possibilities.
>
> thanks,
> rodchar

 >> Stay informed about: table design help 
Back to top
Login to vote
steve dassin

External


Since: Jan 14, 2008
Posts: 132



(Msg. 3) Posted: Fri May 02, 2008 3:13 pm
Post subject: Re: table design help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Steve" wrote in message

>I can't believe your tables really look like that. It would imply that
> everyone gets paid the same salary.

You prejudice is showing. I suppose you live in a so called democracy Smile

www.beyondsql.blogspot.com
 >> Stay informed about: table design help 
Back to top
Login to vote
rodchar

External


Since: Jan 11, 2008
Posts: 105



(Msg. 4) Posted: Fri May 02, 2008 3:34 pm
Post subject: RE: table design help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ok, i may have oversimplified by leaving employee id out of each of the
tables (my bad).



"Steve" wrote:

> I can't believe your tables really look like that. It would imply that
> everyone gets paid the same salary.
>
>
>
> "rodchar" wrote:
>
> > hey all,
> >
> > salary table
> > -------------
> > salary date, Salary
> >
> >
> > employment history table
> > -----------------------------
> > job title, employment date
> >
> >
> > let's say i want to pick a record in the history table and find out what
> > salary they were making at the time when holding a particular job title.
> >
> > what's the best way to complete the design of the tables above? (how do i
> > connect the 2 tables) if possible, please give several possibilities.
> >
> > thanks,
> > rodchar
 >> Stay informed about: table design help 
Back to top
Login to vote
"Roy Harvey

External


Since: Jan 12, 2008
Posts: 593



(Msg. 5) Posted: Fri May 02, 2008 4:11 pm
Post subject: Re: table design help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I've never seen a case where a table like the salary table described
would have meaning. I've only seen salaries that applied to
individuals, but there is no employee on that table.

I would expect something more like:

Employees table:
EmployeeKey
EmployeeName
HireDate

JobTitle table:
JobTitleKey
JobTitleDescription

JobTitleHistory table:
EmployeeKey
JobTitleKey
TitleStartDate
TitleEndDate

SalaryHistory table:
EmployeeKey
SalaryStartDate
SalaryEndDate
SalaryAmount

That is very much oversimplified of course, but perhaps it will give
you something to think about.

Roy Harvey
Beacon Falls, CT

On Fri, 2 May 2008 11:39:02 -0700, rodchar
wrote:

>hey all,
>
>salary table
>-------------
>salary date, Salary
>
>
>employment history table
>-----------------------------
>job title, employment date
>
>
>let's say i want to pick a record in the history table and find out what
>salary they were making at the time when holding a particular job title.
>
>what's the best way to complete the design of the tables above? (how do i
>connect the 2 tables) if possible, please give several possibilities.
>
>thanks,
>rodchar
 >> Stay informed about: table design help 
Back to top
Login to vote
Aaron Bertrand [SQL Serve

External


Since: Jan 19, 2008
Posts: 64



(Msg. 6) Posted: Fri May 02, 2008 7:22 pm
Post subject: Re: table design help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> ok, i may have oversimplified by leaving employee id out of each of the
> tables (my bad).

This will always happen when you try to simplify and expect us to be able to
extrapolate. Show us the real problem you're having, real sample data, and
real desired results. Change column names if you need to, but simplifying
things doesn't help anyone. The people who are going to help you solve
problems are not going to be stumped because your schema it too complex.
 >> Stay informed about: table design help 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Suitable Table Design ? - Hello David, Would (contract_num,details_changed_date) key be efficient in Queries or (contract_num,AmendId) key be efficient in Queries - Note that AmendId is a sequence number for each of the amendments. Gopi "David Portas"..

Basic table design - Hi I Hope this is the right place to ask a simple table design question. How would I implement an order consisting of a number of order lines in a database. Here is my best shot. Order table OrderID (PK) Date, Soldby etc. OrderLines tabel OrderID...

need help with table design - opinions please - i have a table called ORDERQUEUE laid out like this create table [ORDERQUEUE] (oq_id int identity primary key, customer_id int not null, grouping_id int null, queue_date datetime not null default getdate().... other columns here) clustered index is..

Table Design Question - I'm trying to figure out the best way to design a couple of tables given the following scenario. Here's how I currently have it configured.. Table 1 called Packages is defined as: Package Id smallint Groups varbinary(256) Table 2 is called....

Table design - really stuck! - I am in the process of figuring out the schema for this database. I have most of the tables already figured out and set up in an Excel file so it is easier for me to see how they will be set up. I don't have code for this yet, but I came across an..
   Database Help (Home) -> Programming All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]