Lau barbaaaad - Sajha Mobile
SAJHA MOBILE
Lau barbaaaad
Posts 5 · Viewed 4791 · Likes 1 · Go to Last Post
subav
· Snapshot 78
Like · Likedby · 0
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??


Stiffler
· Snapshot 266
Like · Liked by · 0
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));
YoTaBhayanaNiSom
· Snapshot 290
Like · Liked by · 0

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


 


 


 

devilwithin999
· Snapshot 294
Like · Liked by · 0

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!


 

Stiffler
· Snapshot 391
Like · Liked by · 0
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.
Please log in to reply to this post

You can also log in using your Facebook
View in Desktop
What people are reading
You might like these other discussions...
· Posts 4 · Viewed 338
· Posts 1 · Viewed 87
· Posts 1 · Viewed 80
· Posts 15 · Viewed 2152 · Likes 3
· Posts 1 · Viewed 185
· Posts 6 · Viewed 787
· Posts 1 · Viewed 171
· Posts 1 · Viewed 345
· Posts 4 · Viewed 925
· Posts 2 · Viewed 518



Your Banner Here
Travel Partners
Travel House Nepal