News for hackers. Stuff that matters.
Re:Show HN: Learn to Code for Free by NicoJuicy on Tuesday November 22, 2016 @07:24PM (#13018903)
Current database:

- When you have multiple layers of "companies" ( in a single table: Company) and every company has employees (table: Employee).

Request:

- List all company employees that have a random company as mother company, including their childs, all layers deep.

So you create a optional integer parentCompanyId on the Company for the inheritance ( that's easy)

How would you go further?

- You may not use a recursion of sql Queries (or in code) to procedurally get the parentCompany or "child companies" of all layers deep.

- You may change the database ( and you may use joins also)

There are no comments on this comment yet.