📊
Data Mining Techniques
  • Introduction to Text Mining Applications
    • Text Mining in Marketing
    • Text Mining in Healthcare
    • Text Mining in Finance
    • Solution Comparison
    • Conclusion
  • Introduction to Data Mining
    • Getting Started
    • Preprocessing text data
      • Activity Preprocessing for Text Mining
  • Feature Extraction
  • Text Classification
    • Naive Bayes Algorithm, Support Vector, Decision Tree Algorithm
  • Scalable Pattern Discovery
    • Advantages Limitations of Techniques
    • Algorithms for Pattern Discovery
  • Techniques for Data Mining
  • Pattern Evaluation Metrics
  • Database Management System
    • Retrieving specific data using SELECT statements
      • Activity
    • Identify the tables that need to be joined in the SQL query
    • Determine the common column(s) between the tables
    • Retrieving data from multiple tables using JOIN
  • How to Use Join Query
  • Some useful Queries
Powered by GitBook
On this page
  1. Database Management System

Retrieving specific data using SELECT statements

SELECT * FROM employees WHERE department = 'IT';

This query will return all rows where the department is 'IT'.

Using comparison operators in WHERE clause

You can use various comparison operators in the WHERE clause to filter the data more precisely. Common comparison operators are:

  • = (Equal)

  • != or <> (Not equal)

  • < (Less than)

  • > (Greater than)

  • <= (Less than or equal to)

  • >= (Greater than or equal to)

For example, you can retrieve all employees with a salary greater than 50000 using the following query:

SELECT * FROM employees WHERE salary > 50000;

Using logical operators in WHERE clause

To further refine your data retrieval, you can use logical operators in the WHERE clause. The logical operators are:

  • AND: Both conditions must be true for the row to be included in the result set.

  • OR: At least one of the conditions must be true for the row to be included in the result set.

  • NOT: The condition must be false for the row to be included in the result set.

For example, you can retrieve all employees who have a salary greater than 50000 and work in the 'IT' department using the following query:

SELECT * FROM employees WHERE salary > 50000 AND department = 'IT';

Using the LIKE operator to search for specific patterns

Sometimes, you need to search for specific patterns in the data. In such cases, you can use the LIKE operator in the WHERE clause. The LIKE operator allows you to use wildcard characters to match different patterns:

  • %: Represents zero, one, or multiple characters.

  • _: Represents a single character.

For example, you can retrieve all employees whose first name starts with 'J' using the following query:

SELECT * FROM employees WHERE first_name LIKE 'J%';

Similarly, you can retrieve all employees whose last name has exactly three characters using the following query:

SELECT * FROM employees WHERE last_name LIKE '___';

In conclusion, using SQL SELECT statements along with the WHERE clause, comparison operators, logical operators, and the LIKE operator allows you to effectively retrieve specific data from a database. By mastering these techniques, you'll be able to efficiently manage and analyze your data in a Database Management System.

PreviousPattern Evaluation MetricsNextActivity

Last updated 1 year ago