Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

SQL Conditional Statements

10

Flashcards

0/10

Still learning
StarStarStarStar

AND

StarStarStarStar

The AND operator is used to combine multiple conditions in a WHERE clause. Example: SELECT * FROM Users WHERE firstName = 'John' AND lastName = 'Doe';

StarStarStarStar

CASE

StarStarStarStar

The CASE statement is used to create different outputs based on conditions. Example: SELECT CASE WHEN Age < 18 THEN 'Minor' WHEN Age >= 18 THEN 'Adult' END FROM Customers;

StarStarStarStar

IN

StarStarStarStar

The IN operator allows you to specify multiple values in a WHERE clause. Example: SELECT * FROM Customers WHERE Country IN ('Germany', 'France', 'UK');

StarStarStarStar

IS NULL

StarStarStarStar

The IS NULL operator is used to test for empty fields in a column. Example: SELECT * FROM Customers WHERE FirstName IS NULL;

StarStarStarStar

LIKE

StarStarStarStar

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. Example: SELECT * FROM Customers WHERE Country LIKE 'S%';

StarStarStarStar

NULL

StarStarStarStar

The NULL keyword is used to test for empty values in a column. Example: SELECT * FROM Customers WHERE PostalCode IS NULL;

StarStarStarStar

SELECT ... WHERE

StarStarStarStar

The WHERE clause is used to filter records that fulfill a specified condition. Example: SELECT * FROM Users WHERE age > 30;

StarStarStarStar

OR

StarStarStarStar

The OR operator is used to filter records where at least one of the conditions is true. Example: SELECT * FROM Users WHERE firstName = 'John' OR firstName = 'Jane';

StarStarStarStar

BETWEEN

StarStarStarStar

The BETWEEN operator selects values within a given range. Example: SELECT * FROM Products WHERE price BETWEEN 10 AND 20;

StarStarStarStar

NOT

StarStarStarStar

The NOT operator is used to negate a condition. Example: SELECT * FROM Customers WHERE NOT Country='Germany';

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.