Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Shaggar posted:

they're both retarded cause user.find 10 is probably orming and writes the same sql

this probably doesn't make sense to a j-language person but the nice part about it is it writes the sql and not me

Adbot
ADBOT LOVES YOU

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
you guys should check out perl its good at all this

power botton
Nov 2, 2011

im orming so hard right now

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
ormy taints

uG
Apr 23, 2003

by Ralp

Jonny 290 posted:

you guys should check out perl its good at all this

perl also has one of teh best ORMs of any language

uG
Apr 23, 2003

by Ralp
orming out of control

Shaggar
Apr 26, 2006

Cocoa Crispies posted:

this probably doesn't make sense to a j-language person but the nice part about it is it writes the sql and not me

yes it wrote the bad sql for you but it doesn't matter cause you're using ruby so your slow runtime will always disguise the slowness of your database.

power botton
Nov 2, 2011

write all your bespoke sql then have linqer convert it to linq

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Bloody posted:

what is normalization

http://lmgtfy.com/?q=Database+normalization&l=1

Bloody
Mar 3, 2013


uggghhh that's a lot of sperg about data gently caress nevermind i dont care any more

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
I was starting a care post but then I was like WTF I'm just repeating what wikipedia says and with less pictures :saddowns:

e: it just comes down to organizing your stupid tables to reduce a bunch of lovely side effects that can happen like that first picture on wikipedia. There are different levels of how correct you can make your db with the consensus being that form 3 is good enough and anything above is really spergy but can and probably will gently caress your poo poo up in production but :effort:

Janitor Prime fucked around with this message at 19:01 on Sep 18, 2013

power botton
Nov 2, 2011

if you have a bunch of users and facts about users, and lets say order history, storing it all in one table would lead to you storing the persons name and address and poo poo (number of orders) over again.

splitting order history out into a separate table with a unique user_id to join the data back together when you need it prevents unnecessary duplication.

it gets messy tho

uG
Apr 23, 2003

by Ralp
that image may confuse the person who just bought the anime sql book

Shaggar
Apr 26, 2006
its not messy, its clean. it feels good to look at normalized data

power botton
Nov 2, 2011

developers are bad and don't do it so they turn to nosql garbage with their cute 30 gb of data

Shaggar
Apr 26, 2006
nothing soothes my autism like good data design

power botton
Nov 2, 2011

Shaggar posted:

its not messy, its clean. it feels good to look at normalized data

yes i agree it soothes my autism. but just an example that it can get more complicated that my babby example.

power botton
Nov 2, 2011

lol hi5 shaggar for both our autism being soothed

Shaggar
Apr 26, 2006
:unsmith::hf::unsmith:

Elder Postsman
Aug 30, 2000


i used hot bot to search for "teens"

Shaggar posted:

nothing soothes my autism like good data design

same

it really gets my goat when we get data from a client and it's a god damned mess and we can't do anything about it

jooky
Jan 15, 2003

git clone trooper posted:

if you have a bunch of users and facts about users, and lets say order history, storing it all in one table would lead to you storing the persons name and address and poo poo (number of orders) over again.

splitting order history out into a separate table with a unique user_id to join the data back together when you need it prevents unnecessary duplication.

it gets messy tho



sports

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

Shaggar posted:

nothing soothes my autism like good data design

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy
basically just realize that it's a pain in the rear end to track of the same data stored in multiple places, so you should store one fact in one place. the different normalization levels are deciding what a fact is and how important it is.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

git clone trooper posted:

developers are bad and don't do it so they turn to nosql garbage with their cute 30 gb of data

i use an orm and don't know a lick of SQL but normalized database design just comes naturally. i cannot comprehend doing it another way.

a guy at work has been doing some stuff in filemaker that is pretty useful for business stuff (and would have taken ages to do in something that isn't filemaker). when he started i was telling him about database normalization and he wasn't quite getting it. he told me the other day that one of his tables has 325 fields and he's starting to understand why design is important.

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
to the guy who is trying to learn sql all this stuff comes naturally from practical usage

like the very first principle, I want to store poo poo in a database. you just learned INSERT
extract it back out again. SELECT *.
hmm I should tie users to their posts to the threads they were made in. INNER JOIN baby
most of the forums don't appear in the main listing page. only the forum that has a test thread shows up. LEFT OUTER JOIN that poo poo
and now I have a bunch of copy/pasted sql. that's bad right. you bet it is, time to create some sprocs and functions

power botton
Nov 2, 2011

sql is like babby's first programming language. any dev who can't organize data properly sure as hell can't organize a real codebase.

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
all the people saying normalisation is intuitive aren't bragging either.

if you see duplicated and/or optional data you probably have a problem and want to fix it
think of a (literal) parent-child relationship. maybe the first thing a novice thinks is to add a NULLable "child name" column onto the user table.
won't take long though before you run into issues with that and realise you should have another table with some kind of one-many (or perhaps many-many to be able to model both parents) relationship instead

then the next time you start something you'll do it right first time

Nomnom Cookie
Aug 30, 2009



learn relational algebra first then you can get mad that oracle sql doesnt support antijoins

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
learning relational algebra in uni was an anti-pattern when it came to actually learning how the gently caress joins worked in a real program

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off
I never worked with SQL long enough to develop a good intuition for joins. that'll probably bite me in the rear end someday.

rip.

uG
Apr 23, 2003

by Ralp
i think new people have problem with normalization when it comes to eye balling their tables in phpmyadmin and not seeing all the relevant info just right there like they are used to

Nomnom Cookie
Aug 30, 2009



~Coxy posted:

learning relational algebra in uni was an anti-pattern when it came to actually learning how the gently caress joins worked in a real program

maybe u and or the professor sucked cause for basic ops theres a straightforward mapping from relational algebra to sql

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
probably me but yeah


PleasingFungus posted:

I never worked with SQL long enough to develop a good intuition for joins. that'll probably bite me in the rear end someday.

rip.

worst thing I ever did when I was little is make a timed daemon to insert the correct entries into the database so they would show up from a statements that has too many inner joins

in my defence it was because it used the , join syntax which loving sucks for readability

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

uG posted:

i think new people have problem with normalization when it comes to eye balling their tables in phpmyadmin and not seeing all the relevant info just right there like they are used to
i'm shocked that a php-based tool would have serious shortcomings and make it difficult to comprehend a thing in computing

Bloody
Mar 3, 2013

Cocoa Crispies posted:

i'm shocked that a php-based tool would have serious shortcomings and make it difficult to comprehend a thing in computing

:monocle:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
hey cocoa crispies how do you do testing in cocoa/objc stuff? because i'm partial to ruby i really wanted to get some of the ruby based frameworks working but they all seem to target iOS stuff, which I'm not interested in.

I spent the last day or so messing with frank-cucumber which is cool but it isn't really ready to go on osx

MrMoo
Sep 14, 2000

Does Google like terrible programmers?

a cyberpunk goose
May 21, 2007

MrMoo posted:

Does Google like terrible programmers?

Do bears write python in the woods?

a cyberpunk goose
May 21, 2007

shameful programmer status (sss):

spent an hour today not understanding why my poo poo was crashing at runtime when i tried to delete a pointer

turns out i didn't make the destructor on the base type virtual and so it was invoking undefined behavior

C++

Adbot
ADBOT LOVES YOU

MrMoo
Sep 14, 2000

Mido posted:

Do bears write python in the woods?

Some crazy Googler contacted me for an interview tomorrow so I'll find out.

  • Locked thread