string5 SQL: Right and Left You are given a table named repositories, format as below: ** repositories table schema ** project commits contributors address The table shows project names of major cryptocurrencies, their numbers of commits and contributors and also a random donation address ( not linked in any way :) ). For each row: Return first x characters of the project name where x = commits. Return last y characters of.. 2022. 7. 13. SQL Basics - Position You have access to a table of monsters as follows: monsters schema id name legs arms characteristics In each row, the characteristic column has a single comma. Your job is to find it using position(). You must return a table with the format as follows: output schema id name comma The comma column will contain the position of the comma within the characteristics string. Order the results by comma.. 2022. 6. 6. Returning Strings Write a select statement that takes name from person table and return "Hello, how are you doing today?" results in a column named greeting [Make sure you type the exact thing I wrote or the program may not execute properly] Solution: SELECT concat('Hello, ', name, ' how are you doing today?') AS greeting FROM person concat appends string arguments. '||' By using symbols, the same result can be a.. 2022. 5. 20. Remove First and Last Character Part Two Description: This is a spin off of my first kata. You are given a string containing a sequence of character sequences separated by commas. Write a function which returns a new string containing the same character sequences except the first and the last ones but this time separated by spaces. If the input string is empty or the removal of the first and last items would cause the resulting string .. 2022. 4. 10. 문자열 다루기 기본 문제 설명 문자열 s의 길이가 4 혹은 6이고, 숫자로만 구성돼있는지 확인해주는 함수, solution을 완성하세요. 예를 들어 s가 "a234"이면 False를 리턴하고 "1234"라면 True를 리턴하면 됩니다. 제한 사항 s는 길이 1 이상, 길이 8 이하인 문자열입니다. 해결 방법 1. s를 숫자로 바꾸어 본다. 2. 만약 숫자로 바꿀 수 없는 문자열이라면 ValueError를 통해 False 를 반환한다. 3. 숫자로 바꿀 수 있다면 해당 문자열의 길이를 구한다. 4. 길이가 4 혹은 6이라면 True를 반환하고 아니라면 False 를 반환한다. def solution(s): try: int(s) length = len(s) answer = length == 4 or length == 6 exc.. 2022. 1. 31. 이전 1 다음