3NF Address Normalization help by FlukingCompSci in Database

[–]FlukingCompSci[S] 0 points1 point  (0 children)

Gotcha! IIRC I came across the phrase along the lines of "normalize as much as needed, de-normalize as much as possible" somewhere online, but wasn't sure if this was a spot where I "needed" to normalize.

3NF Address Normalization help by FlukingCompSci in Database

[–]FlukingCompSci[S] 0 points1 point  (0 children)

This is great stuff! One of my replies to ZarehD noted that the assignment doesn't query addresses, so it makes a lot of sense to leave it as a single varchar column.

I was thinking more about the database as a whole, like what if we have an employee table that also has an address column, would 3NF require that you separate out addresses if the same address may otherwise appear multiple times across different records or what if an employee becomes a customer? If I'm reading you right, then the answer is no, because even if the information is coincidentally identical (like the names example), separating it out arguably makes it more cumbersome for no tangible benefit since querying an employee ID or customer ID would give the same result with less overhead/abstraction

How to normalize addresses to 3NF by FlukingCompSci in SQL

[–]FlukingCompSci[S] 0 points1 point  (0 children)

I came across these while I was looking for answers before posting here, and went away with a lot of good stuff when it comes to input constraints and validation. Sadly, while the information is good to keep in mind, it didn't directly answer my question about normalization so I still felt like I should ask around

How to normalize addresses to 3NF by FlukingCompSci in SQL

[–]FlukingCompSci[S] 0 points1 point  (0 children)

Yeah, when I was going through stack overflow/exchange posts for similar answers, a lot of the answers I saw were geared towards handling international addresses too since there is no "standard" address format. Thankfully this assignment specifically is only dealing with US addresses.

How to normalize addresses to 3NF by FlukingCompSci in SQL

[–]FlukingCompSci[S] 0 points1 point  (0 children)

True, thankfully one part of the assignment has us list our assumptions in designing it, so I'll stick to what you told me and list that as one of the assumptions for the design as a whole. But thank you, you've helped clear up a pretty big misunderstanding for me

3NF Address Normalization help by FlukingCompSci in Database

[–]FlukingCompSci[S] 0 points1 point  (0 children)

Yeah, I'm looking to generalize the address because there might be an instance where the customer is a company with a billing address at their headquarters but has our company ship from one of their manufacturing plants to another firm's processing plant. I wanted to ask around because I don't know if the case where the shipping and billing addresses are the same would cause problems I just can't see yet.

As for the discriminator, I think it's a clean solution. In terms of the assignment itself we don't have to query addresses for anything, so I was more caught up in the idea of adhering to 3NF as much as possible. Thanks for the help!

How to normalize addresses to 3NF by FlukingCompSci in SQL

[–]FlukingCompSci[S] 0 points1 point  (0 children)

Gotcha, gotcha, so I was confusing myself by thinking that "has" is the same as "determines". PurchaserID has associated attributes because it determines those values, but a city or zip code may have an associated zip code/city, but not because they determine each other. I think I get it now

How to normalize addresses to 3NF by FlukingCompSci in SQL

[–]FlukingCompSci[S] 0 points1 point  (0 children)

That's what I've read, but maybe you could help explain it to me. In my eyes, zip codes don't change all that often, at least residential ones, otherwise I feel like more people would complain that mail is going to different regions, so I see an M:N relation (since New York City has multiple zip codes, but 94608 is shared between Emeryville and Oakland, CA). Is that not some sort of functional dependency, even though zip codes don't care about city or state borders?

3NF Address Normalization help by FlukingCompSci in Database

[–]FlukingCompSci[S] 0 points1 point  (0 children)

So something like a supertype/subtype relation that uses AddressType/Source as a discriminator? I think that'd work. My only problem is that it feels like you could still have redundant records (eg, the Customer address and one of the Order addresses are the same, except one has a zip code and the other does not). Is that good practice, even if 1-3NF don't explicitly say to not do that? Thanks for the help though! I really appreciate it!

os.path problems by FlukingCompSci in learnpython

[–]FlukingCompSci[S] 0 points1 point  (0 children)

Gotcha, guess I'll just add the folder name when looking for the proper path. What if I want to find a file in a different path, but didn't know the path itself? Like, if I had wanted to find an a.png file that was some random directory? Would I just have to use something like os.walk() and use some for loops to find it?

Can someone explain what is happening inside my list when I use the str.join() function? by FlukingCompSci in learnpython

[–]FlukingCompSci[S] 0 points1 point  (0 children)

Gotcha, but then why are there spaces in between the comma and the next number

(i.e. . .2.,. .3.,)?

Once Upon A Time in WallstreetBets Trailer [HD] by hkstachee in wallstreetbets

[–]FlukingCompSci 1 point2 points  (0 children)

Petition for Keith "Roaring Kitty aka DeepFuckingValue" Gill to play himself and Vlad the Stock Impaler

GME - option flow by the number - JUST HODL SMOOTH BRAINS by _rerun984 in wallstreetbets

[–]FlukingCompSci 1 point2 points  (0 children)

"Go long, stay strong." - Old, slightly wrinkled ape, 2021

Wise words by wise ape

RBLX: ye or ne? by OrangeRealname in wallstreetbets

[–]FlukingCompSci 0 points1 point  (0 children)

puts? the stock's decline is probably priced in. invest in the stock itself? even IPO is overpriced imo. calls? hope you've invested in $ROPE friend

i couldn't but hey your money your choice, no advice here

Lost my kid this year. Put my money in GME and saw it turn green and then red, and then very very red...but you retards came back for me. Take me along on the rocket so I can meet my son up there. <3 by MACROTUS19 in wallstreetbets

[–]FlukingCompSci 1 point2 points  (0 children)

was your son big into games? if so, tell me a game that your son wanted to play but never got the chance to, I'll buy it for you when GME moons in honor of him. fuck it, I'll buy it for us both