목록Algorithm/HackerRank (6)
쥬로그
Solve SQL Code Challenges A special-purpose language designed for managing data held in a relational database. www.hackerrank.com Draw The Triangle 1 SET @number = 21; SELECT REPEAT('* ', @number := @number - 1) FROM information_schema.tables LIMIT 20; Draw The Triangle 2 SET @number = 0; SELECT REPEAT('* ', @number := @number + 1) FROM information_schema.tables LIMIT 20; Print Prime Numbers CRE..
Solve SQL Code Challenges A special-purpose language designed for managing data held in a relational database. www.hackerrank.com SQL Project Planning SELECT Start_Date, MIN(End_Date) FROM (SELECT Start_Date FROM Projects WHERE Start_Date NOT IN (SELECT End_Date FROM Projects)) AS s, (SELECT End_Date FROM Projects WHERE End_Date NOT IN (SELECT Start_Date FROM Projects)) AS e WHERE Start_Date < E..
Solve SQL Code Challenges A special-purpose language designed for managing data held in a relational database. www.hackerrank.com African Cities SELECT CITY.NAME FROM CITY JOIN COUNTRY ON CITY.COUNTRYCODE = COUNTRY.CODE WHERE COUNTRY.CONTINENT = 'Africa'; Average Population of Each Continent SELECT COUNTRY.CONTINENT, FLOOR(AVG(CITY.POPULATION)) FROM CITY JOIN COUNTRY ON CITY.COUNTRYCODE = COUNTR..
Solve SQL Code Challenges A special-purpose language designed for managing data held in a relational database. www.hackerrank.com Revising Aggregations - The Sum Function SELECT SUM(POPULATION) FROM CITY WHERE DISTRICT = 'California'; Revising Aggregations - Averages SELECT AVG(POPULATION) FROM CITY WHERE DISTRICT = 'California'; Revising Aggregations - The Count Function SELECT COUNT(*) FROM CI..
Solve SQL Code Challenges A special-purpose language designed for managing data held in a relational database. www.hackerrank.com The PADS SELECT CONCAT(Name, '(', LEFT(Occupation, 1), ')') AS Occupation FROM OCCUPATIONS ORDER BY Name; SELECT CONCAT( 'There are a total of ', COUNT(Occupation), ' ', LOWER(Occupation), 's.') FROM OCCUPATIONS GROUP BY Occupation ORDER BY COUNT(Occupation), occupati..
Solve SQL Code Challenges A special-purpose language designed for managing data held in a relational database. www.hackerrank.com Revising the Select Query 1 SELECT * FROM CITY WHERE POPULATION > 100000 AND COUNTRYCODE = 'USA'; Revising the Select Query 2 SELECT NAME FROM CITY WHERE COUNTRYCODE = 'USA' AND POPULATION > 120000; Select All SELECT * FROM CITY; Select By ID SELECT * FROM CITY WHERE ..