-
【leetcode-数据库】Swap Salary 交换工资
摘要:给定一个工资表,如下所示,m=男性 和 f=女性 。交换所有的 f 和 m 值(例如,将所有 f 值更改为 m,反之亦然)。要求使用一个更新查询,并且没有中间临时表。 例如: | id | name | sex | salary | | | | | | | 1 | A | m | 2500 | |
阅读全文
-
【leetcode-数据库】有趣的电影
摘要:某城市开了一家新的电影院,吸引了很多人过来看电影。该电影院特别注意用户体验,专门有个 LED显示板做电影推荐,上面公布着影评和相关电影描述。 作为该电影院的信息部主管,您需要编写一个 SQL查询,找出所有影片描述为非 boring (不无聊) 的并且 id 为奇数 的影片,结果请按等级 rating
阅读全文
-
【leetcode-数据库】Classes More Than 5 Students 课程学生数大于5
摘要:There is a table courses with columns: student and class Please list out all classes which have more than or equal to 5 students. For example, the tab
阅读全文
-
【leetcode-数据库】Big Countries 大国
摘要:There is a table World A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million. Write a SQL solu
阅读全文
-
【leetcode-数据库】Rising Temperature 查询温度升高的id
摘要:Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. 给了一个温度表,找出温度比前一天
阅读全文
-
【leetcode-数据库】删除重复邮箱
摘要:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. + + + | Id | Ema
阅读全文
-
【leetcode-数据库】从不订购的客户
摘要:假设一个网站包含两个表,Customers 表和 Orders 表。编写一个SQL语句找出所有从不订购任何东西的客户。 表名: Customers。 + + + | Id | Name | + + + | 1 | Joe | | 2 | Henry | | 3 | Sam | | 4 | Max |
阅读全文
-
【leetcode-数据库】第二高薪水
摘要:写一个 SQL 查询语句,获取 Employee 表中第二高的Salary 。 + + + | Id | Salary | + + + | 1 | 100 | | 2 | 200 | | 3 | 300 | + + + 例如, 上面给出的 Employee 表,查询应该返回 200 作为第二高的Sa
阅读全文
|