relational database
Database
Customers Who Never Order
Programmer - 0
Suppose that a website contains two tables, the tableCustomers and the tableOrders. Write a SQL query to find all customers who never order anything.
Table:...
Programming Jokes
Employees Earning More Than Their Managers
Programmer - 0
The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.
+----+-------+--------+-----------+
|...
Database
Delete Duplicate Emails
Programmer - 0
Write a SQL query to delete all duplicate email entries in a table named,Person keeping only unique emails based on its smallestId.
+----+------------------+
| Id | Email...
Database
Rising Temperature
Programmer - 0
Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates.
+---------+------------+------------------+
| Id(INT) | Date(DATE) |...
Database
Department Highest Salary
Programmer - 0
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.
+----+-------+--------+--------------+
| Id | Name...
Database
Swap Sex Field
Programmer - 0
Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f...
Database
Combine Two Tables
Programmer - 0
Table: Person
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| PersonId | int |
| FirstName |...
Database
Nth Highest Salary
Programmer - 0
Write a SQL query to get the nth highest salary from the Employee table.
+----+--------+
| Id | Salary |
+----+--------+
| 1 | 100 |
| 2 ...