00:01 <+bridge> [ddnet] sql question: If i'm getting it right.. you put PRIMARY KEY as a constraint so you can't do another column with the same name? 00:01 <+bridge> [ddnet] so "name TEXT PRIMARY KEY" would say "you can't add another column named "name" in the table" ? 00:05 <+bridge> [ddnet] no 00:05 <+bridge> [ddnet] No, not at all. 00:05 <+bridge> [ddnet] it means that two rows in the table can't have the same value for "name" 00:06 <+bridge> [ddnet] OH so you can't have "Meekrioz" more than once in the table? 00:07 <+bridge> [ddnet] @heinrich5991 that would be `unique` 00:08 <+bridge> [ddnet] I think it should be `name text, primary key (name)` and the primary key is the set of columns that identifies a row uniquely 00:09 <+bridge> [ddnet] so if you just have one column as your primary key set, then all rows in that column are unique 00:09 <+bridge> [ddnet] PRIMARY KEY columns can be used to uniquely identify the row. 00:09 <+bridge> [ddnet] that is what my note says 00:09 <+bridge> [ddnet] correct 00:10 <+bridge> [ddnet] for ddnet's record_race we have (Name, Time, Timestamp) as the primary key. So a rank needs to have unique combination of Name, Time and Timestamp 00:11 <+bridge> [ddnet] If you try to insert a rank twice, you get an error because there already is one with this primary key 00:11 <+bridge> [ddnet] aaaah i see 00:11 <+bridge> [ddnet] do you have an example for UNIQUE? 00:12 <+bridge> [ddnet] Also indexes are if I remember used to improve query performance if used properly 00:12 <+bridge> [ddnet] It just says that each row needs to have a different value in this column 00:18 <+bridge> [ddnet] @Kallemy if u are interested in learning a bit more of the basic theory 00:18 <+bridge> [ddnet] https://en.wikipedia.org/wiki/Third_normal_form 00:20 <+bridge> [ddnet] but isn't PRIMARY KEY the same thing then? 00:20 <+bridge> [ddnet] @Kallemy > Primary key will not accept NULL values whereas Unique key can accept NULL values. A table can have only one primary key whereas there can be multiple unique key on a table. 00:21 <+bridge> [ddnet] for example, a user id would be a good candidate for primary key 00:21 <+bridge> [ddnet] and their email a unique key 00:24 <+bridge> [ddnet] Ohhh so a PRIMARY KEY has to have an input but UNIQUE doesnt give a fuck what it has? NULL or email (for your example) 00:24 <+bridge> [ddnet] it depends on how you define the column 00:24 <+bridge> [ddnet] making a column nullable or not is up to you 00:24 <+bridge> [ddnet] but you can't make a column that is a primary key nullable 00:24 <+bridge> [ddnet] whereas you can specify a column that has the unique contraint nullable 00:25 <+bridge> [ddnet] (email TEXT NULL UNIQUE) 00:25 <+bridge> [ddnet] or (email TEXT NOT NULL UNIQUE) 00:26 <+bridge> [ddnet] @Kallemy you see, often you want a id that never changes, to referenciate it from other tables 00:26 <+bridge> [ddnet] a unique column that is not a primary key could have its value changed 00:26 <+bridge> [ddnet] yea a customer ID for example 00:26 <+bridge> [ddnet] losing that ability 00:26 <+bridge> [ddnet] AAAAAAA 00:26 <+bridge> [ddnet] I SEE 00:26 <+bridge> [ddnet] you don't wanna change a customer ID but you want to change an email address for example 00:27 <+bridge> [ddnet] but this does not mean u cant change a primary key 00:27 <+bridge> [ddnet] yeah 00:27 <+bridge> [ddnet] you can probably UPDATE it right? 00:27 <+bridge> [ddnet] yea 00:27 <+bridge> [ddnet] aaaaah i see! thank you 00:27 <+bridge> [ddnet] depends after but you might need to cascade it 00:28 <+bridge> [ddnet] depends of how your db is made 00:28 <+bridge> [ddnet] but the norm is to generally not update primary keys 00:28 <+bridge> [ddnet] u rarely need to 00:28 <+bridge> [ddnet] well if you have a fk 00:29 <+bridge> [ddnet] got it, thanks 02:41 <+bridge> [ddnet] sql :justatest: 02:53 <+bridge> [ddnet] What's wrong with SQL? 02:53 <+bridge> [ddnet] wait are u learning python and sql same time 02:53 <+bridge> [ddnet] are u interested in data analytics 02:58 <+bridge> [ddnet] Maybe :justatest: 02:59 <+bridge> [ddnet] I'm just tryna see what suits me best, and rn sql is kinda cool 05:45 <+bridge> [ddnet] Read few articles that NoSQL dbs are better 05:45 <+bridge> [ddnet] Probably depends on your experience and tasks, but by description it sounds much better 11:48 <+bridge> [ddnet] Just stick to traditionam rdbms, you can mess around with nosql later when you know what you are doing 11:49 <+ChillerDragon> I assume doing this in SendPacket() would be bad ``SecurityToken = htonl(SecurityToken);`` 11:49 <+bridge> [ddnet] 9/10 if you think you need a database you are looking for a rdbms 12:38 <+bridge> [ddnet] So stick to SQL for now? That's what Im getting 12:38 <+bridge> [ddnet] Y 12:40 <+bridge> [ddnet] πŸ‘ 13:28 <+bridge> [ddnet] plain wrong 13:28 <+bridge> [ddnet] most nosql are not even ACID compliant 13:28 <+bridge> [ddnet] and most data is relational 13:29 <+bridge> [ddnet] https://www.youtube.com/watch?v=b2F-DItXtZs 13:29 <+bridge> [ddnet] must watch 13:33 <+bridge> [ddnet] Who cares about ACID guarantees. It is webscale 13:36 <+bridge> [ddnet] 2010πŸ’€ πŸ’€ πŸ’€ 13:40 <+bridge> [ddnet] Ryo when 13:40 <+bridge> [ddnet] when nosql 13:40 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1033344045856067615/IMG_20221022_143846.jpg 13:54 <+bridge> [ddnet] compressed images don't work when embedded in a map? 14:05 <+bridge> [ddnet] 2010 but valid today 16:27 <+bridge> [ddnet] "Update the email address for everyone in your table. 16:27 <+bridge> [ddnet] 16:27 <+bridge> [ddnet] Storm’s email is storm@codecademy.com." 16:27 <+bridge> [ddnet] 16:27 <+bridge> [ddnet] Is there a quicker way of doing it instead of 16:27 <+bridge> [ddnet] 16:27 <+bridge> [ddnet] ```UPDATE friends 16:27 <+bridge> [ddnet] SET email = 'storm@codecademy.com' 16:27 <+bridge> [ddnet] WHERE id = 1;``` 16:27 <+bridge> [ddnet] 16:27 <+bridge> [ddnet] For every ID in my table? 16:57 <+bridge> [ddnet] Most flavours of sql will do all rows if you dont have a WHERE clause at all 16:59 <+bridge> [ddnet] Some will force to use a WHERE clause, then you can do something like `WHERE 1=1` or `WHERE id = id` or `WHERE id > 0` 17:00 <+bridge> [ddnet] I don't remember which one requires the trick, maybe postgres 17:05 <+bridge> [ddnet] id = id worked 17:32 <+bridge> [ddnet] Postgres doesnt iirc 18:15 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1033413377822826496/IMG_20221022_112857.jpg 18:15 <+bridge> [ddnet] 4090 on the left 3080 right 18:16 <+bridge> [ddnet] My sister case wasnt big enough so gotta wait 18:16 <+bridge> [ddnet] Soon ill get the 3080 :BASED: for free 18:21 <+bridge> [ddnet] can you add radeon rx570 to comparison, cuz i never saw any of rtx gpus irl :greenthing: 18:24 <+bridge> [ddnet] @uwu probs like 1 and a half fan of the 3080 18:24 <+bridge> [ddnet] The 3080 is already huge 18:25 <+bridge> [ddnet] bruh even my rx570 could properly fit in my case πŸ’€ 18:26 <+bridge> [ddnet] bruh even my rx570 couldnt properly fit in my case πŸ’€ 18:26 <+bridge> [ddnet] Why is your sister getting a 4090? 18:26 <+bridge> [ddnet] Because she can 18:26 <+bridge> [ddnet] Literally 18:26 <+bridge> [ddnet] Ah, the best reason of all 18:27 <+bridge> [ddnet] Can afford it, and more 18:27 <+bridge> [ddnet] Xd 18:27 <+bridge> [ddnet] @Learath2 succesfull patreon artist with 2k~ patreons 18:27 <+bridge> [ddnet] :BASED: 18:27 <+bridge> [ddnet] Does she draw weebstuff? 18:28 <+bridge> [ddnet] Guess what she draws 18:28 <+bridge> [ddnet] Haha 18:28 <+bridge> [ddnet] Ye 18:28 <+bridge> [ddnet] Mostly muricans pay 18:28 <+bridge> [ddnet] Now the dollar is up too 18:28 <+bridge> [ddnet] Even richer 18:28 <+bridge> [ddnet] patrons* πŸ€“ 18:29 <+bridge> [ddnet] I'll order sth aswell 18:29 <+bridge> [ddnet] :BASED: 18:29 <+bridge> [ddnet] Contribute to the 4090 18:30 <+bridge> [ddnet] And thus, to my 3080 18:30 <+bridge> [ddnet] :greenthing: 18:30 <+bridge> [ddnet] 2k~ is pretty insane btw. She must be very famous. I have friends that draw on patreon and they have like 15-20 patrons 18:30 <+bridge> [ddnet] She is 18:30 <+bridge> [ddnet] 300k followers on twitter 18:31 <+bridge> [ddnet] My family thought i would be the better off, cuz programmer and that my sister would work at mc donalds or smth 18:31 <+bridge> [ddnet] Cuz art 18:31 <+bridge> [ddnet] But surprised everyone 18:31 <+bridge> [ddnet] She owns a house now 18:31 <+bridge> [ddnet] In barcelona 18:31 <+bridge> [ddnet] 300k damn followers damn 18:32 <+bridge> [ddnet] That big of a following I've probably randomly come across some of her work 18:32 <+bridge> [ddnet] Maybe 18:32 <+bridge> [ddnet] Its nsfw mostly btw 18:32 <+bridge> [ddnet] xd 18:32 <+bridge> [ddnet] Well obviously, how else would she make that much 18:32 <+bridge> [ddnet] True 18:33 <+bridge> [ddnet] Weebs and furries pay a lot for their nsfw 18:33 <+bridge> [ddnet] Well obviously how else would Learath have seen it 18:33 <+bridge> [ddnet] Duh 18:33 <+bridge> [ddnet] I can share it to u on dm 18:33 <+bridge> [ddnet] If u do nt leak 18:33 <+bridge> [ddnet] Sure, gimme a dm 18:34 <+bridge> [ddnet] I didn't know weeb ran in the genetics 18:34 <+bridge> [ddnet] wtf 300k 18:35 <+bridge> [ddnet] Yep yep 18:38 <+bridge> [ddnet] I got my 3rd covid vaxx 18:38 <+bridge> [ddnet] To go to japan 18:38 <+bridge> [ddnet] :monkalaugh: 18:38 <+bridge> [ddnet] which ones did you take 18:38 <+bridge> [ddnet] 2 moderna, 1 pfizer 18:38 <+bridge> [ddnet] I couldnt choose 18:38 <+bridge> [ddnet] did pfizer hurt 18:39 <+bridge> [ddnet] i only got 2 sinopharm so my social credit score is through the roof 18:42 <+bridge> [ddnet] So far not hurting 18:42 <+bridge> [ddnet] I got pfizer today 18:42 <+bridge> [ddnet] i'd say worst reason (but i guess your comment was sarcastic) 18:43 <+bridge> [ddnet] There may or may not be a chance that your arm will hurt a lot tomorrow and the day after tomorrow 18:43 <+bridge> [ddnet] @Ryozuki send link pls 18:43 <+bridge> [ddnet] If u dont leak 18:44 <+bridge> [ddnet] And a possible temperature 18:44 <+bridge> [ddnet] That happened with moderna 18:44 <+bridge> [ddnet] why would i? 18:44 <+bridge> [ddnet] Just sayin xd 18:45 <+bridge> [ddnet] Btw make sure to extract the 5G chip they put in you before it turns your brain into a soup 18:45 <+bridge> [ddnet] :troll: 18:45 <+bridge> [ddnet] :BASED: 18:45 <+bridge> [ddnet] No, I was serious. It's a joy to be able to afford the things you want even if you can't justify it. It's the neoliberal dream 18:45 <+bridge> [ddnet] U don't need vaccine 18:45 <+bridge> [ddnet] Covid ez 18:45 <+bridge> [ddnet] I need to travel to japan 18:45 <+bridge> [ddnet] i eat covid for breakfast 18:45 <+bridge> [ddnet] Rei outplayed covid with an aled 18:45 <+bridge> [ddnet] Oh, are you going over the new years? 18:45 <+bridge> [ddnet] Yes told u 18:45 <+bridge> [ddnet] From 24 dec to 2 jan 18:45 <+bridge> [ddnet] I thought you were just thinking about it 18:46 <+bridge> [ddnet] I got all paid 18:46 <+bridge> [ddnet] Ill do scale at frankfurt germany 18:46 <+bridge> [ddnet] 1 week is really tight, plan well 18:46 <+bridge> [ddnet] Yeah 18:46 <+bridge> [ddnet] Cant do more cuz work xd 18:46 <+bridge> [ddnet] I spent 2 and still didn't get to see everything I wanted to see 18:46 <+bridge> [ddnet] well, i just don't get it, especially if you don't have a need for it 18:46 <+bridge> [ddnet] 2/3 of the trip are paid by my sister :BASED: 18:47 <+bridge> [ddnet] I got the exact opposite. 2 pfizer 1 moderna 18:47 <+bridge> [ddnet] how much is your sister making per month ryo? 18:47 <+bridge> [ddnet] Well do you never indulge in things you don't absolutely need? The richer you are the more you can indulge 18:47 <+bridge> [ddnet] 10k or so $ 18:47 <+bridge> [ddnet] wtf? 18:47 <+bridge> [ddnet] Yep 18:48 <+bridge> [ddnet] I know a guy that just takes a vacation whenever he feels bad 18:48 <+bridge> [ddnet] i do sometimes learath, but not on things that are worth more than few tens of euros 18:48 <+bridge> [ddnet] (asking libk for a furfriend) 18:48 <+bridge> [ddnet] taking vacation is different 18:48 <+bridge> [ddnet] it's not material if you stay at home instead of going to work 18:48 <+bridge> [ddnet] That's because you just aren't rich enough. Cost is really a relative thing 18:49 <+bridge> [ddnet] (Or maybe you are and you are budget concious idk) 18:49 <+bridge> [ddnet] who says im not rich enough? 18:49 <+bridge> [ddnet] at some point of income you do not care what you buy, you don't even look at the price tag, you just go in the store, pick what you want and buy it. 18:49 <+bridge> [ddnet] Exactly. I know so many people like this around me. 18:49 <+bridge> [ddnet] i don't look prices when im grocery shopping, isn't that nice enough? 18:49 <+bridge> [ddnet] xd 18:50 <+bridge> [ddnet] Now bump it to the next level 18:50 <+bridge> [ddnet] nah, i have a conscious 18:50 <+bridge> [ddnet] i only look at discount products because they are tagged with a red shield, other than that, same. i buy what i crave and want. 18:50 <+bridge> [ddnet] you know that little voice in the head? 18:51 <+bridge> [ddnet] when it comes to grocery shopping, sadly i am not that rich that i can just do that in a dealership for cars 18:51 <+bridge> [ddnet] :SoonTm: 18:51 <+bridge> [ddnet] :BASED: 18:51 <+bridge> [ddnet] soon ill work at google and make 350k a year 18:51 <+bridge> [ddnet] 18:52 <+bridge> [ddnet] sooner or later, i will go into the porsche dealership near my place, buy the gt3rs, drive it on the autobahn, crash it and die with a smile 18:52 <+bridge> [ddnet] soon google will work at you at some point :troll: 18:52 <+bridge> [ddnet] don't be evil πŸ™‚ 18:52 <+bridge> [ddnet] πŸ™‚ 18:53 <+bridge> [ddnet] cant win that much without working for the devil 18:53 <+bridge> [ddnet] nah it's good to have goals like that 18:53 <+bridge> [ddnet] maybe not google 18:53 <+bridge> [ddnet] nasa i.e 18:53 <+bridge> [ddnet] Idk. There is just sth very pleasing about getting something just out of pure desire 18:53 <+bridge> [ddnet] ddnet.tw :YEP: 18:53 <+bridge> [ddnet] there are unicorn companies that prob pay more than google btw 18:53 <+bridge> [ddnet] but working at google itself is a stamp on your CV 18:53 <+bridge> [ddnet] a permanent gold diploma that gets u most work 18:53 <+bridge> [ddnet] i agree, as long as you don't do that everyday and still try to limit your carbon footprint 18:54 <+bridge> [ddnet] i mean you can buy used things and minimize your carbon footprint 18:54 <+bridge> [ddnet] i mean you can buy used things everyday and minimize your carbon footprint 18:54 <+bridge> [ddnet] like your gt3rs? 18:55 <+bridge> [ddnet] yea, i could buy that second hand 18:55 <+bridge> [ddnet] in the future, ofc 18:55 <+bridge> [ddnet] I personally don't believe in the concept of individual carbon footprint. Just by existing in europe I produce an insane amount more than an african village. Whatever I do at a personal level won't change shit. We'll get to me running my heater 10 minutes less when china turns off their coal plants 18:56 <+bridge> [ddnet] i probably have to because in 2023 or 2024 most german car factures won't build brand new combustion engines 18:56 <+bridge> [ddnet] yeah 18:57 <+bridge> [ddnet] asking ppl to do less is a bit dumb 18:57 <+bridge> [ddnet] the gov gotta force the companies 18:57 <+bridge> [ddnet] im glad germany is finally trying to do better when it comes to green energy 18:57 <+bridge> [ddnet] and then nobody moves... 18:57 <+bridge> [ddnet] 18:58 <+bridge> [ddnet] Heavy industry gets to pollute 50 times more than me while I have to watch the amount of meat I eat and the lights I keep on in my house. I'm sorry but fuck that 18:58 <+bridge> [ddnet] meat is defs smth on a personal scale 18:58 <+bridge> [ddnet] they can force new taxes for carbon-expensive things so ppl will make less footprint 18:58 <+bridge> [ddnet] other than electricity 18:58 <+bridge> [ddnet] bottom up (me) versus top down (you) 18:59 <+bridge> [ddnet] but ofc government need to move their asses... 18:59 <+bridge> [ddnet] i mean for people but not for companies 18:59 <+bridge> [ddnet] How about we bottom up go tell the govt and industry they need to get their shit in order? I'd be 100% with you on that 18:59 <+bridge> [ddnet] do u think theyll do anything with gigantic fabrics just to get shit done kekw 19:01 <+bridge> [ddnet] yay i killed the convo 19:01 <+bridge> [ddnet] don't tempt my french side πŸ˜„ 19:01 <+bridge> [ddnet] i'll go polish my guillotine 19:01 <+bridge> [ddnet] baguette 19:02 <+bridge> [ddnet] :PES2_FrenchThink: 19:02 <+bridge> [ddnet] πŸ˜„ do all french people get a government issued guillotine? 19:02 <+bridge> [ddnet] recent guillotine seen last week in my city during manifestation for better pay 19:02 <+bridge> [ddnet] https://www.reddit.com/r/france/comments/y7htwv/guillotine_%C3%A0_une_manif_sur_grenoble_aujourdhui/ 19:02 <+bridge> [ddnet] lmao 19:02 <+bridge> [ddnet] recent guillotine seen last week in my city during manifestation for better pay 19:02 <+bridge> [ddnet] 19:03 <+bridge> [ddnet] tf 19:03 <+bridge> [ddnet] we make one in wood working class obviously πŸ˜„ 19:04 <+bridge> [ddnet] going at the center of Grenoble sux 19:04 <+bridge> [ddnet] i don't even recognize the place 19:04 <+bridge> [ddnet] @Learath2 https://twitter.com/IndoPac_Info/status/1583794671129485312 19:04 <+bridge> [ddnet] Fwiw. I don't just increase my carbon footprint for the lulz. I still do the "right thing" if it's not too inconvenient. But I just refuse to live below a certain standard 19:04 <+bridge> [ddnet] :justatest: :justatest: :justatest: 19:04 <+bridge> [ddnet] @Chairn dunno too, would have said close to Victor Hugo 19:05 <+bridge> [ddnet] i thought too, but the tram tracks and buildings do not match 19:05 <+bridge> [ddnet] I wonder what went wrong. Did he dare talk badly about premier xi? 19:05 <+bridge> [ddnet] nah, he was other faction 19:05 <+bridge> [ddnet] > Hu Jintao was the only one who tried hard to prevent XiJinping from being re-elected. 19:05 <+bridge> [ddnet] and xi wants to be reelected for the 3rd time 19:05 <+bridge> [ddnet] which is out of the norm 19:06 <+bridge> [ddnet] u only can do 2 19:06 <+bridge> [ddnet] China is seriously concerning :/ 19:06 <+bridge> [ddnet] Actually xi made it legal to do more a year or two ago 19:07 <+bridge> [ddnet] well ofc 19:07 <+bridge> [ddnet] :BASED: 19:07 <+bridge> [ddnet] like putin 19:07 <+bridge> [ddnet] just make it legal 4head 19:07 <+bridge> [ddnet] Putin swapping places with medvedev before it became legal was probably the biggest farce on earth 19:10 <+bridge> [ddnet] If you'll spend your time in tokyo, try to sneak in Afuri. Very interesting ramen. Cured me of death 19:10 <+bridge> [ddnet] oh yeah tell me good places 19:10 <+bridge> [ddnet] I was literally suffering. One sip of the soup and I was cured 19:11 <+bridge> [ddnet] :greenthing: 19:11 <+bridge> [ddnet] If you want to have any fancy food, book ahead. Good omakase places get booked almost a month in advance 19:11 <+bridge> [ddnet] oof 19:11 <+bridge> [ddnet] will check 19:21 <+bridge> [ddnet] can someone explain to me "AND" and "OR"?? AND takes ALL conditions and OR only the selected? 19:22 <+bridge> [ddnet] can someone explain to me "AND" and "OR"?? AND takes all conditions and OR only the selected? 19:24 <+bridge> [ddnet] well, it's just logic stuff 19:24 <+bridge> [ddnet] AND need both right hand side and left hand side to be true 19:24 <+bridge> [ddnet] OR accepts any side to be true 19:25 <+bridge> [ddnet] AND is true if both are true 19:25 <+bridge> [ddnet] OR is true if atleast one is true 19:26 <+bridge> [ddnet] https://en.wikipedia.org/wiki/Truth_table 19:26 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1033431121209331826/unknown.png 19:26 <+bridge> [ddnet] use parenthesis to group stuff and overrides operator precedency 19:45 <+bridge> [ddnet] i feel dumb 19:46 <+bridge> [ddnet] ``` SELECT name, year 19:46 <+bridge> [ddnet] BETWEEN 1990 AND 1996 19:46 <+bridge> [ddnet] FROM movies;``` 19:46 <+bridge> [ddnet] should give me the movies etc. that were made between 1990 and 1996 19:46 <+bridge> [ddnet] but it only shows ALL movies with 1 and 0 as true/false 19:46 <+bridge> [ddnet] i want it to show me ONLY movies that are true and with the year :WEIRD: 19:47 <+bridge> [ddnet] select name, year from movies where year between 1990 and 1996; 19:47 <+bridge> [ddnet] ``` 19:47 <+bridge> [ddnet] SELECT name, year 19:47 <+bridge> [ddnet] BETWEEN 1990 AND 1996 19:47 <+bridge> [ddnet] FROM movies;``` 19:48 <+bridge> [ddnet] selecting β€žyear between 1990 and 1996β€œ means you want to have a column in your output that says if this movie is from this range of years 19:49 <+bridge> [ddnet] ahh okay 19:50 <+bridge> [ddnet] i see now, thank you 19:50 <+bridge> [ddnet] You can try to get some data from the ddnet db 19:54 <+bridge> [ddnet] why does 19:54 <+bridge> [ddnet] 19:54 <+bridge> [ddnet] ``` 19:54 <+bridge> [ddnet] SELECT name, imdb_rating 19:54 <+bridge> [ddnet] from movies 19:54 <+bridge> [ddnet] ORDER BY imdb_rating ASC ``` 19:54 <+bridge> [ddnet] works 19:54 <+bridge> [ddnet] 19:54 <+bridge> [ddnet] but 19:54 <+bridge> [ddnet] ``` 19:54 <+bridge> [ddnet] SELECT name, imdb_rating 19:54 <+bridge> [ddnet] from movies 19:54 <+bridge> [ddnet] ORDER BY imdb_rating > 4.5 ASC ``` 19:54 <+bridge> [ddnet] doesnt? 19:55 <+bridge> [ddnet] it shows me all the right movies, but not in ascending order 19:56 <+bridge> [ddnet] order doesnt filter 19:56 <+bridge> [ddnet] use where imdb_rating > 4.5 ORDER BY imdb_rating ASC 19:56 <+bridge> [ddnet] use ` where imdb_rating > 4.5 ORDER BY imdb_rating ASC` 19:58 <+bridge> [ddnet] got it 20:07 <+bridge> [ddnet] im surprised how good i am on the sql tests on code academy 20:07 <+bridge> [ddnet] even tho im a complete pepega when it comes to coding 20:07 <+bridge> [ddnet] anyone has list of protocol messages with GUIDs? 20:16 <+bridge> [ddnet] i mean this list 20:16 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1033443642813194371/unknown.png 20:19 <+bridge> [ddnet] this ? 20:20 <+bridge> [ddnet] more like this i think 20:28 <+bridge> [ddnet] well sql simple stuff is quite easy 20:28 <+bridge> [ddnet] the hard things are when u have multiple tables, joining them etc 20:29 <+bridge> [ddnet] some sql queries in ddnet are quite big xd 20:29 <+bridge> [ddnet] Ok why do you have to make it bad? :WEIRD: 20:30 <+bridge> [ddnet] my achievements, my pure joy.. destroyed...by you.... 20:32 <+bridge> [ddnet] ```cpp 20:32 <+bridge> [ddnet] str_format(aBuf, sizeof(aBuf), 20:32 <+bridge> [ddnet] "SELECT l.ID, Name, Time, Ranking, PercentRank " 20:32 <+bridge> [ddnet] "FROM (" // teamrank score board 20:32 <+bridge> [ddnet] " SELECT RANK() OVER w AS Ranking, PERCENT_RANK() OVER w AS PercentRank, ID " 20:32 <+bridge> [ddnet] " FROM %s_teamrace " 20:32 <+bridge> [ddnet] " WHERE Map = ? " 20:32 <+bridge> [ddnet] " GROUP BY ID " 20:32 <+bridge> [ddnet] " WINDOW w AS (ORDER BY Min(Time))" 20:32 <+bridge> [ddnet] ") AS TeamRank INNER JOIN (" // select rank with Name in team 20:32 <+bridge> [ddnet] " SELECT ID " 20:32 <+bridge> [ddnet] " FROM %s_teamrace " 20:32 <+bridge> [ddnet] " WHERE Map = ? AND Name = ? " 20:32 <+bridge> [ddnet] " ORDER BY Time " 20:32 <+bridge> [ddnet] " LIMIT 1" 20:32 <+bridge> [ddnet] ") AS l ON TeamRank.ID = l.ID " 20:32 <+bridge> [ddnet] "INNER JOIN %s_teamrace AS r ON l.ID = r.ID ", 20:32 <+bridge> [ddnet] pSqlServer->GetPrefix(), pSqlServer->GetPrefix(), pSqlServer->GetPrefix()); 20:32 <+bridge> [ddnet] ``` 20:32 <+bridge> [ddnet] this is the teamrank query 20:32 <+bridge> [ddnet] most queries are here: 20:32 <+bridge> [ddnet] other than window and the AS statements i do understand it 20:32 <+bridge> [ddnet] :WEIRD: 20:33 <+bridge> [ddnet] well not completely 20:33 <+bridge> [ddnet] :Starege: 20:33 <+bridge> [ddnet] but i do know what they are doing :WEIRD: 20:33 <+bridge> [ddnet] :Starege: 20:33 <+bridge> [ddnet] oh and OVER, i didn't have OVER yet 20:34 <+bridge> [ddnet] OVER is window functions? 20:35 <+bridge> [ddnet] ```sql 20:35 <+bridge> [ddnet] select Name, lll.Map, Time, min(lll.Timestamp), min(Type), Server, max(OldTime), Points, Country from 20:35 <+bridge> [ddnet] ( 20:35 <+bridge> [ddnet] select Name, Map, Time, Timestamp, "2 Top 1 rank" as Type, (select Time from record_race where Map = l.map and Timestamp < "{0}" order by Time limit 1) as OldTime, Country from (select Timestamp, Name, Map, Time, Server as Country from record_race where Timestamp >= "{0}" and Timestamp < "{1}") as l where Time <= (select min(Time) from record_race where Map = l.Map) 20:35 <+bridge> [ddnet] union all 20:35 <+bridge> [ddnet] select record_teamrace.Name, record_teamrace.Map, record_teamrace.Time, record_teamrace.Timestamp, "1 Top 1 team rank" as Type, OldTime, record_race.Server as Country from (select ID, (select Time from record_teamrace where Map = l.Map and ID != l.ID and Timestamp < "{0}" order by Time limit 1) as OldTime from (select distinct ID, Map, Time from record_teamrace where Timestamp >= "{0}" and Timestamp < "{1}") as l left join (select Map, min( 20:35 <+bridge> [ddnet] union all 20:35 <+bridge> [ddnet] select Name, Map, Time, Timestamp, "5 Worst rank on DDNet" as Type, (select Time from record_race where Timestamp < "{0}" and Map != "Time Shop" and Map != "Care for your Time" order by Time desc limit 1) as OldTime, Server as Country from (select * from record_race where Map != "Time Shop" and Map != "Care for your Time" and Time > (select Time from record_race where Timestamp < "{0}" and Map != "Time Shop" and Map != "Care for your Time" 20:35 <+bridge> [ddnet] ) as lll join record_maps on lll.Map = record_maps.Map 20:35 <+bridge> [ddnet] where lll.Map != "Nyan Cat" and record_maps.Server != "Fun" group by Name, Map, Time order by lll.Timestamp, Name asc; 20:35 <+bridge> [ddnet] ``` 20:35 <+bridge> [ddnet] @Kallemy some queries for the website 20:35 <+bridge> [ddnet] xd 20:36 <+bridge> [ddnet] union all 20:36 <+bridge> [ddnet] πŸ§… 20:36 <+bridge> [ddnet] ```sql 20:36 <+bridge> [ddnet] ELECT Name, 20:36 <+bridge> [ddnet] lll.Map, 20:36 <+bridge> [ddnet] TIME, 20:36 <+bridge> [ddnet] min(lll.Timestamp), 20:36 <+bridge> [ddnet] min(TYPE), 20:36 <+bridge> [ddnet] Server, 20:36 <+bridge> [ddnet] max(OldTime), 20:36 <+bridge> [ddnet] Points, 20:36 <+bridge> [ddnet] Country 20:36 <+bridge> [ddnet] FROM 20:36 <+bridge> [ddnet] (SELECT Name, Map, TIME, Timestamp, "2 Top 1 rank" AS TYPE, 20:36 <+bridge> [ddnet] 20:36 <+bridge> [ddnet] (SELECT TIME 20:36 <+bridge> [ddnet] FROM record_race 20:36 <+bridge> [ddnet] WHERE Map = l.map 20:36 <+bridge> [ddnet] AND Timestamp < "{0}" 20:36 <+bridge> [ddnet] ORDER BY TIME 20:36 <+bridge> [ddnet] LIMIT 1) AS OldTime, 20:36 <+bridge> [ddnet] Country 20:36 <+bridge> [ddnet] FROM 20:36 <+bridge> [ddnet] (SELECT Timestamp, Name, Map, TIME, 20:37 <+bridge> [ddnet] Server AS Country 20:37 <+bridge> [ddnet] FROM record_race 20:37 <+bridge> [ddnet] WHERE Timestamp >= "{0}" 20:37 <+bridge> [ddnet] AND Timestamp < "{1}") AS l 20:37 <+bridge> [ddnet] WHERE TIME <= 20:37 <+bridge> [ddnet] (SELECT min(TIME) 20:37 <+bridge> [ddnet] FROM record_race 20:37 <+bridge> [ddnet] WHERE Map = l.Map) 20:37 <+bridge> [ddnet] UNION ALL SELECT record_teamrace.Name, 20:37 <+bridge> [ddnet] i fortmatted it 20:37 <+bridge> [ddnet] `Elect` 20:37 <+bridge> [ddnet] xd 20:37 <+bridge> [ddnet] im learning sql for 2 days now, i'm not gonna be a pro in like those days :weirdL: 20:37 <+bridge> [ddnet] @Kallemy no worries im not a pro either 20:37 <+bridge> [ddnet] the sql pro here is deen 20:38 <+bridge> [ddnet] partitions are a tough thing to figure out 20:38 <+bridge> [ddnet] Yea but let me have my achievements :ANGERY: 20:38 <+bridge> [ddnet] :monkalaugh: 20:38 <+bridge> [ddnet] can't wait for it.... 20:39 <+bridge> [ddnet] when you guys say "tough thing to figure out" for me that's like "yea you will never understand it" 20:39 <+bridge> [ddnet] most of the time u dont need to do complex queries though 20:39 <+bridge> [ddnet] you can, it just takes a bit to click 20:39 <+bridge> [ddnet] if u do a crud app 20:39 <+bridge> [ddnet] inner join outer join blah blah 20:39 <+bridge> [ddnet] groups and partitions are probably the hardest part of sql to begin with 20:40 <+bridge> [ddnet] if you learn to design some tables and do simple queries u are good to go most of the time 20:40 <+bridge> [ddnet] shouldn't the big query be split across multiple queries for easier comprehension? 20:40 <+bridge> [ddnet] and as for design i recommend learning the 20:40 <+bridge> [ddnet] search a tutorial or smth 20:40 <+bridge> [ddnet] its good pratices 20:40 <+bridge> [ddnet] practices* 20:41 <+bridge> [ddnet] to avoid data duplication etc 20:41 <+bridge> [ddnet] first of all, i have to finish my course 20:41 <+bridge> [ddnet] true true 20:41 <+bridge> [ddnet] i'm at 15% WTF 20:41 <+bridge> [ddnet] Oh lord have mercy on my soul 20:41 <+bridge> [ddnet] :Prayge: 20:41 <+bridge> [ddnet] just take ur time 20:41 <+bridge> [ddnet] are you in a hurry? 20:42 <+bridge> [ddnet] Why not BCNF? Sounds like something you'd enjoy πŸ˜› 20:42 <+bridge> [ddnet] people dont rly learn this in 1 month 20:42 <+bridge> [ddnet] No i am not, but it feels SO much 20:42 <+bridge> [ddnet] true 20:42 <+bridge> [ddnet] big chungus normal form 20:42 <+bridge> [ddnet] @cyberfighter 20:42 <+bridge> [ddnet] go all the way 20:42 <+bridge> [ddnet] https://en.wikipedia.org/wiki/Fifth_normal_form 20:43 <+bridge> [ddnet] doesn't look that much tho 20:43 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1033450451405910177/unknown.png 20:43 <+bridge> [ddnet] > A 6NF also exists, but its purpose is not to remove redundancy and it is therefore only adopted by a few data warehouses, where it can be useful to make tables irreducible. 20:43 <+bridge> [ddnet] lol 20:44 <+bridge> [ddnet] at 4 20:44 <+bridge> [ddnet] its when fun starts 20:44 <+bridge> [ddnet] relational stuff shows when you have more than 1 table 20:50 <+bridge> [ddnet] big chungus TRUE form 20:55 <+bridge> [ddnet] you mean it? 20:55 <+bridge> [ddnet] is it actually fun? 20:55 <+bridge> [ddnet] i mean its where the meat is at 20:55 <+bridge> [ddnet] i personally enjoy coding so its fun for me 20:59 <+bridge> [ddnet] i see, looking forward to it 21:11 <+bridge> [ddnet] You might enjoy SQLsmith, example query: https://github.com/yugabyte/yugabyte-db/issues/11371 πŸ˜„ 21:11 <+bridge> [ddnet] xd 21:15 <+bridge> [ddnet] @deen fuzzing for databases? 21:15 <+bridge> [ddnet] :o 21:21 <+bridge> [ddnet] Not coverage-guided, just a random generator 21:25 <+bridge> [ddnet] why don't people split those mega queries? 21:25 <+bridge> [ddnet] is it for performance reason? 21:27 <+bridge> [ddnet] Because the bug might happen as a consequence of combining 10 weird features no one ever used together 21:27 <+bridge> [ddnet] And even if it's just a subset, faster to combine more in one query 21:27 <+bridge> [ddnet] when RustSQL @Ryozuki ? 21:27 <+bridge> [ddnet] Exists already: https://github.com/rustsmith/rustsmith 21:28 <+bridge> [ddnet] xd 21:28 <+bridge> [ddnet] wrong link? fuzzer != database? 21:28 <+bridge> [ddnet] https://github.com/proptest-rs/proptest 21:29 <+bridge> [ddnet] this is also neat 21:29 <+bridge> [ddnet] there is a famous db impl 21:29 <+bridge> [ddnet] in rust 21:29 <+bridge> [ddnet] well lately gaining traction let me find it 21:30 <+bridge> [ddnet] https://surrealdb.com/ 21:30 <+bridge> [ddnet] more here 21:30 <+bridge> [ddnet] https://lib.rs/database-implementations 21:51 <+bridge> [ddnet] yes I once sent a video here from Fireship 21:51 <+bridge> [ddnet] looks promising 21:51 <+bridge> [ddnet] but still new, hope it goes well 22:41 <+bridge> [ddnet] compressing images before adding them to maps does absolutely nothing 22:41 <+bridge> [ddnet] your map will be the same size no matter whether you compress the image before adding or not 22:42 <+bridge> [ddnet] compressed images are not displayed even in the editor 22:51 <+bridge> [ddnet] what do you mean by "compressing" 22:52 <+bridge> [ddnet] https://compresspng.com/ πŸ₯Ί 22:52 <+bridge> [ddnet] editor supports only PNG-24? 22:53 <+bridge> [ddnet] game supports only PNG-24? 22:53 <+bridge> [ddnet] https://github.com/heinrich5991/libtw2/blob/ded871091bb984f0419cac605b85ecf438c6fbcd/gamenet/generate/spec/ddnet-16.2.json this should contain the actual UUIDs as well 22:56 <+bridge> [ddnet] the map format doesn't support PNGs at all. it first takes the PNG and decompresses it. then it applies its own compression. the ddnet client could theoretically load any PNG but we disabled that for compatibility with older clients 22:56 <+bridge> [ddnet] what are you doing with the UUIDs? πŸ™‚ 22:59 <+bridge> [ddnet] doing server side support for DDNET. 22:59 <+bridge> [ddnet] In my C# server mode 22:59 <+bridge> [ddnet] ah, nice πŸ™‚ 23:00 <+bridge> [ddnet] you could theoretically generate the game messages from the JSON I maintain, if you wanted to 23:00 <+bridge> [ddnet] I was able to get the cursor position, thanks to CNetMsg_Cl_ShowDistance, thanks to whoever did this ❀️ 23:00 <+bridge> [ddnet] I use it for the wireshark dissector 23:00 <+bridge> [ddnet] I was able to get the cursor position (with zoom), thanks to CNetMsg_Cl_ShowDistance, thanks to whoever did this ❀️ 23:01 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/1033485251089022997/unknown.png 23:01 <+bridge> [ddnet] I mean that the JSON also has all the fields 23:02 <+bridge> [ddnet] https://github.com/heinrich5991/libtw2/blob/ded871091bb984f0419cac605b85ecf438c6fbcd/gamenet/generate/spec/ddnet-16.2.json#L612-L625 23:02 <+bridge> [ddnet] ```json 23:02 <+bridge> [ddnet] { 23:02 <+bridge> [ddnet] "id": "53bb28af-4252-3ac9-8fd3-6ccbc2a603e3", 23:02 <+bridge> [ddnet] "id_from": { 23:02 <+bridge> [ddnet] "algorithm": "uuid_v3", 23:02 <+bridge> [ddnet] "namespace": "e05ddaaa-c4e6-4cfb-b642-5d48e80c0029", 23:02 <+bridge> [ddnet] "name": "show-distance@netmsg.ddnet.tw" 23:02 <+bridge> [ddnet] }, 23:02 <+bridge> [ddnet] "name": ["cl", "show", "distance"], 23:02 <+bridge> [ddnet] "members": [ 23:02 <+bridge> [ddnet] {"name": ["x"], "type": {"kind": "int32"}}, 23:02 <+bridge> [ddnet] {"name": ["y"], "type": {"kind": "int32"}} 23:02 <+bridge> [ddnet] ], 23:02 <+bridge> [ddnet] "attributes": [] 23:03 <+bridge> [ddnet] } 23:03 <+bridge> [ddnet] ``` 23:25 <+bridge> [ddnet] get payloaded