Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Setting environment for using XAMPP for Windows.
- nelly@NELLYIVANOVA c:\xampp
- # chcp 866
- Active code page: 866
- nelly@NELLYIVANOVA c:\xampp
- # mysql -uroot
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 16
- Server version: 10.4.21-MariaDB mariadb.org binary distribution
- Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- MariaDB [(none)]> create database personal;
- Query OK, 1 row affected (0.003 sec)
- MariaDB [(none)]> use personal;
- Database changed
- MariaDB [personal]> create table personal(
- -> number CHAR (5) NOT NULL,
- -> name VARCHAR (16) NOT NULL,
- -> famname VARCHAR (16) NOT NULL,
- -> date DATE ,
- -> hours INT NOT NULL,
- -> departament VARCHAR (20) NOT NULL,
- -> insurance VARCHAR(3) NOT NULL,
- -> familystatus VARCHAR (10) NOT NULL);
- Query OK, 0 rows affected (0.027 sec)
- MariaDB [personal]> personal(primary key number);
- 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
- MariaDB [personal]> ALTER TABLE personal
- -> ADD [COLUMN] gender CHAR (1) NOT NULL [AFTER familyname];
- 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
- MariaDB [personal]>
- MariaDB [personal]> ALTER TABLE personal
- -> ADD gender CHAR (1) NOT NULL [AFTER familyname];
- 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
- MariaDB [personal]> ALTER TABLE personal(
- -> ADD gender CHAR (1) NOT NULL [AFTER familyname]);
- 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 '(
- ADD gender CHAR (1) NOT NULL [AFTER familyname])' at line 1
- MariaDB [personal]> ALTER TABLE personal
- -> ADD [COLUMN] gender CHAR (1) NOT NULL [AFTER famname];
- 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
- MariaDB [personal]> ALTER TABLE personal
- -> ADD [COLUMN] gender CHAR (1) [AFTER famname];
- 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
- MariaDB [personal]> ALTER TABLE personal
- -> ADD COLUMN gender CHAR(1) AFTER famname;
- Query OK, 0 rows affected (0.019 sec)
- Records: 0 Duplicates: 0 Warnings: 0
- MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12564", "иван", " Атанасов", "м", 2007-09-20, 40, "маркетинг","да", "женен");
- Query OK, 1 row affected, 7 warnings (0.025 sec)
- MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12565", "Мария", " Иванова", "ж", 2008-07-15, 30, "маркетинг","да", "омъжена");
- Query OK, 1 row affected, 7 warnings (0.009 sec)
- MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12566", "Петър", " Петров", "м", 2003-04-14, 30, "мениджмънд","да", "несемеен");
- Query OK, 1 row affected, 7 warnings (0.009 sec)
- MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12567", "Петя", " Георгиева", "ж", 2002-05-02, 30, "счетоводство","да", "омъжена");
- Query OK, 1 row affected, 7 warnings (0.009 sec)
- MariaDB [personal]> INSERT INTO personal (number, name, famname, gender, date, hours, departament, insurance, familystatus) VALUES("12568", "Николина", " Димитрова", "ж", 2006-04-06, 20, "счетоводство","да", "несемейна");
- Query OK, 1 row affected, 7 warnings (0.007 sec)
- MariaDB [personal]> select * from personal where famname="Димитров" or famname="Димитрова"м
- -> ;
- 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
- MariaDB [personal]> select * from personal where famname="Димитров" or famname="Димитрова";
- Empty set (0.012 sec)
- MariaDB [personal]> select* from personal;
- +--------+----------+------------+--------+------------+-------+--------------+-----------+--------------+
- | number | name | famname | gender | date | hours | departament | insurance | familystatus |
- +--------+----------+------------+--------+------------+-------+--------------+-----------+--------------+
- | 12564 | ???? | ?тан?сов | ? | 0000-00-00 | 40 | ??ркетин? | ?? | ????? |
- | 12565 | ????? | ??????? | ? | 0000-00-00 | 30 | ??ркетин? | ?? | ??ъже?? |
- | 12566 | ????? | ???ров | ? | 0000-00-00 | 30 | ???????ънд | ?? | ??сем??? |
- | 12567 | ???? | ???рги??? | ? | 0000-00-00 | 30 | ???тов???тво | ?? | ??ъже?? |
- | 12568 | ???????? | ?????ров? | ? | 0000-00-00 | 20 | ???тов???тво | ?? | ??сем???? |
- +--------+----------+------------+--------+------------+-------+--------------+-----------+--------------+
- 5 rows in set (0.007 sec)
- MariaDB [personal]>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement