Basic SQL Command You Must Know

Creating Database:

CREATE DATABASE Database_name;

Selecting Database:

USE Databasname;

Creating Table:

CREATE TABLE Table_NAME (field1 datatype, field2 datatype,…);

Inserting values in table:

INSERT INTO TABLE- NAME (Fields If Required)

VALUES (values1, values2, values3, …)

See all tables in a DB:

USE Database-name;

SHOW TABLES;

All data in table:

Select*From TABLE_NAME;

View particular data:

SELECT *FROM TABLE-NAME WHERE condition1, condition2, …;

Select substrings:

SELECT* FROM substring(‘abcde’,2, 3);

Leave a Reply

Your email address will not be published.