Lau barbaaaad

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

Yeso kta haru ko madat ko khacho cha Bholi sql ko grihakarya dinu cha 2 wota sql query ma adhkiyeko chu bhane.. Yeso kasaile madat gare dekhi dhanya hune thiye 1)Retrieve name of employees who make at least $10000 more than the employee who is paid least in the company. 2)Retrieve names of all employees who work in the department that has the employee with the higest salary among all employees Lau na chito madat garau

devilwithin999 · Oct 18, 2010 1:39 AM · 11,984 views

5 Replies

Since i dont see anyone helping, i will try. mero sql ni teti ramro chaina :) 1: SELECT FNAME, LNAME FROM EMPLOYEE WHERE  SALARY > (SELECT MIN(SALARY) FROM EMPLOYEE) 2: Sorry saathi.. aru help garla ki??

subav · Oct 18, 2010 7:11 AM

First off, I learned sql on my own 8 yrs back and never used it so my memory is not fresh. Second, if you cannot do this simple problem then forget about graduating with good gpa, and don't blame it on USA when u don't get a job after graduating. Alikati ta afai padhnu payo ni som. Select fname, lname From employee Where salary>( (select min(salary) from employee)+10000); 2. Select fname, lname From employee Where dno=(select dno from employee where salary=(select max(salary) from employee));

Stiffler · Oct 18, 2010 10:56 AM

Stiffler's query is ok for 2 for the given data. But if there are multiple employees (whether in the same department or different departments) that earn the same salary that happen to be the highest for the company, then the query will return an error. Following query should handle that situation. Select fname, lname From employee Where dno in (select distinct dno from employee where salary=(select max(salary) from employee)); Or you could use this. Select e.fname, e.lname From employee e inner join (select distinct dno from employee    where salary=(select max(salary) from employee) ) m on e.dno = m.dno      

YoTaBhayanaNiSom · Oct 18, 2010 11:29 AM

Napadheko hoina bro... Ma aafaile try gari sake ani answer lekhe tara ali sure bhayena... Feri prof lastai kadha question sodhcha exam ma...ani grade dherai lyaune bhanekai assignment bata ho.. So make sure gareko.. Anyway Thanks hai duitai sathi haru!  

devilwithin999 · Oct 18, 2010 11:33 AM

Not a problem. I am not not criticizing you, merely cautioning u that u need to master these things and go beyond the homeworks if u want to be hired after graduation. Agree with yotabhayenanisom.

Stiffler · Oct 18, 2010 12:44 PM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all