You must log in or # to comment.
Why would Santa need two separate tables for this?
I would make two separate views.
CREATE VIEW NiceList AS SELECT * FROM Children WHERE behavior = 'nice' AND parent.income > 40000; CREATE VIEW NaughtyList AS SELECT * FROM Children WHERE behavior = 'naughty';Why are we using magic strings for behavior?
Feel free to fork my comment.
CREATE VIEW NiceList AS SELECT * FROM Children WHERE behavior > 2000 AND parent.income > 40000; CREATE VIEW NaughtyList AS SELECT * FROM Children WHERE behavior <= 2000;


