ASC
The ASC
command is used to sort the data returned in ascending order.
The following SQL statement selects all the columns from the “Customers” table, sorted by the “CustomerName” column: Continue reading SQL ASC Keyword
The ASC
command is used to sort the data returned in ascending order.
The following SQL statement selects all the columns from the “Customers” table, sorted by the “CustomerName” column: Continue reading SQL ASC Keyword
The AS
command is used to rename a column or table with an alias.
An alias only exists for the duration of the query.
The following SQL statement creates two aliases, one for the CustomerID column and one for the CustomerName column: Continue reading SQL AS Keyword
The ANY
command returns true if any of the subquery values meet the condition.
The following SQL statement returns TRUE and lists the productnames if it finds ANY records in the OrderDetails table where quantity = 10: Continue reading SQL ANY Keyword
The AND
command is used with WHERE to only include rows where both conditions is true.
The following SQL statement selects all fields from “Customers” where country is “Germany” AND city is “Berlin”: Continue reading SQL AND Keyword
The ALTER TABLE
command adds, deletes, or modifies columns in a table.
The ALTER TABLE
command also adds and deletes various constraints in a table.
The following SQL adds an “Email” column to the “Customers” table: Continue reading SQL ALTER TABLE Keyword
The ALTER COLUMN
command is used to change the data type of a column in a table.
The following SQL changes the data type of the column named “BirthDate” in the “Employees” table to type year: Continue reading SQL ALTER COLUMN Keyword
The ALTER TABLE
command adds, deletes, or modifies columns in a table.
The ALTER TABLE
command also adds and deletes various constraints in a table.
The following SQL adds an “Email” column to the “Customers” table: Continue reading SQL ALTER Keyword
The ALL
command returns true if all of the subquery values meet the condition.
The following SQL statement returns TRUE and lists the productnames if ALL the records in the OrderDetails table has quantity = 10: Continue reading SQL ALL Keyword
The ADD CONSTRAINT
command is used to create a constraint after a table is already created.
The following SQL adds a constraint named “PK_Person” that is a PRIMARY KEY constraint on multiple columns (ID and LastName): Continue reading SQL ADD CONSTRAINT Keyword
The ADD
command is used to add a column in an existing table. Continue reading SQL ADD Keyword