随笔分类 -  mysql

摘要: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 | 阅读全文
posted @ 2020-02-13 23:22 hyx1 阅读(127) 评论(0) 推荐(0)
摘要:Write 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 | + + 阅读全文
posted @ 2020-02-12 15:16 hyx1 阅读(93) 评论(0) 推荐(0)
摘要: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 | 阅读全文
posted @ 2020-02-12 14:59 hyx1 阅读(139) 评论(0) 推荐(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. + + + + + | 阅读全文
posted @ 2020-02-12 14:56 hyx1 阅读(126) 评论(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 @ 2020-02-11 19:05 hyx1 阅读(110) 评论(0) 推荐(0)
摘要:Write a SQL query to get the nth highest salary from the Employee table. + + + | Id | Salary | + + + | 1 | 100 | | 2 | 200 | | 3 | 300 | + + + For exa 阅读全文
posted @ 2020-02-11 18:22 hyx1 阅读(117) 评论(0) 推荐(0)
摘要:Write a SQL query to get the second highest salary from the Employee table. + + + | Id | Salary | + + + | 1 | 100 | | 2 | 200 | | 3 | 300 | + + + For 阅读全文
posted @ 2020-02-11 18:05 hyx1 阅读(110) 评论(0) 推荐(0)
摘要:Table: Person + + + | Column Name | Type | + + + | PersonId | int | | FirstName | varchar | | LastName | varchar | + + + PersonId is the primary key c 阅读全文
posted @ 2020-02-11 17:21 hyx1 阅读(120) 评论(0) 推荐(0)