| | |
Urgent Help!! Database Tables
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2009
Posts: 1
Reputation:
Solved Threads: 0
hello all..
im a newbie..in both complex database design and oracle pl/sql ,and im very unsure/confused about the structure of my tables and how to normalize some info.
ok so heres the situation. i have a company,employees are distributed according to dept and section and category.each category has number of ranks and each rank has a range of grades that come under it. eg: AdministrationCategory of employees have Ranka 1,2,3,4. Rank 1 includes employees that are assigned grades 1 to 4, Rank 2 includes emps assigned grades 4-8 and so on.
Now,each emp,dependin on what category,rank and grade they fall into ,they differ in the number of holidays that they get. eg: annual leave for category1 ,rank1,grades 1-4 have annual leave of 20 days.
how can i incorporate the diff category,rank,grade wit the holiday table so as to retrieve the info that i want?
The tables that i currently have are below wit their column names.
Employee Table
empno(pk), fname,lname,gender,dob,doh,country,address,mobileno,homeno,
deptid,sectionid,qualification,designation.
Department Table
deptid, deptname
Section Table
sectionid, sectionname
Holiday Table
holiday_id,holiday_name,
*now how do i relate this to a table tht will define rank and grade dependin on category and the days allowed respectively?
do i create one table that lists the category and the ranks/grades under it? in this case wht would the primary key be? since there is one category and many ranks under it and many grades under one rank.
eg: category 1
Ranks Grades
1 1-4
2 4-8
3 8-12
here u can see tht i have a reoccuring grade..so i cant keep the grade as the pk either..
so would a table wit the following structure be right? and how would i relate it to the holiday table?
Rank/Grade Category
R1G1 cat1
R1G2 cat1
R1G3 cat1
R1G4 cat1
R2G1 cat1
....and so on
So id have to create a new table for each category and list the rank/grade combinations? how would i reference/relate this to determine holiday allowed for employee?
*
Any guidance/help would be really appreciated
Thanks in advance.
im a newbie..in both complex database design and oracle pl/sql ,and im very unsure/confused about the structure of my tables and how to normalize some info.
ok so heres the situation. i have a company,employees are distributed according to dept and section and category.each category has number of ranks and each rank has a range of grades that come under it. eg: AdministrationCategory of employees have Ranka 1,2,3,4. Rank 1 includes employees that are assigned grades 1 to 4, Rank 2 includes emps assigned grades 4-8 and so on.
Now,each emp,dependin on what category,rank and grade they fall into ,they differ in the number of holidays that they get. eg: annual leave for category1 ,rank1,grades 1-4 have annual leave of 20 days.
how can i incorporate the diff category,rank,grade wit the holiday table so as to retrieve the info that i want?
The tables that i currently have are below wit their column names.
Employee Table
empno(pk), fname,lname,gender,dob,doh,country,address,mobileno,homeno,
deptid,sectionid,qualification,designation.
Department Table
deptid, deptname
Section Table
sectionid, sectionname
Holiday Table
holiday_id,holiday_name,
*now how do i relate this to a table tht will define rank and grade dependin on category and the days allowed respectively?
do i create one table that lists the category and the ranks/grades under it? in this case wht would the primary key be? since there is one category and many ranks under it and many grades under one rank.
eg: category 1
Ranks Grades
1 1-4
2 4-8
3 8-12
here u can see tht i have a reoccuring grade..so i cant keep the grade as the pk either..
so would a table wit the following structure be right? and how would i relate it to the holiday table?
Rank/Grade Category
R1G1 cat1
R1G2 cat1
R1G3 cat1
R1G4 cat1
R2G1 cat1
....and so on
So id have to create a new table for each category and list the rank/grade combinations? how would i reference/relate this to determine holiday allowed for employee?
*
Any guidance/help would be really appreciated
Thanks in advance.
•
•
Join Date: Oct 2008
Posts: 17
Reputation:
Solved Threads: 1
I think the best way is creating a fact table that has all the information. To relate that information all fields must be equals.
The table would be:
cathegory|rank|grade|days_holidays|other_info_you_may_need
1|1|1
1|1|2
1|1|3
1|1|4
1|2|4
...
and so on. I put only numbers but you can use the content of the original fields. Be sure that the fields in origin tables has a foreign key to this table.
The days can be accesed querying an outer join.
Hope it helps.
The table would be:
cathegory|rank|grade|days_holidays|other_info_you_may_need
1|1|1
1|1|2
1|1|3
1|1|4
1|2|4
...
and so on. I put only numbers but you can use the content of the original fields. Be sure that the fields in origin tables has a foreign key to this table.
The days can be accesed querying an outer join.
Hope it helps.
![]() |
Similar Threads
- URGENT!! Need help regarding primary key!! (MS SQL)
- Urgent Help for Database Desktop (Pascal and Delphi)
- urgent help needed in multi master replication (Oracle)
- Datagrid for typed dataset (VB.NET)
- URGENT: Implementing search with multiple dissimilar MySQL tables (MySQL)
- please help! this is urgent> how to retrieve data to my tabpage without using data fo (C#)
- plz help me to connect more than one table in the ms access database to the asp.net (ASP.NET)
- Importing SQL Script File - Urgent !! (Database Design)
Other Threads in the Oracle Forum
- Previous Thread: Query for selecting the last row
- Next Thread: SQLPLUS username and password
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho





