LeetCode Department Top Three Salaries

The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id. +----+-------+--------+-------...

2015-04-13 19:47:44

阅读数:618

评论数:0

LeetCode Nth Highest Salary

Write a SQL query to get the nth highest salary from the Employee table. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 | 200 ...

2015-04-12 22:58:46

阅读数:423

评论数: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 nu...

2015-04-12 18:43:33

阅读数:474

评论数:0

Postgresql 自增语句

如果只是简单地从1开始,递增值为1,可以这样写,serail是一种特殊的类型: 往Employee中添加值及其结果: 如果想设置更加详细的项,比如起始、递增值、最大值、最小值,可以定义一个sequence。 在sequence中,如果是no minvalue、no maxva...

2015-04-12 18:07:36

阅读数:692

评论数:0

LeetCode OJ Consecutive Numbers

Write a SQL query to find all numbers that appear at least three times consecutively. +----+-----+ | Id | Num | +----+-----+ | 1 | 1 | | 2 | 1 ...

2015-04-12 15:51:24

阅读数:570

评论数: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. +----+-------+------...

2015-04-12 15:21:01

阅读数:560

评论数:0

LeetCode OJ Employees Earning More Than Their Managers

The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. +----+--...

2015-04-12 14:29:12

阅读数:578

评论数:0

LeetCode Customers Who Never Order

Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anyth...

2015-04-12 14:08:18

阅读数:557

评论数:0

LeetCode Delete Duplicate Emails

Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. +----+------...

2015-04-12 12:19:47

阅读数:926

评论数:0

LeetCode Rising Temperature

Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. +---------+-...

2015-04-12 10:59:28

阅读数:802

评论数:0

LeetCode Second Highest Salary

Write a SQL query to get the second highest salary from the Employee table. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 | 20...

2015-04-11 22:50:15

阅读数:590

评论数:0

LeetCode OJ Combine Two Tables

Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId | int | | FirstName | varchar | | Las...

2015-04-11 19:48:45

阅读数:478

评论数:0

LeetCode OJ Duplicate Emails

Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Email | +----+---------+ | 1 | a@b.com | | 2 | c@...

2015-04-11 17:00:46

阅读数:398

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭