문제 입력 코드SELECT *FROM UsersWHERE mail REGEXP '^[A-Za-z][A-Za-z0-9_\.\-]*@leetcode(\\?com)?\\.com$'SELECT *FROM usersWHERE mail REGEXP '^[a-zA-Z][a-zAZ0-9_.-]*@leetcode[.]com$' 코드 설명#SELECT #WHERE #REGEXP 문제 출처https://leetcode.com/problems/find-users-with-valid-e-mails/description/?envType=study-plan-v2&envId=top-sql-50
문제 입력 코드SELECT sell_date, COUNT(DISTINCT(product)) AS num_sold, GROUP_CONCAT(DISTINCT(product)) AS productsFROM ActivitiesGROUP BY sell_dateORDER BY sell_dateSELECT sell_date, COUNT(DISTINCT(product)) AS num_sold, GROUP_CONCAT(DISTINCT(product) ORDER BY product ASC SEPARATOR ',') AS productsFROM ActivitiesGROUP BY sell_dateORDE..
문제 입력 코드1. SELECT ( SELECT DISTINCT Salary FROM Employee ORDER BY salary DESC LIMIT 1 OFFSET 1) AS SecondHighestSalary 2. SELECT DISTINCT MAX(salary) AS SecondHighestSalary FROM EmployeeWHERE salary 코드 설명#SELECT #DISTINCT #ORDER BY #DESC #LIMIT #OFFSET #MAX 문제 출처https://leetcode.com/problems/second-highest-salary/description/?envType=study-plan-v2&envId=top-sql-50
문제 입력 코드DELETE p1FROM person AS p1, person AS p2WHERE p1.email = p2.email AND p1.id > p2.idDELETE p1FROM person AS p1JOIN person AS p2ON p1.email = p2.emailWHERE p1.email = p2.email AND p1.id > p2.id 코드 설명#DELETE #JOIN #ON #WHERE 문제 출처https://leetcode.com/problems/delete-duplicate-emails/description/?envType=study-plan-v2&envId=top-sql-50
문제 입력 코드1. SELECT *FROM PatientsWHERE conditions LIKE 'DIAB1%' OR conditions LIKE '% DIAB1%'; 2. REGEXPSELECT *FROM PatientsWHERE conditions REGEXP '\\bDIAB1' 코드 설명#SELECT #WHERE #LIKE #% #REGEXP 문제 출처https://leetcode.com/problems/patients-with-a-condition/description/?envType=study-plan-v2&envId=top-sql-50