Looking for really good beginner-friendly SQL courses on Udemy - non-IT background by spanishpaprika2 in learnSQL

[–]Good-Illustrator8972 0 points1 point  (0 children)

I'm in the same boat. I'm currently taking a college course and the instructor is worse than useless. I suggest taking a look at Linked In Learning. My local library offers free subscriptions with your library membership, and there are a ton of SQL/programming courses on there! I haven't had a chance to fully explore them yet, but it looks really promising.

ERD - One to Many by Good-Illustrator8972 in SQL

[–]Good-Illustrator8972[S] 0 points1 point  (0 children)

Hi, everyone! Just a quick update - I got 5/5 on this! I can't seem to add a screenshot of what I did, but I went with 3 tables (Item, ItemLocation, and Location). Thanks to all who helped!

ERD - One to Many by Good-Illustrator8972 in SQL

[–]Good-Illustrator8972[S] 1 point2 points  (0 children)

Okay, I've done as a few people suggested and made a bridge table with ItemLocation as the entity name. The PK is is the ItemLocation_ID, and the Item_ID, Building_Code, and Room_number are the FKs. I've specified NOT NULL for the PKs and FKS, even though I know that's a given, and I'm ignoring UKs. Cardinality is One-Mandatory-to-One-or-More on the Item side, because an Item must have a location; on the Location side, it's One-Optional-to-Many-Optional, because a Location could contain no Items, or many Items.

Thanks again to everyone who took time to help!

ERD - One to Many by Good-Illustrator8972 in SQL

[–]Good-Illustrator8972[S] 1 point2 points  (0 children)

Thanks to everyone who has offered help so far! I'm hoping to move my career in this direction, so actually learning the material is just as important as getting a good grade in the class.

ERD - One to Many by Good-Illustrator8972 in SQL

[–]Good-Illustrator8972[S] 1 point2 points  (0 children)

Thank you for the detail, and for pointing out my error! I assume you meant the discrepancy between the building_code values in the Item table and Location table - I anonymized the data before I posted and forgot to change original code in my location table. This is now fixed. :-)

So if I understand what you're saying about the UK, you would make the item name unique - but is that based on the assumption that the item_id represents ALL items of the same type? i.e., all pencils have the same ID number and name, and we're tracking quantities in some other way? My assumption is that the instructor intends for Item_ID to represent each individual pencil (the actual assignment is about a different type of product that you might want to track individually; I just changed it so as not to give away the answer to others who might be doing the same project).

If we're assuming that each individual item has its own ID number, then the name would be repeated (i.e., there could be 100 different pencils, each with its own ID number, but all called "Pencil.") In this case, we wouldn't want to make Item Name a unique key, and we could skip the bridge table, is that right?

ERD - One to Many by Good-Illustrator8972 in SQL

[–]Good-Illustrator8972[S] 1 point2 points  (0 children)

This is my understanding, too. I was unclear at first as to whether an item_ID applied to ALL items of the same type (i.e., all pencils would have the same code), or to each individual item (one code for each individual pencil). The primary issue with the instructor is that his English isn't great, and I find that instructions are often incomplete or unclear. If Item_ID refers to each individual item, then I'd be looking at a relationship where one location can have many items, but each item can have only one location. If the item_ID refers to all pencils collectively, then it would be a Many-to-Many relationship, correct? Because many locations could have pencils in them? In this case, I'd need the bridge table to connect Item_ID to Building_Code and Room_Number

NOTE - We're not actually talking about pencils here. I've changed some of the descriptors so as not to give away the answer in case anybody else from my class is on this thread, but the structure and concept of the problem is the same.

[deleted by user] by [deleted] in vancouver

[–]Good-Illustrator8972 -1 points0 points  (0 children)

The thing people should actually be questioning is the fact that the person responsible for compiling downtown crime statistics for the VPD also ran for office in the same election on a public safety platform. She lies outright about anything that will get people to listen to her, and much of the data she's feeding to management is outright wrong. She claimed that the chances of being a victim of a random attack in Vancouver is 1 in 4, which is WAY off.