Professional Documents
Culture Documents
user@DESKTOP-3GSP4U4 c:\xampp
# mysql -h localhost -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.4.28-MariaDB mariadb.org binary distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [gest_student]>
MariaDB [gest_student]>
MariaDB [gest_student]> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| gest_student |
| information_schema |
| library |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
+--------------------+
7 rows in set (0.001 sec)
MariaDB [library]> insert into issue values (3,2,now()), (4,4, now()), (5,
5,now());
Query OK, 3 rows affected (0.003 sec)
Records: 3 Duplicates: 0 Warnings: 0
MariaDB [library]> select book_name, accession_num,DOI from books INNER JOIN issue
on books.accession_num= issue.accession_num;
ERROR 1052 (23000): Column 'accession_num' in field list is ambiguous
MariaDB [library]> select book_name, accession_num, DOI from books INNER JOIN
issue;
ERROR 1052 (23000): Column 'accession_num' in field list is ambiguous
MariaDB [library]>
MariaDB [library]> select book_name, accession_num,DOI from books OUTER JOIN issue
on books.accession_num= issue.accession_num;
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 'OUTER
JOIN issue on books.accession_num= issue.accession_num' at line 1
MariaDB [library]> SELECT Customers.CustomerName, Orders.OrderID
-> FROM Customers
-> FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID
-> ORDER BY Customers.CustomerName;
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 'OUTER
JOIN Orders ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customer...' at line 3
MariaDB [library]> select books.book_name, books.accession_num, issue.DOI from
books full outer join orders on books.accession_num = issue.accession_num;
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 'outer
join orders on books.accession_num = issue.accession_num' at line 1
MariaDB [library]> select books.book_name, books.accession_num, issue.DOI from
books full outer joinissue on books.accession_num = issue.accession_num;
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 'outer
join issue on books.accession_num = issue.accession_num' at line 1
MariaDB [library]> select books.book_name, books.accession_num, issue.DOI from
books outer join issue on books.accession_num = issue.accession_num;
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 'outer
join issue on books.accession_num = issue.accession_num' at line 1
MariaDB [library]> select book_name, accession_num, DOI from books outer join issue
on books.accession_num = issue.accession_num;
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 'outer
join issue on books.accession_num = issue.accession_num' at line 1
MariaDB [library]> select books.book_name, books.accession_num, issue.DOI from
books inner join issue on books.accession_num = issue.accession_num;
+-----------+---------------+---------------------+
| book_name | accession_num | DOI |
+-----------+---------------+---------------------+
| kirikou | 1 | 2023-12-08 16:32:14 |
| tokoos | 3 | 2023-12-08 16:32:14 |
| blanche | 2 | 2023-12-08 16:33:10 |
| afrique | 4 | 2023-12-08 16:33:10 |
| peuple | 5 | 2023-12-08 16:33:10 |
+-----------+---------------+---------------------+
5 rows in set (0.001 sec)
MariaDB [library]> se