0% found this document useful (0 votes)
42 views

Querying and Filtering Data in Mysql Table

This document discusses querying and filtering data in MySQL tables using SELECT statements. It covers inserting single and multiple values, viewing data, using DISTINCT, filtering rows with WHERE and comparison operators like =, <, >, <=, >=, <>, AND, OR, and NOT. It also provides examples of using MIN() and MAX() functions to find smallest and largest values.

Uploaded by

Babe Sultana
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Querying and Filtering Data in Mysql Table

This document discusses querying and filtering data in MySQL tables using SELECT statements. It covers inserting single and multiple values, viewing data, using DISTINCT, filtering rows with WHERE and comparison operators like =, <, >, <=, >=, <>, AND, OR, and NOT. It also provides examples of using MIN() and MAX() functions to find smallest and largest values.

Uploaded by

Babe Sultana
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Querying and Filtering data in

MySQL Table
Using MySQL SELECT statement to query
data
• Create a table employees
• Insert Multiple VALUES at a time

• Insert Single Values {Must have same values as attributes number}


• View data from table
• The SELECT DISTINCT statement is used to
return only distinct (different) values.
Filtering rows using MySQL WHERE
• MySQL WHERE for INETEGER type value

• MySQL WHERE for String type value


Using comparison operators

Operator Description
= Equal

•> Greater than


< Less than
>= Greater than or equal
<= Less than or equal
<> Not equal. Note: In some versions of SQL this operator
may be written as !=
Using comparison operators (, <=,>=,
<>)
• Example-1

• Example-2

• MySQL AND operator examples

• MySQL OR operator examples


• MySQL NOT operator examples
• SELECT * FROM employees
WHERE NOT Lastname=‘Rahman';
SQL MIN() and MAX() Functions

• MIN()example
SELECT MIN(salary) AS SmallestPrice FROM
employees;
• Max()example
SELECT Max(salary) AS LargestPrice FROM
employees;

You might also like