Advertisement
Guest User

Untitled

a guest
Jan 19th, 2023
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. CREATE TABLE `employee` (
  2. `id` INT UNSIGNED AUTO_INCREMENT NOT NULL,
  3. `name` VARCHAR(255) DEFAULT NULL,
  4. `surname` VARCHAR(255) DEFAULT NULL,
  5. `retired` TINYINT(1) DEFAULT NULL,
  6. PRIMARY KEY(`id`)
  7. ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
  8.  
  9.  
  10. "START TRANSACTION";
  11.  
  12.  
  13. insert into `employee` (
  14. `id`, `name`, `surname`, `retired`
  15. )
  16. values
  17. (1, 'Oliver', 'Smith', 0);
  18.  
  19.  
  20. insert into `employee` (
  21. `id`, `name`, `surname`, `retired`
  22. )
  23. values
  24. (2, 'Jack', 'Williams', 1);
  25.  
  26.  
  27. insert into `employee` (
  28. `id`, `name`, `surname`, `retired`
  29. )
  30. values
  31. (3, 'Harry', 'Taylor', 1);
  32.  
  33.  
  34. insert into `employee` (
  35. `id`, `name`, `surname`, `retired`
  36. )
  37. values
  38. (4, 'Charlie', 'Lee', 0);
  39.  
  40.  
  41. "COMMIT";
  42.  
  43.  
  44. select
  45. *
  46. from
  47. (
  48. select
  49. 'žlutý_😀' `❤`
  50. ) `🚀`
  51. where
  52. `❤` = 'žlutý_😀'
  53. group by
  54. `🚀`.`❤`
  55. having
  56. (`❤` = 'žlutý_😀');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement