Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions SQL Deep Dive/Order By/questions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
* Table: employees
* Question: Sort employees by first name ascending and last name descending
*/

SELECT first_name,last_name FROM employees
ORDER BY first_name, last_name DESC;

/*
* DB: Employees
* Table: employees
* Question: Sort employees by age
*/


SELECT * FROM EMPLOYEES ORDER BY AGE(birth_date) DESC;
/*
* DB: Employees
* Table: employees
* Question: Sort employees who's name starts with a "k" by hire_date
*/
*/SELECT * FROM employees WHERE first_name ILIKE 'k%' ORDER BY hire_date ASC;