ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด 51

[SQL] SELECT ๋ฌธ

0. ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๋Š” ์„ธ๊ฐ€์ง€ ๋ฐฉ๋ฒ• - ์…€๋ ‰์…˜ selection : ํ–‰ ๋‹จ์œ„๋กœ ์›ํ•˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๋Š” ๋ฐฉ์‹. ํ…Œ์ด๋ธ” ์ „์ฒด ๋ฐ์ดํ„ฐ ์ค‘ ๋ช‡๋ช‡ ๊ฐ€๋กœ์ค„์˜ ๋ฐ์ดํ„ฐ๋งŒ ์„ ํƒํ•  ๋•Œ ์‚ฌ์šฉ - ํ”„๋กœ์ ์…˜ projection : ์นผ๋Ÿผ(์—ด) ๋‹จ์œ„๋กœ ์›ํ•˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๋Š” ๋ฐฉ์‹. ํ…Œ์ด๋ธ” ์ „์ฒด ํ•ญ๋ชฉ ์ค‘ ๋ช‡๋ช‡ ์†์„ฑ์˜ ๋ฐ์ดํ„ฐ๋งŒ ์„ ํƒํ•  ๋•Œ ์‚ฌ์šฉ - ์กฐ์ธ join : ๋‘ ๊ฐœ ์ด์ƒ์˜ ํ…Œ์ด๋ธ”์„ ์–‘ ์˜†์— ์—ฐ๊ฒฐํ•˜์—ฌ ๋งˆ์น˜ ํ•˜๋‚˜์˜ ํ…Œ์ด๋ธ”์ธ ๊ฒƒ ์ฒ˜๋Ÿผ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๋Š” ๋ฐฉ์‹ 1. SELECT ๋ฌธ - SELECT๋ฌธ์€ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๋ณด๊ด€๋˜์–ด ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ - SELECT์ ˆ๊ณผ FROM์ ˆ์„ ๊ธฐ๋ณธ ๊ตฌ์„ฑ์œผ๋กœ SELECT๋ฌธ์„ ์ž‘์„ฑ - FROM ์ ˆ์€ ์—ฌ๋Ÿฌ ๊ฐœ ํ…Œ์ด๋ธ” ์ง€์ •์ด ๊ฐ€๋Šฅ, ์ •ํ™•ํžˆ ๋งํ•˜๋ฉด ์—ด๊ณผ ํ–‰์œผ๋กœ ๊ตฌ์„ฑ๋œ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์ด๋ฉด ๋ชจ๋‘ ์ง€์ • ๊ฐ€๋Šฅ..

[Python] math ๋ชจ๋“ˆ ํ•จ์ˆ˜

docs.python.org/3/library/math.html#module-math math — Mathematical functions — Python 3.9.1 documentation math — Mathematical functions This module provides access to the mathematical functions defined by the C standard. These functions cannot be used with complex numbers; use the functions of the same name from the cmath module if you require support for co docs.python.org 1. ์ƒ์ˆ˜ 2. ์‹ค์ˆ˜ ์ฒ˜๋ฆฌ 3. it..

[Python] ๋‚ด์žฅ ํ•จ์ˆ˜

docs.python.org/3/library/functions.html Built-in Functions — Python 3.9.1 documentation Built-in Functions The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order. abs(x) Return the absolute value of a number. The argument may be an integer, a floating poin docs.python.org 1. ์ •์ˆ˜์˜ ์ง„์ˆ˜ ๋ณ€ํ™˜ 2. ์•„์Šคํ‚ค์ฝ”๋“œ ์ˆซ์ž 3. ์ž๋ฃŒํ˜• ๋ณ€ํ™˜, ..

[Python] ์ž๋ฃŒํ˜• - ์ง‘ํ•ฉ Set

0. ์ง‘ํ•ฉ Set ์ด๋ž€? ์ง‘ํ•ฉ์— ๊ด€๋ จ๋œ ๊ฒƒ์„ ์‰ฝ๊ฒŒ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“  ์ž๋ฃŒํ˜• ์ค‘๋ณต์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š์œผ๋ฉฐ ์ˆœ์„œ๊ฐ€ ์—†๋‹ค ์ง‘ํ•ฉ์˜ ์›์†Œ๋กœ ๋‹ค์–‘ํ•œ ๊ฐ’์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์ง€๋งŒ ๊ฐ’์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์— ๋ฆฌ์ŠคํŠธ, ๋”•์…”๋„ˆ๋ฆฌ, ์ง‘ํ•ฉ์€ ์š”์†Œ๋กœ ๊ฐ€์งˆ ์ˆ˜ ์—†๋‹ค ( set ์ƒ์„ฑ์ž ์•ˆ์— ๋ฆฌ์ŠคํŠธ๋ฅผ ๋„ฃ์œผ๋ฉด ๋ฆฌ์ŠคํŠธ ์•ˆ์˜ ์›์†Œ๊ฐ€ ์ง‘ํ•ฉ์˜ ์›์†Œ๊ฐ€ ๋œ๋‹ค ) ์ค‘๊ด„ํ˜ธ๋ฅผ ์“ฐ๋Š” ๊ฒƒ์ด ๋”•์…”๋„ˆ๋ฆฌ๋ž‘ ๋น„์Šทํ•˜์ง€๋งŒ key๊ฐ’์ด ์—†์ด ๊ฐ’๋งŒ ์กด์žฌํ•œ๋‹ค # ์ง‘ํ•ฉ๋ช… = {์š”์†Œ1, ์š”์†Œ2, ์š”์†Œ3, …} # SetName = {1, 2, 3} a = set() b = {1, 2, 3} c = {1, 'hi', (2, 5)} print(c) # {1, (2, 5), 'hi'} d = {[1, 2, 3, 4]} # ์˜ค๋ฅ˜ TypeError: unhashable type: 'list' ..

[Python] ์ž๋ฃŒํ˜• - ๋”•์…”๋„ˆ๋ฆฌ Dictionary

0. ๋”•์…”๋„ˆ๋ฆฌ Dictionary ๋ž€ ? ๋Œ€์‘ ๊ด€๊ณ„๋ฅผ ๋‚˜ํƒ€๋‚ผ ์ˆ˜ ์žˆ๋Š” ์ž๋ฃŒํ˜•( ์—ฐ๊ด€ ๋ฐฐ์—ด Asssociative array ๋˜๋Š” ํ•ด์‹œ Hash ๋ผ๊ณ  ํ•จ ) Key์™€ Value๋ฅผ ํ•œ ์Œ์œผ๋กœ ๊ฐ–๋Š” ์ž๋ฃŒํ˜•. Value์—๋Š” ์•„๋ฌด ๊ฐ’์ด๋‚˜ ๋‹ค ๋„ฃ์„ ์ˆ˜ ์žˆ์ง€๋งŒ Key๊ฐ’์€ ๋ณ€ํ•˜์ง€ ์•Š๋Š” ๊ฐ’์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ฆฌ์ŠคํŠธ๋Š” ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค ๋ฆฌ์ŠคํŠธ๋‚˜ ํŠœํ”Œ์ฒ˜๋Ÿผ ์ˆœ์ฐจ์ ์œผ๋กœ ์š”์†Œ๊ฐ’์„ ๊ตฌํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ Key๋ฅผ ํ†ตํ•ด Value๋ฅผ ์–ป๋Š” ๋ฐฉ์‹ Key๋Š” ๊ณ ์œ ํ•œ ๊ฐ’์ด๋ฏ€๋กœ ์ค‘๋ณต๋˜๋Š” Key๊ฐ’์ด ์žˆ๋‹ค๋ฉด ํ•˜๋‚˜๋ฅผ ์ œ์™ธํ•œ ๋‚˜๋จธ์ง€๋Š” ๋ชจ๋‘ ๋ฌด์‹œ๋˜๋ฏ€๋กœ ์ฃผ์˜ํ•ด์•ผ ํ•œ๋‹ค -> ๋™์ผํ•œ Key๊ฐ€ ์กด์žฌํ•˜๋ฉด Key๊ฐ’์„ ํ†ตํ•ด Value๋ฅผ ์–ป์„ ๋•Œ ์–ด๋–ค ๊ฐ’์„ ๋ถˆ๋Ÿฌ์™€์•ผ ํ• ์ง€ ๋ชจํ˜ธํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ค‘๋ณต์ด ๋ถˆ๊ฐ€๋Šฅ! # ๋”•์…”๋„ˆ๋ฆฌ๋ช… = {ํ‚ค1:์š”์†Œ1, ํ‚ค2:์š”์†Œ2, ํ‚ค3:์š”์†Œ3, …} # Di..

[Python] ์ž๋ฃŒํ˜• - ํŠœํ”Œ Tuple

0. ํŠœํ”Œ Tuple ์ด๋ž€ ? ๋ฆฌ์ŠคํŠธ์™€ ๊ฑฐ์˜ ๋น„์Šทํ•˜์ง€๋งŒ ๋ช‡๊ฐ€์ง€ ๋‹ค๋ฅธ ์ ์ด ์กด์žฌํ•œ๋‹ค. ๋ฆฌ์ŠคํŠธ๋Š” ๊ฐ’์˜ ์ƒ์„ฑ, ์‚ญ์ œ, ์ˆ˜์ •์ด ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ํŠœํ”Œ์€ ๊ฐ’์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์—†๋‹ค ํŠœํ”Œ์€ ๊ด„ํ˜ธ()๋ฅผ ์ƒ๋žตํ•ด๋„ ๋˜๊ธฐ ๋•Œ๋ฌธ์— 1๊ฐœ์˜ ์š”์†Œ๋งŒ ๊ฐ€์งˆ ๋•Œ์—๋Š” b=(1,) ์ด๋‚˜ f = 2, ์ฒ˜๋Ÿผ ์š”์†Œ ๋’ค์— ์ฝค๋งˆ๋ฅผ ๋ฐ˜๋“œ์‹œ ๋ถ™์—ฌ์•ผ ํ•œ๋‹ค # ํŠœํ”Œ๋ช… = (์š”์†Œ1, ์š”์†Œ2, ์š”์†Œ3, …) # TupleName = (1, 2, 3, …) a = () b = (1,) c = (1, 2, 3) d = 1, 2, "this", "Python" e = ((1, 2), "this", (3, "Python")) f = 2, ํ”„๋กœ๊ทธ๋žจ์ด ์‹คํ–‰๋˜๋Š” ๋™์•ˆ ๊ทธ ๊ฐ’์ด ๋ณ€ํ•˜์ง€ ์•Š์•„์•ผ ํ•˜๋Š” ๊ฒƒ๋“ค์€ ํŠœํ”Œ๋กœ, ์ˆ˜์‹œ๋กœ ๊ฐ’์ด ๋ณ€ํ•˜๋Š” ๊ฒƒ๋“ค์€ ๋ฆฌ์ŠคํŠธ๋กœ ์‚ฌ์šฉ 1. ํŠœํ”Œ์˜ ์ธ๋ฑ์‹ฑ print..

[Python] ์ž๋ฃŒํ˜• - ๋ฆฌ์ŠคํŠธ List

0. ๋ฆฌ์ŠคํŠธ List ๋ž€ ? ์–ด๋– ํ•œ ์ž๋ฃŒํ˜•๋„ ํฌํ•จ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ์ž๋ฃŒํ˜• ๋น„์–ด์žˆ์„ ์ˆ˜๋„ ์žˆ๊ณ  ์ˆซ์ž, ๋ฌธ์ž, ์ˆซ์ž์™€ ๋ฌธ์ž๋ฅผ ํ•จ๊ป˜ ๊ฐ€์งˆ ์ˆ˜๋„ ์žˆ์œผ๋ฉฐ ๋ฆฌ์ŠคํŠธ๋ฅผ ์š”์†Œ๋กœ ํฌํ•จํ•  ์ˆ˜๋„ ์žˆ๋‹ค # ๋ฆฌ์ŠคํŠธ๋ช… = [์š”์†Œ1, ์š”์†Œ2, ์š”์†Œ3, …] # ListName = [1, 2, 3, …] a = [] b = [1, 2, 3] c = ["this", "is", "Python"] d = [1, 2, "this", "Python"] e = [[1, 2], "this", [3, "Python"]] 1. ๋ฆฌ์ŠคํŠธ์˜ ์ธ๋ฑ์‹ฑ ๋ฆฌ์ŠคํŠธ ์•ˆ์— ๋ฆฌ์ŠคํŠธ๊ฐ€ ์กด์žฌํ•˜๋Š” ๊ฒฝ์šฐ ๋‹ค๋ฅธ ์–ธ์–ด์˜ 2์ฐจ์› ๋ฐฐ์—ด๊ณผ ๊ฐ™์ด ์ธ๋ฑ์‹ฑ ํ•  ์ˆ˜ ์žˆ๋‹ค print(b) # [1, 2, 3] print(b[0], b[1], b[2]) # 1 2 3 print(c) # ['this..

[JAVA] BigInteger ํด๋ž˜์Šค

docs.oracle.com/en/java/javase/15/docs/api/java.base/java/math/BigInteger.html BigInteger (Java SE 15 & JDK 15) All Implemented Interfaces: Serializable, Comparable public class BigInteger extends Number implements Comparable Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in two's-complement notation (like Java's pri docs.oracle.com java.math์— ์†ํ•ด..

[JAVA] Math ํด๋ž˜์Šค

docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/Math.html Math (Java SE 15 & JDK 15) public final class Math extends Object The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions. Unlike some of the numeric methods of class StrictMath, docs.oracle.com java.lang์— ์†ํ•ด์žˆ๋Š” ํด๋ž˜์Šค. ์ˆ˜ํ•™์—์„œ ..

[JAVA] indexOf() / lastIndexOf() ๋ฉ”์†Œ๋“œ

docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#indexOf(int) String (Java SE 15 & JDK 15) All Implemented Interfaces: Serializable, CharSequence, Comparable , Constable, ConstantDesc public final class String extends Object implements Serializable, Comparable , CharSequence, Constable, ConstantDesc The String class represents character strings. docs.oracle.com docs.ora..