SQL CREATE Keyword

CREATE DATABASE

The CREATE DATABASE command is used is to create a new SQL database.

The following SQL creates a database called “testDB”:

Example

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;

Continue reading SQL CREATE Keyword

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 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