SQL ANY Keyword

ANY

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

SQL AND Keyword

AND

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

SQL ALTER TABLE Keyword

ALTER TABLE

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

SQL ALTER COLUMN Keyword

ALTER COLUMN

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

SQL ALTER Keyword

ALTER TABLE

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

SQL ALL Keyword

ALL

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

SQL ADD CONSTRAINT Keyword

ADD CONSTRAINT

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

SQL Data Types for MySQL, SQL Server, and MS Access

The data type of a column defines what value the column can hold: integer, character, money, date and time, binary, and so on.


SQL Data Types

Each column in a database table is required to have a name and a data type.

An SQL developer must decide what type of data that will be stored inside each column when creating a table. The data type is a guideline for SQL to understand what type of data is expected inside of each column, and it also identifies how SQL will interact with the stored data.

Note: Data types might have different names in different database. And even if the name is the same, the size and other details may be different! Always check the documentation!

Continue reading SQL Data Types for MySQL, SQL Server, and MS Access