SQL Process For Marriage
@ BrideGroom Char(NotBad),
@ Bride Char(Good)
AS
BEGIN
SELECT distinct BrideGroom FROM US_Bridegrooms
WHERE
US_Status_ BrideGroom in ( ‘Citizen’ ,’Green_Card’) AND
US_Status_FatherInLaw = null AND
US_Status_MotherInLaw = null AND
BrideGroom = ‘Millionaire’ AND
FatherInLaw = ‘Millionaire’ AND
HouseCount _US > 2 AND
HouseCount _INDIA > 2 AND
House_Location_India in (’Chennai’,'Mumbai’,'Bangalore’,'Delhi’,'Hyderabad’) AND
House_Location_USA in (’MA’,'VA’,'WA’,'IL’,'NJ’,'NY’,'CA’) AND
HouseStatus _US =’TwoStoreyed’ AND
HouseStatus _INDIA =’TwoStoreyed’ AND
CarCount _US > 2 AND
CarCount _INDIA > 2 AND
BridegroomEduStatus in (’MS’,'PHD’) AND Mother_in_Law_EduStatus=null AND
HavingBrothers=’NO’ AND
HavingSisters =’ No’ AND
AllowRelocate_US_to_INDIA =’NO’
END
GO
/*After Marriage*/
UPDATE Husband_Lookup SET Husband_Type = ‘H P’
insert into MyBankAccout (
SELECT Gold ,Cash,House,Car,BankBalance FROM FatherInLaw
union all SELECT Gold ,Cash, House ,Car,BankBalance FROM Husband )
UPDATE MyBankAccout SET MyBal = MyBal + FatherinLawBal
UPDATE MyLocker SET MyLockerContents = MyLockerContents + FatherinLawGold
INSERT INTO MyCarShed VALUES (’BMW’,'Mercedes’,'Ferrari’)
..
Then the wife writes the below query:
TRUNCATE HUSBAND
TRUNCATE FatherInLaw
TRUNCATE MotherInLaw
Trackback
RSS Feed
Related Posts you may like to Read...
one Comment
1.
Jack From
(UNITED KINGDOM)
Wrote Using
Internet Explorer 6.0 on
Windows XP on 15. February 2008 at 10:51 pm
Hi
There’s a syntax error on the first chunk of code