0% found this document useful (0 votes)
20 views17 pages

SQL IN Operator and Functions Explained

The document explains the SQL IN operator, which is used in the WHERE clause to filter data based on multiple values, making queries more concise. It also discusses events in Advanced Database Systems, ECA rules for automatic responses, and various common functions like UPPER(), ROUND(), and COUNT() that perform specific operations on data. Key takeaways emphasize the readability of queries and the utility of functions in data manipulation.

Uploaded by

kyrie cupido
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views17 pages

SQL IN Operator and Functions Explained

The document explains the SQL IN operator, which is used in the WHERE clause to filter data based on multiple values, making queries more concise. It also discusses events in Advanced Database Systems, ECA rules for automatic responses, and various common functions like UPPER(), ROUND(), and COUNT() that perform specific operations on data. Key takeaways emphasize the readability of queries and the utility of functions in data manipulation.

Uploaded by

kyrie cupido
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

‘IN’

Presented by: Richard Nazario


What is ‘IN’?
• In SQL, the IN operator is a logical operator used in the WHERE
clause to specify multiple values for a column. It acts as a
shorthand for multiple OR conditions, making queries more
concise and readable when you need to filter data based on
a list of potential values.
Basic Syntax
SELECT column_name
FROM table_name
WHERE column_name IN (value1, value2, value3, ...);
→ Filters rows based on a set of possible values.
Example:
SELECT *
FROM employees
WHERE department_id IN (10, 20, 30);
→ Returns employees from departments 10, 20, or 30.
Example: Table

.
Example: Code
Example: Result
Key Takeaways
• IN makes SQL queries shorter and easier to read.
• Use IN when comparing a column to multiple values.
EVENTS
EVENTS
In Advanced Database Systems,

the term “events” refers to

actions or occurrences that

trigger specific responses

within a database system.

These are often associated

with active databases or


ECA RULES
• ECA rules are a key

concept in Active

Database Systems.

• T h e y a l l o w t h e

d a t a b a s e t o

a u t o m a t i c a l l y

respond to specific
EXAMPLE
THANK

YOU
Function: An Overview
A function is a predefined or user-created operation that takes input,

performs a process, and returns a result.


Common String Functions
UPPER()
The function UPPER() converts text into uppercase.

SELECT UPPER('hello world');

-- Result: 'HELLO WORLD'


Numerical Functions
ROUND()
ROUND() rounds a number to a certain number of decimal places.

SELECT ROUND(123.456, 2);

-- Result: 123.46
Aggregate Functions

COUNT()

COUNT() counts the number of rows in the table.

SELECT COUNT(*) FROM employees;

This function is essential for quickly determining the size of a dataset or the number of records that meet specific criteria.

You might also like