oracle11g - Write 2 SQL queries -
here erd. use oracle sql. need:
1) select exercise involves greatest number of muscle.
2) select top 5 exercises number of involved muscles.
i've written queries: it's first task , second same, except r < 6:
select * exercise exercise.ex_id = (select ex_id (select e.ex_id, dense_rank() on (order count(*) desc) r muscle m, muscle_group mg, ex_complex ex_c, exercise e m.mgroup_id = mg.mgroup_id , ex_c.mgroup_id = mg.mgroup_id , ex_c.ex_id = e.ex_id group e.ex_id) r < 2);
Comments
Post a Comment