数据库
ojshilu
https://github.com/lucky521
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Leetcode: Second Highest Salary
Write a SQL query to get the second highest salary from the Employee table.+—-+——–+ | Id | Salary | +—-+——–+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +—-+——–+ For example, given the abov原创 2015-03-14 00:00:58 · 834 阅读 · 0 评论 -
Leetcode : Customers Who Never Order
Now we’ve got two table. One customer table for customerid and their names, One Order tablefor customers’ Id that bought something. We will find the customers that in the customer table but not in ord原创 2015-03-15 22:43:40 · 865 阅读 · 0 评论 -
Leetcode: find all duplicate
Leetcode : Duplicate EmailsWrite a SQL query to find all duplicate emails in a table named Person. +—-+———+ | Id | Email | +—-+———+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | +—-+———+原创 2015-03-15 22:27:45 · 935 阅读 · 0 评论 -
Leetcode: Department Highest Salary
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 | Salary | DepartmentId | +—-+——-+——–+————原创 2015-03-19 18:10:41 · 1218 阅读 · 0 评论 -
Leetcode: Consecutive Numbers
Write a SQL query to find all numbers that appear at least three times consecutively. +—-+—–+ | Id | Num | +—-+—–+ | 1 | 1 | | 2 | 1 | | 3 | 1 | | 4 | 2 | | 5 | 1 | | 6 | 2 |原创 2015-03-16 22:20:32 · 880 阅读 · 0 评论 -
Leetcode: 相关子查询
Leetcode : Employees Earning More Than Their Managers+—-+——-+——–+———–+ | Id | Name | Salary | ManagerId | +—-+——-+——–+———–+ | 1 | Joe | 70000 | 3 | | 2 | Henry | 80000 | 4 |原创 2015-03-14 19:01:44 · 825 阅读 · 0 评论 -
Leetcode: Rank Scores
Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. I原创 2015-03-18 21:59:05 · 1105 阅读 · 0 评论
分享