/media/sda-magnetic/david/Dok-15-2023-11-27/informatik/www-intel-compute-stick-2022-06-13/068/output01.txt


id@intel-compute-stick:~$ mysql -u root -p 
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1038
Server version: 10.5.12-MariaDB-0+deb11u1 Debian 11

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 test068;
Query OK, 1 row affected (0.002 sec)

MariaDB [(none)]> USE test068;
Database changed
MariaDB [test068]> CREATE TABLE a (n1 INTEGER, n2 INTEGER);
Query OK, 0 rows affected (0.057 sec)

MariaDB [test068]> CREATE TABLE b (n3 INTEGER, n4 INTEGER);
Query OK, 0 rows affected (0.052 sec)

MariaDB [test068]> INSERT INTO a VALUES (0, 0);
Query OK, 1 row affected (0.027 sec)

MariaDB [test068]> INSERT INTO a (n1, n2) VALUES ( 0, 1);
Query OK, 1 row affected (0.028 sec)

MariaDB [test068]> INSERT INTO a (n1, n2) VALUES (1, 0);
Query OK, 1 row affected (0.036 sec)

MariaDB [test068]> INSERT INTO a (n2, n1) VALUES (1, 1);
Query OK, 1 row affected (0.028 sec)

MariaDB [test068]> INSERT INTO a (n1, n2) VALUES (0, 2);
Query OK, 1 row affected (0.029 sec)

MariaDB [test068]> INSERT INTO b (n3, n4) VALUES (0, 1);
Query OK, 1 row affected (0.033 sec)

MariaDB [test068]> INSERT INTO b (n3, n4) VALUES (1, 0);
Query OK, 1 row affected (0.027 sec)

MariaDB [test068]> SELECT * FROM a;
+------+------+
| n1   | n2   |
+------+------+
|    0 |    0 |
|    0 |    1 |
|    1 |    0 |
|    1 |    1 |
|    0 |    2 |
+------+------+
5 rows in set (0.001 sec)

MariaDB [test068]> SELECT * FROM b;
+------+------+
| n3   | n4   |
+------+------+
|    0 |    1 |
|    1 |    0 |
+------+------+
2 rows in set (0.001 sec)

MariaDB [test068]> SELECT * FROM a JOIN b;
+------+------+------+------+
| n1   | n2   | n3   | n4   |
+------+------+------+------+
|    0 |    0 |    0 |    1 |
|    0 |    0 |    1 |    0 |
|    0 |    1 |    0 |    1 |
|    0 |    1 |    1 |    0 |
|    1 |    0 |    0 |    1 |
|    1 |    0 |    1 |    0 |
|    1 |    1 |    0 |    1 |
|    1 |    1 |    1 |    0 |
|    0 |    2 |    0 |    1 |
|    0 |    2 |    1 |    0 |
+------+------+------+------+
10 rows in set (0.001 sec)

MariaDB [test068]> SELECT * FROM a INNER JOIN b ON a.n1 = b.n3;
+------+------+------+------+
| n1   | n2   | n3   | n4   |
+------+------+------+------+
|    0 |    0 |    0 |    1 |
|    0 |    1 |    0 |    1 |
|    1 |    0 |    1 |    0 |
|    1 |    1 |    1 |    0 |
|    0 |    2 |    0 |    1 |
+------+------+------+------+
5 rows in set (0.001 sec)

MariaDB [test068]> SELECT * FROM a LEFT JOIN b ON a.n2 = b.n4;
+------+------+------+------+
| n1   | n2   | n3   | n4   |
+------+------+------+------+
|    0 |    1 |    0 |    1 |
|    1 |    1 |    0 |    1 |
|    0 |    0 |    1 |    0 |
|    1 |    0 |    1 |    0 |
|    0 |    2 | NULL | NULL |
+------+------+------+------+
5 rows in set (0.002 sec)

MariaDB [test068]> SELECT * FROM a RIGHT JOIN b ON a.n2 = b.n4;
+------+------+------+------+
| n1   | n2   | n3   | n4   |
+------+------+------+------+
|    0 |    0 |    1 |    0 |
|    0 |    1 |    0 |    1 |
|    1 |    0 |    1 |    0 |
|    1 |    1 |    0 |    1 |
+------+------+------+------+
4 rows in set (0.002 sec)

MariaDB [test068]> QUIT
Bye
david@intel-compute-stick:~$