| Author |
Topic |
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 00:38:17
|
| Hello Can someone help me with this queries pleaseTABLE #1EMP TABLEColoumns in table areEMP_NAMEEMP_IDMGR_IDSALARYGRADEDEPT_IDTABLE #2DEPT TABLEColoumns in table areDEPT_IDDEPT_NAMETABLE #3MANAGER TABLEColoumns in table areMGR_IDMGR_NAMEDEPT_IDThe Queries are1.Display all DEPT_NAME which consists of more than 100 employees2.Delete all employees under MGR_NAME John Smith3.Display the top DEPT_NAME in terms of highest salary paid to: a.Query 1 - Individual emp b.Query 2 - All emps4.Display EMP_NAME & SALARY of top 10 employees in DEPT_NAME=”Manufacture”ThanksAlishaAlisha |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-08 : 01:00:39
|
@Alisha: I think part of an assignment . |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 01:04:34
|
| Can some one please help me on this iam new to DB guysThanksAlisha |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 01:13:20
|
| But we dont have empno in the list of tables Yadhu. Are you reffering to Emp_idAlisha |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 02:13:56
|
| Can someone please help me regarding these queriesThanksAlisha |
 |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-08 : 02:18:03
|
yes off course ... let me know what queries you have so far the above ... i'll rectify and will make you able to get 10/10 |
 |
|
|
yadhu_cse
Constraint Violating Yak Guru
252 Posts |
Posted - 2011-02-08 : 03:29:04
|
| TRY THISSELECT DEPT_NAME,COUNT(EMP_ID)FROM EMP INNER JOINDEPT ON EMP.DEPTId=DEPT.DEPTIdGROUP BY DEPT_NAMEHAVING COUNT(EMPID)>100 |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 03:30:04
|
| Thanks yadhu very muchThanks a lotAlisha |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 03:31:02
|
| Yha i have got itAlisha |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 03:32:06
|
| Can you help me on the other two queries also pleaseDisplay the top DEPT_NAME in terms of highest salary paid to:a.Query 1 - Individual empb.Query 2 - All empsThanksAlisha |
 |
|
|
yadhu_cse
Constraint Violating Yak Guru
252 Posts |
Posted - 2011-02-08 : 03:35:05
|
| TRY FOR 2ndDELETE FromFROM EMP INNER JOIN MANAGER ON EMP.MGRID=MANEGR.MGRIDWHERE MGR_NAME='Jhon SMITH' |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 03:41:47
|
| Hiit is for each employees yadhuThanksAlisha |
 |
|
|
yadhu_cse
Constraint Violating Yak Guru
252 Posts |
Posted - 2011-02-08 : 03:42:33
|
| try for 3rdselect DEPT_name ,Max(salsry) from dept inner join emp on dept.deptid=emp.deptidgroup by dept_namehaving max(salary)>select Max(salsry) from emp |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 03:46:08
|
| Hey thanks a lot it works nowThanks a ton yadhuAlisha |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 03:47:55
|
| Can you also help me with this one YadhuDisplay EMP_NAME & SALARY of top 10 employees in DEPT_NAME=”Manufacture”Alisha |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 03:51:03
|
| nope i haventAlisha |
 |
|
|
yadhu_cse
Constraint Violating Yak Guru
252 Posts |
Posted - 2011-02-08 : 03:56:31
|
| select top 10 EMP_NAME max(sal) as salfrom emp inner join dept on emp.deptid=dept.deptidwhere dept_name='manufature'order by sal desc |
 |
|
|
Alisha26
Starting Member
19 Posts |
Posted - 2011-02-08 : 04:02:11
|
| Hey thanks a lot for your help and time.Really you are so nice Thanks againAlisha |
 |
|
|
|