DESC
The DESC
command is used to sort the data returned in descending order.
The following SQL statement selects all the columns from the “Customers” table, sorted descending by the “CustomerName” column : Continue reading SQL DESC Keyword
The DESC
command is used to sort the data returned in descending order.
The following SQL statement selects all the columns from the “Customers” table, sorted descending by the “CustomerName” column : Continue reading SQL DESC Keyword
The DEFAULT
constraint provides a default value for a column.
The default value will be added to all new records if no other value is specified.
The following SQL sets a DEFAULT value for the “City” column when the “Persons” table is created:
My SQL / SQL Server / Oracle / MS Access:
CREATE TABLE Persons (
City varchar(255) DEFAULT 'Sandnes'
);
The DEFAULT constraint can also be used to insert system values, by using functions like GETDATE(): Continue reading SQL DEFAULT Keyword
The CREATE DATABASE
command is used is to create a new SQL database.
The following SQL creates a database called “testDB”:
CREATE DATABASE testDB;
Tip: Make sure you have admin privilege before creating any database. Once a database is created, you can check it in the list of databases with the following SQL command: SHOW DATABASES;
The CREATE DATABASE
command is used is to create a new SQL database.
The following SQL creates a database called “testDB”:
CREATE DATABASE testDB;
Tip: Make sure you have admin privilege before creating any database. Once a database is created, you can check it in the list of databases with the following SQL command: SHOW DATABASES;
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 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 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
This SQL keywords reference contains the reserved words in SQL. Continue reading SQL Keywords Reference