Thursday, August 7, 2008

Funny SQL Queries & Store Procedure

WeddingQuery. ....... ........ (SQL Style)

HUSBANDS QUERY

CREATE PROCEDURE MyMarriage (
BrideGroom Male (25) ,
Bride Female(20) )

AS
BEGIN


SELECT
Bride FROM india_ Brides
WHERE FatherInLaw = 'Millionaire'

AND Count(Car) > 20 AND HouseStatus ='ThreeStoreyed'
AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MiBA) AND Having Brothers= Null

AND Sisters =Null



SELECT Gold ,Cash,Car,BankBalan ce

FROM FatherInLaw

UPDATE MyBankAccout

SETMyBal = MyBal + FatherInLawBal


UPDATE
MyLocker

SET MyLockerContents = MyLockerContents + FatherInLawGold


INSERT INTO
MyCarShed VALUES('BMW')
END
GO

Then the wife writes the below query:

DROP HUSBAND;
Commit;