- To connect to MySql server
mysql -u Username -h Hostname -p
mysql -u retail_user -h ms.itversity.com -p
- To get all databases available in MySql server
SHOW databases;
- To connect to retail database
USE retail_db;
- To get all tables in database
SHOW tables;
- To get first 10 rows from orders table.
SELECT * FROM orders LIMIT 10;
- To connect to nyse database
USE nyse;
- To get first 10 rows of data from tables available.
SELECT * FROM stock_eod LIMIT 10;
SELECT * FROM stocks_eod LIMIT 10;
- To list columns in the table.
DESCRIBE stock_eod;
DESCRIBE stocks_eod;