MoN Nov. 27

Data Modeling

9 – 12h Teaching

Goals

  • I understand the term "Data Modeling" and can explain the difference between Conceptual, Logical and Physical Data Models
  • I know the difference between relational and non-relational databases / systems
  • I have successfully modeled my first places & movies data structures

https://002.powercoders.org/matthias-hueni/curriculum/gdi-intro-databases/class1.html

Resources

Exercise - Modeling Places

In this exercise, you'll model two places for storage in a reviews website like Yelp, Google Local, or Foursquare.

PAIR UP and don't worry about getting JSON exactly right - the important part is "name" : "value".

If you get stuck trying to read something you wrote, here's a JSON Parser that will organize things for you.

Ask yourself these questions:

  • What properties do each of these places have? An address? A name?
  • How are they different?
  • What makes them different in the same way? (like type: grocery store, or pub, or coffee shop)
  • What information is useful, vs not useful? (phone numbers are useful, but number of bricks isn't. Unless you are building a national brick database.)
  • What is someone looking for when they look up information about this thing? What am I looking for?

12 – 13.30h Lunch

13.30 – 17h Coaching

Exercise - Modeling Movies

Making movies takes lots of relationships - Actors, Producers, Studios - we don't want to duplicate data, so let's form some relationships!

  • First, create a new file - call it movies.json
  • Start with three arrays with four or more objects -
Movies = [{}, {}, {}, {}]
Actors = [{}, {}, {}, {}]
Studios = [{}, {}, {}, {}]
  • We're going to model four different movies!
  • These share actors, so we're going to assign an ID to each actor, studio, and movie.
  • In each movie there are lots of actors - list only the top-billed actors for simplicity's sake. Create an array to hold just the IDs of the actors.
  • Reference the ID of the actor you want to name by looking in your list of actors, and using the ID field.
  • Do the same for the studios- reference them by ID (but you don't have to use an array)
  • Try to simplify the studios - don't distinguish between Universal Studios and Universal Studios France. We're not IMDB :)