leetcode上刷SQL題的代碼,僅供參考,畢竟答案不唯一,我的代碼執行效率也不是很高
select FirstName, LastName, City, State from Person left join Address on Person.PersonId = Address.PersonId
select name as Customers from Customers left join Orders
on Customers.Id = Orders.CustomerId
where Orders.CustomerId is null
select Email from Person
group by Email
having count(Email)>1
select id,movie,description,rating from cinema
where (description != 'boring' and id mod 2 = 1)
order by rating desc