0% found this document useful (0 votes)
4 views5 pages

Apply Filters To SQL Queries

This project demonstrates the use of SQL to investigate security issues related to login attempts and employee machines. It involves retrieving data through various filters using AND, OR, and NOT operators to identify failed logins, specific dates, locations outside of Mexico, and employees in different departments. The objective is to showcase practical experience in querying a database effectively.

Uploaded by

Oscar Desiderio
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)
4 views5 pages

Apply Filters To SQL Queries

This project demonstrates the use of SQL to investigate security issues related to login attempts and employee machines. It involves retrieving data through various filters using AND, OR, and NOT operators to identify failed logins, specific dates, locations outside of Mexico, and employees in different departments. The objective is to showcase practical experience in querying a database effectively.

Uploaded by

Oscar Desiderio
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
You are on page 1/ 5

Apply filters to SQL queries

Project description
This project illustrates a scenario where some potential security issues that involve login
attempts and employee machines were discovered and need to be investigated using SQL. I
retrieved specific pieces of information from the organization database by filtering for
multiple conditions. I also filtered for items that do not match a particular condition. The
following are the steps I took to complete this task:

Retrieve after hours failed login attempts


First, I retrieved all failed login attempts after business hours. Here I used the AND operator to
test for multiple conditions. The First condition is that login attempts returned must be after
18:00. The second condition is that the login attempt returns the value zero, indicating that
the login attempt failed.
Retrieve login attempts on specific dates
Second, I retrieved all login attempts that occurred on specific dates. Here I needed to use the
OR operator to test if the login attempt occurred on ’2022-05-09’ or ‘2022–05-08’.

Retrieve login attempts outside of Mexico


Third, I retrieved logins that didn't originate in Mexico. For this inquiry I used the NOT operator
to return all items that did not originate in Mexico. Additionally, when referring to Mexico, the
‘country’ column contained values of both MEX and MEXICO, so I needed to use the LIKE
keyword with % to make sure my query reflected this.

Retrieve employees in Marketing


Fourth, I retrieved information about certain employees in the Marketing department. Here I
needed to test for multiple conditions so I used the AND operator. I needed to retrieve the
information from the department and office columns in the employee table. Additionally, I
used the LIKE and % operators to retrieve names of employees that work in office buildings like
‘East-170’ or ‘East-320’.
Retrieve employees in Finance or Sales
Fifth, I retrieved information about employees in the Finance or the Sales department. Here I
needed to use the OR operator to return employees in either the Finance department or the
Sales department.

Retrieve all employees not in IT


Finally, I obtained information about employees who are not in the Information Technology
department. Here I used the NOT operator to return employees that are not in this
department.
Summary
The objective of the activity above was to demonstrate practical experience using SQL by
running SQL queries to retrieve information from a database and applying AND, OR, and NOT
operators to filter SQL queries.

You might also like