Advertisement
NellyIvanova29

04.11.2021

Nov 4th, 2021
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.95 KB | None | 0 0
  1.  
  2. Setting environment for using XAMPP for Windows.
  3. nelly@NELLYIVANOVA c:\xampp
  4. # chcp 866
  5. Active code page: 866
  6.  
  7. nelly@NELLYIVANOVA c:\xampp
  8. # mysql -uroot
  9. Welcome to the MariaDB monitor. Commands end with ; or \g.
  10. Your MariaDB connection id is 16
  11. Server version: 10.4.21-MariaDB mariadb.org binary distribution
  12.  
  13. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  14.  
  15. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  16.  
  17. MariaDB [(none)]> create database personal;
  18. Query OK, 1 row affected (0.003 sec)
  19.  
  20. MariaDB [(none)]> use personal;
  21. Database changed
  22. MariaDB [personal]> create table personal(
  23. -> number CHAR (5) NOT NULL,
  24. -> name VARCHAR (16) NOT NULL,
  25. -> famname VARCHAR (16) NOT NULL,
  26. -> date DATE ,
  27. -> hours INT NOT NULL,
  28. -> departament VARCHAR (20) NOT NULL,
  29. -> insurance VARCHAR(3) NOT NULL,
  30. -> familystatus VARCHAR (10) NOT NULL);
  31. Query OK, 0 rows affected (0.027 sec)
  32.  
  33. MariaDB [personal]> personal(primary key number);
  34. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'personal(primary key number)' at line 1
  35. MariaDB [personal]> ALTER TABLE personal
  36. -> ADD [COLUMN] gender CHAR (1) NOT NULL [AFTER familyname];
  37. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[COLUMN] gender CHAR (1) NOT NULL [AFTER familyname]' at line 2
  38. MariaDB [personal]>
  39. MariaDB [personal]> ALTER TABLE personal
  40. -> ADD gender CHAR (1) NOT NULL [AFTER familyname];
  41. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[AFTER familyname]' at line 2
  42. MariaDB [personal]> ALTER TABLE personal(
  43. -> ADD gender CHAR (1) NOT NULL [AFTER familyname]);
  44. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(
  45. ADD gender CHAR (1) NOT NULL [AFTER familyname])' at line 1
  46. MariaDB [personal]> ALTER TABLE personal
  47. -> ADD [COLUMN] gender CHAR (1) NOT NULL [AFTER famname];
  48. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[COLUMN] gender CHAR (1) NOT NULL [AFTER famname]' at line 2
  49. MariaDB [personal]> ALTER TABLE personal
  50. -> ADD [COLUMN] gender CHAR (1) [AFTER famname];
  51. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[COLUMN] gender CHAR (1) [AFTER famname]' at line 2
  52. MariaDB [personal]> ALTER TABLE personal
  53. -> ADD COLUMN gender CHAR(1) AFTER famname;
  54. Query OK, 0 rows affected (0.019 sec)
  55. Records: 0 Duplicates: 0 Warnings: 0
  56.  
  57. MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12564", "иван", " Атанасов", "м", 2007-09-20, 40, "маркетинг","да", "женен");
  58. Query OK, 1 row affected, 7 warnings (0.025 sec)
  59.  
  60. MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12565", "Мария", " Иванова", "ж", 2008-07-15, 30, "маркетинг","да", "омъжена");
  61. Query OK, 1 row affected, 7 warnings (0.009 sec)
  62.  
  63. MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12566", "Петър", " Петров", "м", 2003-04-14, 30, "мениджмънд","да", "несемеен");
  64. Query OK, 1 row affected, 7 warnings (0.009 sec)
  65.  
  66. MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12567", "Петя", " Георгиева", "ж", 2002-05-02, 30, "счетоводство","да", "омъжена");
  67. Query OK, 1 row affected, 7 warnings (0.009 sec)
  68.  
  69. MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12568", "Николина", " Димитрова", "ж", 2006-04-06, 20, "счетоводство","да", "несемейна");
  70. Query OK, 1 row affected, 7 warnings (0.007 sec)
  71.  
  72. MariaDB [personal]> select * from personal where famname="Димитров" or famname="Димитрова"м
  73. -> ;
  74. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?' at line 1
  75. MariaDB [personal]> select * from personal where famname="Димитров" or famname="Димитрова";
  76. Empty set (0.012 sec)
  77.  
  78. MariaDB [personal]> select* from personal;
  79. +--------+----------+------------+--------+------------+-------+--------------+-----------+--------------+
  80. | number | name | famname | gender | date | hours | departament | insurance | familystatus |
  81. +--------+----------+------------+--------+------------+-------+--------------+-----------+--------------+
  82. | 12564 | ???? | ?тан?сов | ? | 0000-00-00 | 40 | ??ркетин? | ?? | ????? |
  83. | 12565 | ????? | ??????? | ? | 0000-00-00 | 30 | ??ркетин? | ?? | ??ъже?? |
  84. | 12566 | ????? | ???ров | ? | 0000-00-00 | 30 | ???????ънд | ?? | ??сем??? |
  85. | 12567 | ???? | ???рги??? | ? | 0000-00-00 | 30 | ???тов???тво | ?? | ??ъже?? |
  86. | 12568 | ???????? | ?????ров? | ? | 0000-00-00 | 20 | ???тов???тво | ?? | ??сем???? |
  87. +--------+----------+------------+--------+------------+-------+--------------+-----------+--------------+
  88. 5 rows in set (0.007 sec)
  89.  
  90. MariaDB [personal]>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement