Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01';
  2. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  3. | id | firstname | lastname | birthday | birth_place | biography | is_muggle |
  4. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  5. | 1 | harry | potter | 1980-07-31 | london | | 0 |
  6. | 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
  7. | 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
  8. | 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
  9. | 6 | fred | weasley | 1978-04-01 | | | 0 |
  10. | 7 | george | weasley | 1978-04-01 | | | 0 |
  11. | 10 | drago | malefoy | 1980-06-05 | | | 0 |
  12. | 14 | dudley | dursley | 1980-06-23 | | Cousin d'Harry | 1 |
  13. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  14. 8 rows in set (0.00 sec)
  15.  
  16.  
  17. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  18.  
  19.  
  20. mysql> SELECT * FROM wizard WHERE firstname LIKE 'h%';
  21. +----+-----------+----------+------------+-------------+------------------------+-----------+
  22. | id | firstname | lastname | birthday | birth_place | biography | is_muggle |
  23. +----+-----------+----------+------------+-------------+------------------------+-----------+
  24. | 1 | harry | potter | 1980-07-31 | london | | 0 |
  25. | 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
  26. +----+-----------+----------+------------+-------------+------------------------+-----------+
  27. 2 rows in set (0.00 sec)
  28.  
  29. mysql>
  30.  
  31.  
  32.  
  33. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  34. mysql> SELECT * FROM wizard WHERE lastname LIKE 'potter%';
  35. +----+-----------+----------+------------+-------------+------------------------+-----------+
  36. | id | firstname | lastname | birthday | birth_place | biography | is_muggle |
  37. +----+-----------+----------+------------+-------------+------------------------+-----------+
  38. | 1 | harry | potter | 1980-07-31 | london | | 0 |
  39. | 3 | lily | potter | 1960-01-30 | | mother of Harry Potter | 0 |
  40. +----+-----------+----------+------------+-------------+------------------------+-----------+
  41. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  42.  
  43.  
  44. mysql> SELECT lastname,firstname,birthday FROM wizard ORDER BY birthday ASC LIMIT 1;
  45. +------------+-----------+------------+
  46. | lastname | firstname | birthday |
  47. +------------+-----------+------------+
  48. | dumbledore | albus | 1881-07-01 |
  49. +------------+-----------+------------+
  50. 1 row in set (0.05 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement