Tuesday, August 24, 2010

The ultimate Wedding Query... (SQL Style)

I am running the following SQL query among the databases instances I managed in different MS SQL servers for fun....

At that point, I should say that the desired "tuple" has not yet been found :-( . . . .




Details of the SQL query follow:

--
-- Funny query
-- Date: 25 August 2010
--
-- The ultimate Wedding Query................ (SQL Style)

-- HUSBANDS QUERY

CREATE PROCEDURE MyMarriage(BrideGroom Male (25),Bride Female(20) )
AS BEGIN
SELECT Bride FROM Beautiful_ Brides
WHERE FatherInLaw = 'Millionaire'
AND Count(Car) > 20 AND HouseStatus ='ThreeStoreyed'
AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MiBA, PHD) AND Having Brothers= Null
AND Sisters =Null


SELECT Gold, Shares, Cash, Car, BankBalance
FROM FatherInLaw
UPDATE MyBankAccout
SETMyBal = MyBal + FatherInLawBal
UPDATE MyLocker
SET MyLockerContents = MyLockerContents + FatherInLawGold
INSERT INTOMyCarShed VALUES('Porsche')
END
GO

-- Then the wife writes the below query:
DROP HUSBAND;
Commit;

-- (-:

No comments: