Author: Jaime M. Shaker
Email: [email protected]
Website: https://www.shaker.dev
LinkedIn: https://www.linkedin.com/in/jaime-shaker/
❗ If you find this repository helpful, please consider giving it a ⭐. Thanks! ❗
❗ Note ❗
This repository contains entry-level SQL interview questions that appear in many interview preperation resources found online.
All solutions were coded using PostgreSQL.
- How do you find duplicates in a table?
- How do you delete multiple entries from a table?
- What is the difference between union and union all?
- What is the difference between rank,row_number and dense_rank?
- Find records in a table which are not present in another table.
- Find second highest salary employees in each department.
- Find employees with greater salaries than their manager's salary.
- What is the difference between an inner and left join?
- Update a table and swap gender values.
- Number of records in output with different kinds of join.
- What is the difference between the DELETE, TRUNCATE and DROP statements?
- What is the difference between the NOW() and CURRENT_DATE functions?
- What is the difference between the ‘IN’ and ‘BETWEEN’ condition operators?
- What is the difference between the WHERE and the HAVING clause?
- From a table of names, write a query that only returns EVEN number rows.
- How can we copy the contents of one table to a new table?
- In string pattern matching, what is the difference between LIKE and ILIKE?
- What are Aggregate and Scalar functions in an RDBMS and can you provide an example of their use?
- How can you calculate the MEDIAN of a numerical field?
- Display two different methods to concatnate strings in PostgreSQL.
- How can we get the Year (month, day hour, etc...) from a timestamp?
- Produce a query that only returns the top 50% of the records.
- How can you insert a new row into a table OR update the row if it already exists?
- What is the use of the COALESCE() function?
- Is the COALESCE() function the same as the NULLIF() function?