String Pattern Matching Using LIKE
Apple ☯️ Medium SQLJoins
Beginner Mode

Objective

Write an SQL query to fetch the names, department names, email addresses, and position levels of employees. The query should filter employees based on the following criteria:

  • Employee names start with the letter 'A'.
  • Employee email addresses contain the substring '@tech'.
  • Employee position levels contain the word 'Senior'.
    The results should be ordered by employee names in ascending order.

Additional information

  • Assume the existence of two tables: employees and departments.
  • The employees table contains the columns: id, name, department_id, email, and position_level.
  • The departments table contains the columns: id, name, and location.
  • Join the two tables on the department_id column from the employees table and the id column from the departments table.
  • The results should only include columns: name, department, email, and position_level.

Constraints:

  • The length of name will be within [1, 100].
  • The length of email will be within [5, 100].
  • The length of position_level will be within [5, 50].
  • The number of rows in the employees and departments tables will not exceed 1000.

Examples

Example 1:

Input:

departments
idlocationname
1NYCEngineering
2SFProduct
3ChicagoSales
employees
department_idemailidnameposition_level
1[email protected]1Alice SmithSenior Developer
2[email protected]2Andrew BrownSenior Manager
1[email protected]3Amanda LeeSenior Architect
1[email protected]4Bob WilsonSenior Developer
3[email protected]5Aaron DavisSenior Executive
2[email protected]6Anna WhiteJunior Developer

Output:
departmentemailnameposition_level
Engineering[email protected]Alice SmithSenior Developer
Engineering[email protected]Amanda LeeSenior Architect
Quick Solution

Code Environment

Sign in or try as guest to run your code.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →