Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. +----+-----------+------------+------------+-------------+-------------------------------------------------------------+-----------+
  2. | id | firstname | lastname | birthday | birth_place | biography | is_muggle |
  3. +----+-----------+------------+------------+-------------+-------------------------------------------------------------+-----------+
  4. | 1 | harry | potter | 1980-07-31 | london | | 0 |
  5. | 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
  6. | 3 | lily | potter | 1960-01-30 | | mother 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. | 8 | arthur | weasley | 1950-02-06 | | | 0 |
  12. | 9 | molly | weasley | 1949-01-01 | | | 0 |
  13. | 10 | drago | malefoy | 1980-06-05 | | | 0 |
  14. | 11 | albus | dumbledore | 1881-07-01 | | | 0 |
  15. | 12 | severus | rogue | 1960-01-09 | | | 0 |
  16. | 13 | tom | jédusor | 1926-12-31 | | Celui-Dont-On-Ne-Doit-Pas-Prononcer-Le-Nom alias Voldermort | 0 |
  17. | 14 | dudley | dursley | 1980-06-23 | | Cousin d'Harry | 1 |
  18. +----+-----------+------------+------------+-------------+-------------------------------------------------------------+-----------+
  19.  
  20. mysql> SELECT firstname, birthday FROM wizard WHERE lastname='Potter';
  21.  
  22. +-----------+------------+
  23. | firstname | birthday |
  24. +-----------+------------+
  25. | harry | 1980-07-31 |
  26. | lily | 1960-01-30 |
  27. +-----------+------------+
  28.  
  29. SELECT birthday , lastname, firstname FROM wizard ORDER BY birthday ASC LIMIT 0,1;
  30.  
  31. +------------+------------+-----------+
  32. | birthday | lastname | firstname |
  33. +------------+------------+-----------+
  34. | 1881-07-01 | dumbledore | albus |
  35. +------------+------------+-----------+
  36.  
  37. SELECT * FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-12-31';
  38. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  39. | id | firstname | lastname | birthday | birth_place | biography | is_muggle |
  40. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  41. | 1 | harry | potter | 1980-07-31 | london | | 0 |
  42. | 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
  43. | 4 | ron | weasley | 1980-03-01 | | Best friend of Harry | 0 |
  44. | 5 | ginny | weasley | 1981-08-11 | | Sister of Ron and girlfriend of Harry | 0 |
  45. | 6 | fred | weasley | 1978-04-01 | | | 0 |
  46. | 7 | george | weasley | 1978-04-01 | | | 0 |
  47. | 10 | drago | malefoy | 1980-06-05 | | | 0 |
  48. | 14 | dudley | dursley | 1980-06-23 | | Cousin d'Harry | 1 |
  49. +----+-----------+----------+------------+-------------+---------------------------------------+-----------+
  50.  
  51. SELECT * FROM wizard WHERE firstname LIKE 'H%';
  52.  
  53.  
  54. +----+-----------+----------+------------+-------------+------------------------+-----------+
  55. | id | firstname | lastname | birthday | birth_place | biography | is_muggle |
  56. +----+-----------+----------+------------+-------------+------------------------+-----------+
  57. | 1 | harry | potter | 1980-07-31 | london | | 0 |
  58. | 2 | hermione | granger | 1979-09-19 | | Friend of Harry Potter | 0 |
  59. +----+-----------+----------+------------+-------------+------------------------+-----------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement