MySQL keywords are predefined reserved words that form the syntax and logic of SQL commands. They control the behavior of the database and should not be used as identifiers.
Common Uses of MySQL Keywords
- SELECT: Fetches data.
- FROM: Specifies the table.
- WHERE: Filters results.
- AND/OR: Combines conditions.
- DISTINCT: Ensures unique results.
Examples
- SELECT and FROM Keywords
Explanation: Fetches the name column from the employees table.
- WHERE Keyword
Explanation: Filters orders where amount exceeds 100.
- AND/OR Keywords
Explanation: Filters users older than 18 and currently active.
- DISTINCT Keyword
Explanation: Retrieves unique department names from the employees table.
- LIKE Keyword
Explanation: Fetches customers whose names start with "J."
MySQL keywords are predefined reserved words that form the syntax and logic of SQL commands. They control the behavior of the database and should not be used as identifiers.
Common Uses of MySQL Keywords
Examples
Explanation: Fetches the
namecolumn from theemployeestable.Explanation: Filters orders where
amountexceeds 100.Explanation: Filters users older than 18 and currently active.
Explanation: Retrieves unique department names from the
employeestable.Explanation: Fetches customers whose names start with "J."