Pavithra's Space
  • Home
  • Skills
    • SQL
    • HackerRank
      • Revising the Select Query I
      • Revising the Select Query II
      • Select All
      • Select By ID
      • Japanese Cities' Attributes
      • Japanese Cities' Names
      • Weather Observation Station 1
      • Weather Observation Station 3
      • Weather Observation Station 4
      • Weather Observation Station 5
      • Weather Observation Station 6
      • Weather Observation Station 7
      • Weather Observation Station 8
      • Weather Observation Station 9
      • Weather Observation Station 10
      • Weather Observation Station 11
      • Weather Observation Station 12
      • Higher Than 75 Marks
      • Employee Names
      • Employee Salaries
Powered by GitBook
On this page
  1. Skills
  2. HackerRank

Employee Names

PreviousHigher Than 75 MarksNextEmployee Salaries

Last updated 1 year ago

Write a query that prints a list of employee names (i.e.: the name attribute) from the Employee table in alphabetical order.

Sol:

SELECT name FROM Employee ORDER BY name asc;

Explanation:

  • SELECT name: This part of the query specifies that we want to retrieve the values from the name column of the Employee table.

  • FROM Employee: This specifies the table from which we want to retrieve the data, which is the Employee table.

  • ORDER BY name ASC: This part of the query specifies the order in which the results should be sorted. It orders the results in ascending order based on the values in the name column.

Employee Names | HackerRankHackerRank
Logo