8
4
u/Mamertine SQL Server Dec 22 '18
Behavior = 'Nice'That's inefficient and breaks one of the normal forms. Make a lookup table with behaviors.
SELECT p.First name, p.LastName
FROM Person p
INNER JOIN BehaviorStatus b
On p.behaviorID = b.behaviorID
WHERE b.status = 'nice'4
Dec 22 '18
Better, but I’m gonna have a fit at the inconsistency in the column naming convention.
4
u/Mamertine SQL Server Dec 22 '18
On mobile so autocorrect got a bit carried away. Also I'll admit I fail at consistency. It's best when others name the columns.
4
3
2
1
18
u/codemagic Dec 22 '18
Santa, using SELECT * on a 7B row table is naughty