#Dumb Course
1 messages ยท Page 1 of 1 (latest)
This feels WRONG
like capital wrong
I think I make a temp table midway
Just to discard the shipping amount
The prompt was was: 'Create a function that returns the State which sold most products'
But I feel I might have convoluted it too much
Greeeeat. Just what I needed for a simple lang ๐ญ
Upgraded syntax because WITH bothers me because you can't nest it
For some reason it makes the editor really angry with those red underlines
Wooooow
I had made my cross table and made all the columns and constraints right
But when I went to use it... it outputted nothing!
I thought setting the FK constraints would autopopulate the table
Now I know that's obviously not the case
So I just thought "Let's populate it
"
And so produced this code
This query took 6 seconds on my system, when other operations took 0.009s ๐จ
So this is like 1,000 more expensive :P
Well 666.7 more expensive
anyhow
Now I can see things can balloon up!
And this is a mini database
And now using this crosstable I can fetch some other operations on 0,010 secs 
Now I see this wasn't syntactic sugar for ease of use, it was critical to speed.
๐๏ธ ๐๏ธ
I've created my first (and hopefully my last) functional trigger. Hurray!!!
I'm not a fan of this try-catch style coding. Just check if that customerID is already on the table and do your IF/ELSE from there.
IT doesn't even work!
Well, at least sending queries from dbeaver Errors out
(and doesn't handle the error
Da superior way
Don't get me wrong, error handling is important but it should only catch the most unforeseeable errors, not the predictable ones
IMO
I think I might be getting used to this