Instructions: Use 12 Font-Size, Arial and Single Space. Bring Printed It and Send It To
Instructions: Use 12 Font-Size, Arial and Single Space. Bring Printed It and Send It To
Instructions: Use 12 Font-Size, Arial and Single Space. Bring Printed It and Send It To
The basic structure of each query is similar: The first keyword (e.g.,
SELECT) tells the database which operation to carry out; the following
statements refine this statement into specific instructions. These include the
table(s) to adjust/query, the types/values of records to work on, or how to
group the data.
B. BETWEEN
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value_1 AND value_2;
The BETWEEN operator is used to filter the result set within a certain
range. The values can be numbers, text or dates.
C. CASE
SELECT column_name,
HhCASE
WHEN condition THEN 'Result_1'
WHEN condition THEN 'Result_2'
ELSE 'Result_3'
END
FROM table_name;
CASE statements are used to create different outputs (usually in the
SELECT statement). It is SQL’s way of handling if-then logic.
D. COUNT()
SELECT COUNT(column_name)
FROM table_name;
COUNT() is a function that takes the name of a column as an argument
and counts the number of rows where the column is not NULL.
E. DELETE
DELETE FROM table_name
WHERE some_column = some_value;
DELETE statements are used to remove rows from a table.