Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ferrewagner/leetcode
https://github.com/ferrewagner/leetcode
algorithms database leetcode mysql python
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ferrewagner/leetcode
- Owner: FerreWagner
- Created: 2018-06-28T08:54:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-03T03:41:22.000Z (over 6 years ago)
- Last Synced: 2024-11-09T07:40:13.654Z (2 months ago)
- Topics: algorithms, database, leetcode, mysql, python
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# LeetCode Problems #
----------
1. Database
> Easy627. Swap Salary
update salary set sex = if(sex = 'm', 'f', 'm')
596. Classes More Than 5 Students
select c.class from courses c group by c.class having count(distinct c.student) > 4
#tips:一个学生同选一门课无效(distinct)595. Big Countries
select name, population, area from World where(area > 3000000 or population > 25000000)620. Not Boring Movies
select * from cinema where(description != 'boring' and id%2 = 1) order by rating desc197. Rising Temperature
SELECT w1.Id FROM Weather w1, Weather w2 WHERE w1.Temperature > w2.Temperature AND DATEDIFF(w1.RecordDate, w2.RecordDate) = 1;196. Delete Duplicate Emails
delete p1 from Person p1, Person p2 where p1.Email=p2.Email and p1.Id>p2.Id183. Customers Who Never Order
SELECT Name as Customers FROM Customers c WHERE c.Id NOT IN (SELECT CustomerId FROM Orders o)182. Duplicate Emails
select Email from Person group by email having count(Email) > 1181. Employees Earning More Than Their Managers
select e.Name as Employee from employee e,employee m where e.managerid=m.id and e.salary>m.salary
#将表作为两个镜像别名表来对比176. Second Highest Salary
select ifnull((select Distinct Salary from Employee order by Salary desc limit 1,1), null) as SecondHighestSalary175. Combine Two Tables
select p.FirstName, p.LastName, a.City, a.State from Person p left join Address a on p.PersonId = a.PersonId2. Algorithms
3. Shell