nah I just actually had a project using SQL this semester. Just posting my work from it
side note you can wrap code in 3 backticks ```
select * from orders
inner join products on products.id = orders.product_id
where
products.id = 123
and orders.created_at >= now() - interval '12 months'
and orders.is_cancelled != false
What kind of job are you doing that you suddenly need to learn sql?
i need to search for s*** apparently
i need to search for s*** apparently
New job or they gave you new responsibilities?
New job or they gave you new responsibilities?
new responsibilities smh
question can you manually search sql databases tho
without the commands?
@BIGGWAVE ask @S for some tips. He knows what hes doing
btw im just self taught but in my experience table and column names should be treated as case insensitive (ProductID is no different to productid in a lot of database systems), so using snake_case is conventional
also it keeps things easier to read if you have stuff like products.id instead of products.product_id since it's implied
there are probably exceptions to this but these are just conventions i've seen and use and it seems logical to me. the most important thing is that your personal/organization's db naming system is internally consistent i guess.
new responsibilities smh
question can you manually search sql databases tho
without the commands?
You getting a pay raise from this?
new responsibilities smh
question can you manually search sql databases tho
without the commands?
The commands are what make it doable, its as manual as you can get
new responsibilities smh
question can you manually search sql databases tho
without the commands?
Ya but u have to manually go thru sometimes millions of rows of data to find the one you want
So u might as well google “sql how to select where column is not true”
And create a query using what stack overflow spits out if u rly refuse to learn
Sql is intended to save time and learning any at all will help u do thinfs that would be otherwise extremely tedious
Sql can get very very complicated and take a while to weite it to get what u expect out, but itll often be faster lol
Sometimes if i know a table has 5 rows ill just select the entire table without any sort of more intelligent thinf and just find the one i want w my eyes lol
But for large tables or things w a ton of logic relying on multiple tables its more and more unfeasible to find the data just by going thru it
can you name me a common program that many offices use that use sql language?
Are u having a stroke
What kind of job are you doing that you suddenly need to learn sql?
Literally any job with any form of data, when you're not an idiot
side note you can wrap code in 3 backticks ```
select * from orders
inner join products on products.id = orders.product_id
where
products.id = 123
and orders.created_at >= now() - interval '12 months'
and orders.is_cancelled != false
print("Hi Scott")
select KNOWLEDGE from ktt2 where sxn = LIFE
As someone that just took Database Systems, this was funny lol
this site is decent to get you started:
although it teaches things that can be considered bad practice like select in select, just watch a yt video on CTE’s and you’re good
Idk how familiar you are with other programming languages but you can do something similar to an if statement using
CASE
WHEN condition1 THEN result1
ELSE result2
END;
Also stored procedures are great to house complicated queries that you can access from other applications like functions, with inputs/outputs