#Dumb Course

1 messages ยท Page 1 of 1 (latest)

radiant kestrel
#

I think I did an abomination

#

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

radiant kestrel
#

Greeeeat. Just what I needed for a simple lang ๐Ÿ˜ญ

radiant kestrel
#

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

radiant kestrel
#

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 ChibiSmug "

#

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 ChibiHappy

#

Now I see this wasn't syntactic sugar for ease of use, it was critical to speed.

#

๐Ÿ—’๏ธ ๐Ÿ–Š๏ธ

radiant kestrel
#

I've created my first (and hopefully my last) functional trigger. Hurray!!!

radiant kestrel
#

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.

radiant kestrel
#

IT doesn't even work!

#

Well, at least sending queries from dbeaver Errors out

#

(and doesn't handle the error

radiant kestrel
#

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

radiant kestrel
#

I think I might be getting used to this