Ad
  • Default User Avatar

    Good challenge, but the description is not very clear. Here's how I think it could be rewritten:

    Presented below is a schema relating toys to a toy factory.

    Table "toy_factory"

    • id[pk]
    • name

    Table "toys"

    • id
    • name
    • factory_id[fk]

    Write a query that returns all the fields in toy_factory, counts the number of toys each factory has made (return the column as 'toy_count'), and groups these counts by the corresponding factory.