Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Using RELATED for tables

Hi,   In one of Udemy's example exams, there is a question about two tables - SALES and CITY DATA. They look as following:   City data State (citydata) city Population (million)       ...
  • bcdobbs's avatar
    4 years ago

    Looking at the tables:

    Sales is at the state granularity.

    The city table is at the city granularity so each state there has multiple cities. Eg it might look like:

     

    StateCity
    A1
    A2
    A3
    B4
    B5
    B6
    C7
    C8

     

    (Note City is unique but State is repeated).

     

    You can join state to state between the tables but it will be many to many not 1 to many.

     

    RELATED as you're aware only gets data from the 1 side of a 1 to many relationship.