Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
like
1. with the help of join table
2. with the help of foreign key
any more?

i mean here that i am working on one table but needed to access the data/column value from another in that case how many ways that i can access that table value

thanks in advance
mahbub
Posted
Updated 23-Mar-15 6:14am
v2
Comments
ZurdoDev 23-Mar-15 9:29am    
UNION
Derived table
Sub query

Why?
Sergey Alexandrovich Kryukov 23-Mar-15 10:12am    
The question makes no sense. What does it mean, "another"?
—SA
mahbubur rahman 23-Mar-15 12:11pm    
ok SA, my question is short but i wanted to mean here that i am working with one table and needed to access the data/column value from another table.
thanks
Sergey Alexandrovich Kryukov 23-Mar-15 14:14pm    
Okay, what is that "working with one table"? What prevents you from working with one table and than to another one. Do you mean one single statement for two tables at once? Then ask about that, and explain what kind of statement it should be. After all, do you want to count "way", or understand them?
—SA
mahbubur rahman 23-Mar-15 23:21pm    
ok, Actually i wanted to develop a Payroll Management System
but first i wanna calculate the salary of the employee every month
here is my schema : https://www.dropbox.com/s/krcwkb51rboqyx2/schema.jpg?dl=0

the above mention dropbox link shows the schema link

i am not good in database as u see that my schema is not a good normalize one.

first i would like to calculate the following table

Pay_Allowance
Deduction
salary pay

the Pay_Allowance table gives the total pay category of the employee
the Deduction table gives the category of salary deduction
the salary pay table describe the net salary of the month

so for the above mention table i would like to develop a good normalize schema. thats why i wanted to know the good way to make relationship table between the three table. so that, suppose i am working with Salary_pay table but needed to calculate the Gross Pay from the Pay_allowance table and the Total Deduction from the Deduction table in that case how i can merge the two table

what is the best way to work with in such case ?

thanks,
SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900