Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What Not To Do With Databases

8a1aabc40d859fcb786eb4d28b95d299?s=47 Tim Perry
November 11, 2014

What Not To Do With Databases

8a1aabc40d859fcb786eb4d28b95d299?s=128

Tim Perry

November 11, 2014
Tweet

More Decks by Tim Perry

Other Decks in Programming

Transcript

  1. None
  2. None
  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. CREATE TABLE Employee ( id int primary key, name varchar(255)

    not null, manager_id int );
  10. SELECT m.name FROM Employee e INNER JOIN Employee m ON

    e.manager_id = m.id WHERE e.id = 100;
  11. WITH RecursiveCte AS ( SELECT e.id, e.name FROM Employee e

    WHERE parent_id = 100 UNION ALL SELECT e.id, e.name FROM Employee e INNER JOIN RecursiveCte rcte ON e.parent_id = rcte.id ) SELECT Name FROM RecursiveCte;
  12. None
  13. MATCH (e { id: 100 })-[:MANAGED_BY]->(m) RETURN m.name;

  14. MATCH (m { id: 100 })<-[:MANAGED_BY*]-(e) RETURN e.name;

  15. MATCH (m { id: 100 })<-[:MANAGED_BY*]-(e) RETURN e.name;

  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. None
  24. None
  25. None
  26. None
  27. None
  28. None