나는 이렇게 학습한다/Algorithm & SQL

SQL Basics: Simple WHERE and ORDER BY

daco2020 2022. 5. 12. 17:35
반응형

For this challenge you need to create a simple SELECT statement that will return all columns from the people table WHERE their age is over 50

people table schema

  • id
  • name
  • age

You should return all people fields where their age is over 50 and order by the age descending

NOTE: Your solution should use pure SQL. Ruby is used within the test cases to do the actual testing.

 

 

Solution:

SELECT * FROM people WHERE age>50 ORDER BY age DESC

 

 

 

반응형

'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글

SQL Basics: Mod  (0) 2022.05.14
Easy SQL: LowerCase  (0) 2022.05.13
Sum of numbers from 0 to N  (0) 2022.05.11
Round up to the next multiple of 5  (0) 2022.05.10
Find the capitals  (0) 2022.05.09