SQLite Exercise: Get unique department ID from employee table
Write a query to get unique department ID from employee table.
Sample table : employees
SQLite Code :
SELECT DISTINCT department_id
FROM employees;
Output:
department_id ------------- 90 60 100 30 50 80 10 20 40 70 110
Relational Algebra Expression:
Relational Algebra Tree:
Practice SQLite Online
Model Database
Structure of 'hr' database :
Improve this sample solution and post your code through Disqus.
Previous: Write a query to display the names (first_name, last_name) using alias name "First Name", "Last Name".
Next: Write a query to get all employee details from the employee table order by first name, descending.
What is the difficulty level of this exercise?
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework