摘要: The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id. The Department table holds all dep 阅读全文
posted @ 2016-03-22 15:55 练子 阅读(242) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to find all numbers that appear at least three times consecutively. For example, given the above Logs table, 1 is the only number th 阅读全文
posted @ 2016-03-22 15:53 练子 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 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 num 阅读全文
posted @ 2016-03-22 15:49 练子 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to get the nth highest salary from the Employee table. For example, given the above Employee table, the nth highest salary where n = 阅读全文
posted @ 2016-03-21 18:36 练子 阅读(163) 评论(0) 推荐(0) 编辑
摘要: The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id. The Department table hol 阅读全文
posted @ 2016-03-21 18:35 练子 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. For example, aft 阅读全文
posted @ 2016-03-21 18:33 练子 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. For example, ret 阅读全文
posted @ 2016-03-21 18:31 练子 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Table: Person Table: Address Write a SQL query for a report that provides the following information for each person in the Person table, regardless if 阅读全文
posted @ 2016-03-21 18:27 练子 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 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 anything 阅读全文
posted @ 2016-03-21 18:23 练子 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to find all duplicate emails in a table named Person. For example, your query should return the following for the above table: CREAT 阅读全文
posted @ 2016-03-21 18:21 练子 阅读(121) 评论(0) 推荐(0) 编辑