본문 바로가기

SQL69

Collect Tuition (SQL for Beginners #4) You are working for a local school, and you are responsible for collecting tuition from students. You have a list of all students, some of them have already paid tution and some haven't. Write a select statement to get a list of all students who haven't paid their tuition yet. The list should include all the data available about these students. students table schema name (string) age (integer) s.. 2022. 5. 16.
Expressions Matter Task Given three integers a ,b ,c, return the largest number obtained after inserting the following operators and brackets: +, *, () In other words , try every combination of a,b,c with [*+()] , and return the Maximum Obtained Consider an Example : With the numbers are 1, 2 and 3 , here are some ways of placing signs and brackets: 1 * (2 + 3) = 5 1 * 2 * 3 = 6 1 + 2 * 3 = 7 (1 + 2) * 3 = 9 So th.. 2022. 5. 15.
SQL Basics: Mod Given the following table 'decimals': ** decimals table schema ** id number1 number2 Return a table with one column (mod) which is the output of number1 modulus number2. Solution: SELECT MOD(number1, number2) FROM decimals; MOD is a function that calculates the remainder when number1 and number2 are divided. 2022. 5. 14.
Easy SQL: LowerCase Given a demographics table in the following format: ** demographics table schema ** id name birthday race you need to return the same table where all letters are lowercase in the race column. Solution: SELECT id, name, birthday, LOWER(race) as race FROM demographics; 2022. 5. 13.
SQL Basics: Simple WHERE and ORDER BY For this challenge you need to create a simple SELECT statement that will return all columns from the people table WHERE their age is over 50 people table schema id name age You should return all people fields where their age is over 50 and order by the age descending NOTE: Your solution should use pure SQL. Ruby is used within the test cases to do the actual testing. Solution: SELECT * FROM peo.. 2022. 5. 12.
RDB와 NoSQL를 차이 RDB란? 관계형 데이터베이스는 엄격하게 정의된 스키마를 요구하는 테이블 기반 데이터 구조입니다. 엄격한 스키마로 데이터 중복이 없고, 데이터를 유지보수하는데 효율적입니다. 다만, 시스템이 커지면 join문이 복잡해지고 성능 향상을 하려면 스케일 업만 가능하여 비용이 크게 발생합니다. *스키마(schema)는 데이터베이스에서 자료의 구조, 자료의 표현 방법, 자료 간의 관계를 형식 언어로 정의한 구조입니다. -위키- 그렇다면 NoSQL은 무엇일까요? NoSQL은 테이블 구조가 아닌 비정형 데이터를 저장할 수 있습니다. 유연하고 자유로운 데이터 구조이나 데이터 수정시 모든 컬렉션에서 수정이 필요하기 때문에 update가 적고 조회가 많은 경우에 유리합니다. 이 둘은 언제 사용하는게 좋을까요? RDB 데이터.. 2022. 3. 18.