注册 登录
编程论坛 MySQL论坛

呜呜,大神们来帮我看道SQL问题啊~~

littlejessie 发布于 2011-06-11 20:35, 1974 次点击
table store
store_id       city                space
wh1           new yourk        370
wh2           beijing              500
wh3           new york           200
wh4           london               400

table employee
store_id           emp_id           salary
wh1                    e1                 1220
wh1                    e3                 1210
wh2                    e4                 1250
wh2                    e6                  1230
wh3                    e7                 1300
wh3                    e8                  1240
wh4                    e9                  1350
wh4                    e11                1280

question1:get the employees who are paid the max salary for each city.(can create temporary tables)

quetion2:get the total salary,the total space,the number of store,the number of employee and maximum salary of every city.show the results as following layout.(can create temorary tables)

City    Tot.Salary    Tot.Space    #store    #employee    Max Salary
...          ...         ...        ...         ...           ...
0 回复
1