- Command to get list of tables
SHOW tables;
- Command to get meta-data on table
DESCRIBE daily_revenue;
- Command to connect to my sql
mysql -u retail_user -h ms.itversity.com -p
- Command to get list of databases
show databases;
- Command to connect to a database
USE retail_export;
- Command to create table
CREATE TABLE training_daily_revenue (order_date VARCHAR(25) PRIMARY KEY,revenue FLOAT);
- To validate table
SELECT * FROM training_daily_revenue;
- Command to drop table using sqoop eval
sqoop eval --connect jdbc:mysql://ms.itversity.com:3306/retail_export --username retail—user --password itversity --query "DROP TABLE training_daily_revenue"
- Command to create table using sqoop eval
sqoop eval --connect jdbc:mysql://ms.itversity.com:3306/retail_export --username retail_user --password itversity --query "CREATE TABLE training_daily_revenue (order_date VARCHAR(25) PRIMARY KEY,revenue FLOAT)"
- To validate table using sqoop eval
sqoop eval --connect jdbc:mysql --username retail_user --password itversity --query "DESCRIBE training_daily_revenue"
Durga Gadiraju
209.Creating Table in MySQL
- March 16, 2023
- , 11:45 am
- , Uncategorized