일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Python
- join
- STR
- and
- SQL
- slice
- split
- enumerate
- Algorithm
- list
- MAX
- len
- lambda
- range
- 위코드
- LOWER
- WECODE
- index
- DART
- map
- count
- sum
- 파이썬
- decorator
- or
- js
- If
- Sorted
- iNT
- FOR
- Today
- Total
목록SQL (69)
코드로 우주평화
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'..
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..
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..
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...
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..
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
Nathan loves cycling. Because Nathan knows it is important to stay hydrated, he drinks 0.5 litres of water per hour of cycling. You get given the time in hours and you need to return the number of litres Nathan will drink, rounded to the smallest value. For example: hours = 3 ----> liters = 1 hours = 6.7---> liters = 3 hours = 11.8--> liters = 5 You have to return 3 columns: id, hours and liters..
Very simple, given an integer or a floating-point number, find its opposite. Examples: 1: -1 14: -14 -34: 34 You will be given a table: opposite, with a column: number. Return a table with a column: res. Solution: SELECT number * -1 AS res FROM opposite Below is a method to solve uselessly and difficultly using CASE and SIGN. The 'SIGN' function tells whether the number is negative or positive w..
Deep within the fair realm of Lothlórien, you have been asked to create a shortlist of candidates for a recently vacated position on the council. Of so many worthy elves, who to choose for such a lofty position? After much thought you decide to select candidates by name, which are often closely aligned to an elf's skill and temperament. Choose those with tegil appearing anywhere in their first n..
Given the following table 'decimals': decimals table schema id number1 number2 Return a table with a single column result which is the output of number1 raised to the power of number2. Solution: SELECT POWER(number1, number2) as result FROM decimals The 'POWER' function returns the value raised to the power of the first argument by the second argument.