SQL69 SQL Basics: Simple table totaling. For this challenge you need to create a simple query to display each unique clan with their total points and ranked by their total points. people table schema name points clan You should then return a table that resembles below select on rank clan total_points total_people The query must rank each clan by their total_points, you must return each unqiue clan and if there is no clan name (i.e. it'.. 2022. 6. 18. SQL Basics: Simple IN For this challenge you need to create a SELECT statement, this SELECT statement will use an IN to check whether a department has had a sale with a price over 98.00 dollars. departments table schema id name sales table schema id department_id (department foreign key) name price card_name card_number transaction_date resultant table schema id name Solution: SELECT id, name FROM departments WHERE i.. 2022. 6. 17. Easy SQL: Absolute Value and Log to Base Given the following table 'decimals': decimals table schema id number1 number2 Return a table with two columns (abs, log) where the values in abs are the absolute values of number1 and the values in log are values from number2 in logarithm to base 64. Solution: SELECT ABS(number1), LOG(64, number2) FROM decimals Result: abs log 2849.529276973034 0.5513855124091469e1 168.16728863472508 0.53183827.. 2022. 6. 16. SQL Basics: Create a FUNCTION For this challenge you need to create a basic Increment function which Increments on the age field of the peoples table. The function should be called increment, it needs to take 1 integer and increment that number by 1. You may query the people table while testing but the query must only contain the function on your final submit. important: you must remove all comments when submitting the kata... 2022. 6. 15. SQL with Street Fighter: Total Wins It's time to assess which of the world's greatest fighters are through to the 6 coveted places in the semi-finals of the Street Fighter World Fighting Championship. Every fight of the year has been recorded and each fighter's wins and losses need to be added up. Each row of the table fighters records, alongside the fighter's name, whether they won (1) or lost (0), as well as the type of move tha.. 2022. 6. 14. SQL Basics: Simple GROUP BY For this challenge you need to create a simple GROUP BY statement, you want to group all the people by their age and count the people who have the same age. people table schema id name age select table schema age [group by] people_count (people count) Solution: SELECT age, COUNT(age) AS people_count FROM people GROUP BY age Result: age people_count 8 10 4 7 1 16 5 8 3 7 0 9 9 13 6 12 2022. 6. 13. 이전 1 ··· 3 4 5 6 7 8 9 ··· 12 다음