var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Merging two tables then grouping them
I have two tables, one is named Employee and the other Job_title. I'm trying to combine the two tables so I can group certain columns.
This is what I thought of so far and please correct me if I'm wrong.
SELECT Last_name FROM Employee
SELECT Job_title_code FROM Job_title
GROUP BY Exempt_non_exempt
Now this is just a theory (obviously it doesn't work) but basiclly I'm trying to have columns from two tables and have the grouped.
There is no relationship between these tables?
No foreign keys?
You are selecting a single column and performing GROUP BY without any aggregate functions?
This makes no sense.
Well, in both tables, they each have a job_title_code column.
lastname, firstname, job title code
job title code, job title, salary, exempt/non exempt
Is this homework?
It looks like homework.
It sounds like homework.
Are we studying relational databases?
So why aren't you using a join?
I don't think this is homework. If it was homework his question would be more clearly phrased!
INNER JOIN Job_title on Employee.Job_title_code = Job_title.Job_title_code
sorry for the mix up, yes it is homework. that's for suggesting the INNER JOIN command. i found a variation of what you did and it worked out for my db. by the way, how did you put your code in a window like that?
SELECT Employee.Last_Name, Job_title.Exempt_non_exempt_status
INNER JOIN Job_title
Enclose your code in CODE tagsL
Your code here
Remove the X characters...