Last active
June 11, 2019 20:43
-
-
Save david-mart/84d2d39cb9205a4aca737dea0a7ffa16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> show databases; | |
+ - - - - - - - - - - + | |
| Database | | |
+ - - - - - - - - - - + | |
| products | | |
| users_and_orders | | |
+ - - - - - - - - - - + | |
mysql> show tables in users_and_orders; | |
+----------------------------+ | |
| Tables_in_users_and_orders | | |
+----------------------------+ | |
| order | | |
| user | | |
+----------------------------+ | |
mysql> show tables in products; | |
+--------------------+ | |
| Tables_in_products | | |
+--------------------+ | |
| product | | |
+--------------------+ | |
mysql> select * from users_and_orders.user; | |
+----+-----------------+ | |
| id | name | | |
+----+-----------------+ | |
| 1 | Jamie Lannister | | |
| 2 | Jon Snow | | |
+----+-----------------+ | |
mysql> select * from users_and_orders.order; | |
+----+---------+---------------------+ | |
| id | user_id | order_date | | |
+----+---------+---------------------+ | |
| 1 | 1 | 2019-05-10 07:00:00 | | |
| 2 | 1 | 2019-05-11 07:00:00 | | |
| 3 | 1 | 2019-05-12 07:00:00 | | |
| 4 | 1 | 2019-05-13 07:00:00 | | |
| 5 | 1 | 2019-06-01 07:00:00 | | |
| 6 | 1 | 2019-06-03 07:00:00 | | |
+----+---------+---------------------+ | |
mysql> select * from products.product; | |
+----+----------+------------+ | |
| id | order_id | name | | |
+----+----------+------------+ | |
| 1 | 1 | oathkeeper | | |
| 2 | 1 | longclaw | | |
| 3 | 1 | needle | | |
+----+----------+------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment