MySQL Commands
MySQL Commands
Create Database
Use of database
Use database_name;
Table creation
Example:-
DROP COLUMN
The DROP COLUMN command is used to delete a column in an existing table.
ALTER/MODIFY DATATYPE
ALTER TABLE table_name
MODIFY column_name datatype;
DROP CONSTRAINT
ALTER TABLE Persons
DROP CONSTRAINT UC_Person;
2. If you are adding values for all the columns of the table, you do not need to
specify the column names in the SQL query. However, make sure the order of
the values is in the same order as the columns in the table. Here, the INSERT
INTO syntax would be as follows:
DELETE Syntax
DELETE FROM table_name WHERE condition;
UPDATE Syntax
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
UPDATE Customers
SET ContactName = 'Alfred Schmidt', City= 'Frankfurt'
WHERE CustomerID = 1;
Syntax
SELECT column1, column2, ...
FROM table_name;