SHARE
TWEET

Untitled

a guest Apr 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -> WHERE
  2.     -> birthday '1975-01-01' AND '1985-01-01'' at line 2
  3. mysql> SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01';
  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. 8 rows in set (0.00 sec)
  17. mysql> SELECT firstname, birthday  FROM wizard  WHERE firstname  LIKE 'H%';
  18. +-----------+------------+
  19. | firstname | birthday   |
  20. +-----------+------------+
  21. | harry     | 1980-07-31 |
  22. | hermione  | 1979-09-19 |
  23. +-----------+------------+
  24. 2 rows in set (0.00 sec)
  25. mysql> SELECT firstname, lastname
  26.     -> FROM wizard
  27.     -> WHERE lastname LIKE 'Potter';
  28. +-----------+----------+
  29. | firstname | lastname |
  30. +-----------+----------+
  31. | harry     | potter   |
  32. | lily      | potter   |
  33. +-----------+----------+
  34. 2 rows in set (0.00 sec)
  35. mysql> SELECT lastname, firstname, birthday FROM wizard WHERE birthday ORDER BY birthday LIMIT 1;
  36. +------------+-----------+------------+
  37. | lastname   | firstname | birthday   |
  38. +------------+-----------+------------+
  39. | dumbledore | albus     | 1881-07-01 |
  40. +------------+-----------+------------+
  41. 1 row in set (0.00 sec)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top