|
Posted by Paul Lautman on 09/21/07 10:59
stevenleongusa@gmail.com wrote:
> I am new to this SQL. Can someone answer this question for me?
> 1. Given the following schema of an employees table:
>
>
> *employees (*
>
> * empid integer primary key, -- employee id number*
>
> * dept string, -- the employee's department number*
>
> * salary float, -- salary of the employee*
>
> * mgrid integer -- employee id number of employee's
> manager*
>
> *)*
>
>
> Write the query (or queries if necessary) needed to count the number
> of employees in each employee's department who are paid more than
> their manager.
> All employees (including managers) appear in this table.
> Each employee has a manager (except the CEO), and the mgrid in the
> employee's row is the empid of the employee's manager.
It's your homework question, you are supposed to learn how to do it, not ask
us!
Navigation:
[Reply to this message]
|