Tuesday, August 19, 2008

Wedding Query

(SQL Server Stored Procedure Style)
CREATE PROCEDURE MyMarriage
@ BrideGroom Char(NotBad) ,
@ Bride Char(Good)
AS
BEGIN
SELECT Bride FROM india_ Brides
WHERE FatherInLaw = 'Millionaire' AND CarCount > 2 AND
HouseStatus ='ThreeStoreyed' AND
BrideEduStatus= 'B.TECH or BE or Degree or MCA or MBA' AND HavingBrothers= 'NO' AND
HavingSisters ='No' AND
AllowRelocate ='YES'
SELECT Gold ,Cash,Car,BankBalance FROM FatherInLaw
UPDATE MyBankAccout SET MyBal = 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;

No comments: