Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. #request 1
  2. select * from wizard where birthday BETWEEN '1975-01-01' AND '1985-12-31';
  3.  
  4. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  5. | id | firstname | lastname | birthday | birth_place | biography | is_muggle |
  6. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  7. | 1 | harry | potter | 1980-07-31 | london | | 0 |
  8. | 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
  9. | 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
  10. | 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
  11. | 6 | fred | weasley | 1978-04-01 | | | 0 |
  12. | 7 | george | weasley | 1978-04-01 | | | 0 |
  13. | 10 | drago | malefoy | 1980-06-05 | | | 0 |
  14. | 14 | dudley | dursley | 1980-06-23 | | Cousin d'Harry | 1 |
  15. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  16.  
  17. #request 2
  18. select firstname from wizard where firstname like 'H%';
  19.  
  20. +-----------+
  21. | firstname |
  22. +-----------+
  23. | harry |
  24. | hermione |
  25. +-----------+
  26.  
  27. # request 3
  28. SELECT firstname,lastname FROM wizard WHERE lastname="Potter" ORDER BY firstname asc;
  29.  
  30. +-----------+----------+
  31. | firstname | lastname |
  32. +-----------+----------+
  33. | harry | potter |
  34. | lily | potter |
  35. +-----------+----------+
  36.  
  37. #request 4
  38. select firstname,lastname,birthday from wizard order by birthday asc limit 1;
  39.  
  40. +-----------+------------+------------+
  41. | firstname | lastname | birthday |
  42. +-----------+------------+------------+
  43. | albus | dumbledore | 1881-07-01 |
  44. +-----------+------------+------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement