The ppt is part of the YouTube Video on SQL. https://youtu.be/1oL9o3SZ1bA
The SQL Video teaches you and also shows you example of the usage of ALTER TABLE, SELECT DISTINCT and WHERE commands in SQL command line.
2. ALTER TABLE
• The ALTER TABLE statement is used to add, delete, or modify
columns in an existing table.
• The ALTER TABLE statement is also used to add and drop
various constraints on an existing table.
• ADD COLUMN
• DROP COLUMN
• ALTER/MODIFY COLUMN
3. ADD
COLUM
N
• ALTER TABLE table_name ADD column_name
datatype;
Syntax:
• ALTER TABLE Customers ADD Email
varchar(255);
Example:
4. DROP
COLUM
N
• ALTER TABLE table_name
DROP COLUMN
column_name;
Syntax:
• ALTER TABLE Customers
DROP COLUMN Email;
Example:
5. ALTER
COLUM
N
• ALTER TABLE table_name
ALTER COLUMN
column_name datatype;
Syntax:
• ALTER TABLE Persons
ALTER COLUMN DateOfBirth
year;
Example:
6. SELECT DISTINCT
• The SELECT DISTINCT statement is used to return only distinct
(different) values.
• Inside a table, a column often contains many duplicate values;
and sometimes you only want to list the different (distinct)
values.
Syntax:
SELECT DISTINCT column1, column2, ... FROM
table_name;
Example:
7. WHERE
• The WHERE clause is used to filter records.
• It is used to extract only those records that fulfill a specified
condition.
Syntax:
SELECT column1, column2, ... FROM table_name
WHERE condition;
Example:
SELECT * FROM Customers WHERE Country='Mexico';
SELECT * FROM Customers WHERE CustomerID=1;