Thursday, February 01, 2007

Query to find single girl

Though a better half is bitter pill, one needs to swallow the truth. Just Kidding!

Many of my friends, relatives are getting married this year. I should also search a girl, obviously she has to be from moon. But at first, I need to have a job.

Query> Select CompanyName, Designation, Annual_Salary, FemaleSingleEmployeeCount, SingleEmployeeCount
From VacancyJobs
where Annual_Salary >= 1000000 AND
(Select count( Emp1.Name) FemaleSingleEmployeeCount
From Employee EMP1
Where Employee.Sex is “Female” AND
Emplyee.Relationship_Status = “Single” AND
Employee.CompanyName = VacancyJobs.CompanyName)
> 0.6 * (Select count(Emp2.Name) SingleEmployeeCount
From Employee EMP2
Where Emp2.Relationship_Status = “Single” AND
Emp2.CompanyName = EMP1.CompanyName)
Order by VacancyJobs.Annual_Salary DESC, FemaleSingleEmployeeCount ASC;

Query Executed!

Result> 0 Rows displayed.

You may be considering you as unlucky but it seems you are lucky guy.

1 comment:

Karteek said...

Query is ambiqous. Becareful bro :P

Employee.Relationship_Status = "Unmarried And Single" :D

Past, Present and Future - All are abstract.