This is not a SFW instance. NSFW communities will be tagged, and efforts will be made to keep SFW communities clean, but proceed at your own comfort level.
CREATEVIEW NiceList ASSELECT*FROM Children
WHERE behavior ='nice'AND parent.income >40000;
CREATEVIEW NaughtyList ASSELECT*FROM Children
WHERE behavior ='naughty';
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';The income is a nice touch.
Why are we using magic strings for behavior?
Feel free to fork my comment.