Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. Wyzwanie: Hobby Roberta
  2. INSERT INTO persons (name, age) VALUES ("Ja", 21);
  3. INSERT INTO hobbies (person_id, name) VALUES (5, "tak");
  4.  
  5. SELECT persons.name, hobbies.name FROM persons JOIN hobbies ON persons.id = hobbies.person_id;
  6.  
  7. SELECT persons.name, hobbies.name FROM persons
  8. JOIN hobbies
  9. ON persons.id = hobbies.person_id
  10. WHERE persons.name = "Bobby McBobbyFace";
  11.  
  12. Wyzwanie: Zamówienia klienta
  13. SELECT customers.name, customers.email, orders.item, orders.price
  14. FROM customers
  15. LEFT OUTER JOIN orders ON customers.id = orders.customer_id;
  16.  
  17.  
  18. SELECT name, email, SUM(orders.price) FROM customers
  19. LEFT OUTER JOIN orders
  20. ON customers.id = orders.customer_id
  21. GROUP BY name
  22. ORDER BY orders.price DESC;
  23. SELECT sequel.title,movies.title
  24. FROM movies sequel
  25. LEFT OUTER JOIN movies
  26. ON sequel.sequel_id = movies.id;
  27. SELECT persons.fullname, hobbies.name FROM persons JOIN hobbies ON persons.id = hobbies.person_id;
  28.  
  29. SELECT a.fullname, b.fullname FROM friends
  30. JOIN persons a
  31. ON friends.person1_id = a.id
  32. JOIN persons b
  33. ON friends.person2_id = b.id;
  34. 👍
  35. 1
  36. <script>document.body.innerHTML = "Inconceivable!";</script>
  37. a w pytaniach
  38. od 1
  39. Document Object Model
  40. document
  41. obiekt
  42. document.body.innerHTML = "Khaaaaan";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement