YogenGhodke
7/3/2019 - 9:45 AM

Terminal Commands in SQL

CREATE DATABASE yg;
DROP DATABASE yg;                   -- Deletion
DROP TABLE yg;

SHOW DATABASES;                     --  Displays list of Existing DBs
SHOW TABLES;                        --  List of Tables
 
-- Show name, type, key of each column of each table
SHOW COLUMNS FROM tablename;
--Or
DESC tablename;

USE yg;                            -- Switches to Database yg
SELECT DATABASE();                 -- Prints the Current DB name

SHOW WARNINGS;                      -- Displays errors