mysql
Goofiness
这个作者很懒,什么都没留下…
展开
-
Duplicate Emails
Duplicate Emails Write a SQL query to find all duplicate emails in a table named Person. Example ±—±--------+ | Id | Email | ±—±--------+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | ±—±---...原创 2019-03-29 17:23:35 · 95 阅读 · 0 评论 -
[LeetCode]Swap Salary
Swap Salary SQL Schema 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 values to m and vice versa) with a single update s...原创 2019-04-23 17:15:11 · 95 阅读 · 0 评论 -
Second Highest Salary
Second Highest Salary Write a SQL query to get the second highest salary from the Employee table. Example ±—±-------+ | Id | Salary | ±—±-------+ | 1 | 100 | | 2 | 200 | | 3 | 300 | ±—±...原创 2019-04-03 11:09:55 · 105 阅读 · 0 评论 -
Consecutive Numbers
Consecutive Numbers Write a SQL query to find all numbers that appear at least three times consecutively. Example ±—±----+ | Id | Num | ±—±----+ | 1 | 1 | | 2 | 1 | | 3 | 1 | | 4 | 2 | ...原创 2019-04-03 10:18:06 · 237 阅读 · 0 评论 -
Rising Temperature
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. Example ±--------±-----------------±--------...原创 2019-04-09 09:32:31 · 130 阅读 · 0 评论 -
Department Highest Salary
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. Example ±—±------±-------±-------------+ | Id...原创 2019-04-08 14:23:06 · 142 阅读 · 0 评论 -
Rank Scores
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 in...原创 2019-04-08 13:52:50 · 107 阅读 · 1 评论 -
Delete Duplicate Emails
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. Example ±—±-----------------+ | Id | Em...原创 2019-04-02 11:27:44 · 180 阅读 · 0 评论 -
Customers Who Never Order
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 anything. Table: Customers. ±—±...原创 2019-04-02 11:00:40 · 128 阅读 · 1 评论 -
Department Top Three Salaries
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. ±—±------±-------±-------------+ | Id | Name | Salar...原创 2019-04-11 11:28:00 · 155 阅读 · 0 评论 -
Nth Highest Salary
Nth Highest Salary Write a SQL query to get the nth highest salary from the Employee table. ±—±-------+ | Id | Salary | ±—±-------+ | 1 | 100 | | 2 | 200 | | 3 | 300 | ±—±-------+ Soluti...原创 2019-04-01 14:15:21 · 188 阅读 · 0 评论 -
Exchange Seats
Exchange Seats Mary is a teacher in a middle school and she has a table seat storing students’ names and their corresponding seat ids. The column id is continuous increment. Mary wants to change seat...原创 2019-04-10 11:05:16 · 372 阅读 · 0 评论 -
Employees Earning More Than Their Managers
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. Example ±—±-----...原创 2019-04-10 10:05:16 · 84 阅读 · 0 评论 -
Trips and Users
Trips and Users The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users table. Status is an ENUM type of (‘co...原创 2019-04-04 10:19:52 · 130 阅读 · 0 评论 -
深入研究mysql
一.安装与认识 部分命令为链接文件 不经外部网络的unix域套接字 TCP https://blog.csdn.net/qq_38950316/article/details/81087809 连接管理:缓存线程、SSL安全套接字 解析优化:查询缓存(任何不同都会导致无法命中;查询里有任何系统函数、表、用户自定义变量,将不会缓存;表结构或数据被修改,任何缓存立即失效)语法解析 查询优化(修改...原创 2019-05-05 09:12:01 · 359 阅读 · 0 评论