[Oracle DB] ๋ฌธ์ž ํ•จ์ˆ˜ LPAD, SUBSTR, REPLACE
ยท
DBMS/OracleDB
๐Ÿ’‍โ™‚๏ธ  ###.###.#### (12์ž๋ฆฌ ์ˆ˜)  ์ฒ˜์Œ ์„ธ ์ž๋ฆฌ ์ˆซ์ž ๋Œ€์‹  (02)๋ฅผ ๋ถ™์—ฌ ์ถœ๋ ฅํ•ด๋ณด์ž ex) 650.507.9833 -> (02).507.9833 ์œผ๋กœ ๋ณ€๊ฒฝ ํ›„ ์ถœ๋ ฅ * SUBSTR(char, pos, len) :SUBSTR ํ•จ์ˆ˜๋Š” ์ž˜๋ผ์˜ฌ ๋Œ€์‚ฌ ๋ฌธ์ž์—ด์ธ char์˜ pos๋ฒˆ์งธ ๋ฌธ์ž๋ถ€ํ„ฐ len๊ธธ์ด๋งŒํผ ์ž˜๋ผ๋‚ธ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค.* LPAD(expr1, n ,expr2) :LPAD ํ•จ์ˆ˜๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋“ค์–ด์˜จ expr2 ๋ฌธ์ž์—ด์„ n์ž๋ฆฌ๋งŒํผ ์™ผ์ชฝ๋ถ€ํ„ฐ ์ฑ„์›Œ expr1์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค. a. SUBSTR ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•ด 650.507.9833 ์ž˜๋ผ๋‚ด๊ธฐ (์ฒซ ๋ฒˆ์งธ ๋ฌธ์ž๋ถ€ํ„ฐ ๋„ค๋ฒˆ์งธ ๋ฌธ์ž)b. LPADํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•ด ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋“ค์–ด์˜จ expr2('(02)')์„ n(13)์ž๋ฆฌ๋งŒํผ ์™ผ์ชฝ๋ถ€ํ„ฐ ์ฑ„์›Œ expr1(SUBSTR ..
[OracleDB] Constraints(์ œ์•ฝ์กฐ๊ฑด) ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž
ยท
DBMS/OracleDB
์ œ์•ฝ์กฐ๊ฑด Constraints ์€ ๋ฐ์ดํ„ฐ ๋ฌด๊ฒฐ์„ฑ์„ ๋ณด์žฅํ•˜๊ธฐ ์œ„ํ•œ ์šฉ๋„๋กœ ์‚ฌ์šฉ๋œ๋‹ค.์ œ์•ฝ์กฐ๊ฑด์—๋Š” NOT NULL, UNIQUE, Primary Key(๊ธฐ๋ณธํ‚ค), Foreign Key(์™ธ๋ž˜ํ‚ค), CHECK ๋“ฑ์ด ์žˆ๋‹ค. 1. NOT NULL์ปฌ๋Ÿผ๋ช… ๋ฐ์ดํ„ฐํƒ€์ž… NOT NULL ์ปฌ๋Ÿผ์„ ์ •์˜ํ•  ๋•Œ NOT NULL ์ œ์•ฝ์กฐ๊ฑด์„ ๋ช…์‹œํ•˜๋ฉด ํ•ด๋‹น ์ปฌ๋Ÿผ์—๋Š” ๋ฐ˜๋“œ์‹œ ๋ฐ์ดํ„ฐ๋ฅผ ์ž…๋ ฅํ•ด์•ผ ํ•œ๋‹ค.์œ„ ์˜ˆ์ œ๋ฅผ ๋ณด๋ฉด NOT NULL ์ปฌ๋Ÿผ์— ๋ฐ์ดํ„ฐ๋ฅผ ๋„ฃ์ง€ ์•Š์„ ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. -- ํ…Œ์ด๋ธ” ์ƒ์„ฑ CREATE TABLE EX2_6( COL_NULL VARCHAR2(10), COL_NOT_NUlL VARCHAR2(10) NOT NULL);INSERT INTO ex2_6 VALUES ('AA', ''); -- ์—๋Ÿฌ ๋ฐœ์ƒ..
[Java] ๋ฐฐ์—ด(Array) ๊ณผ List, Set ์ธํ„ฐํŽ˜์ด์Šค ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ
ยท
Java
[์•ผ๊ตฌ ๊ฒŒ์ž„ ํ”„๋กœ๊ทธ๋žจ] n Strike ! n Ball !๋ฐ์ดํ„ฐ ํƒ€์ž…์„ ๋ฐฐ์—ด(Array)๊ณผ List, Set ์ธํ„ฐํŽ˜์ด์Šค ArrayList, HashSet ํƒ€์ž… ๋‘ ๊ฐ€์ง€ ์กฐ๊ฑด์œผ๋กœ ์ž‘์„ฑํ•ด๋ดค๋‹ค.โœ๏ธ ๊ฒŒ์ž„์˜ ๊ทœ์น™์— ๋งž๊ฒŒ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜์˜€๋‹ค.  A. 0~9 ์‚ฌ์ด์˜ ์„œ๋กœ ๋‹ค๋ฅธ ๊ฐ’์„ ๊ฐ–๋Š” 3์ž๋ฆฌ ์ˆ˜ ๋žœ๋ค ์ƒ์„ฑ- ์„œ๋กœ ๋‹ค๋ฅธ ๊ฐ’์„ ๊ฐ€์ง„ ๋‚œ์ˆ˜ ์ƒ์„ฑ ์‹œ ์ค‘๋ณต ์ฒดํฌ๋ฅผ ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ?- ์ค‘๋ณต์ด ํ—ˆ์šฉ๋˜๋Š” Array ์—์„œ๋Š” if๋ฌธ  (์ค‘๋ณต ์ฒดํฌ)- ์ค‘๋ณต์ด ํ—ˆ์šฉ๋˜์ง€ ์•Š๋Š” ์ปฌ๋ ‰์…˜ Set ์ธํ„ฐํŽ˜์ด์Šค ์‚ฌ์šฉfor (int i = 0; i  HashSet ์€ ์ค‘๋ณต ๊ฐ’์„ ์ž๋™์œผ๋กœ ํ•„ํ„ฐ๋งํ•œ๋‹ค.์ž๋ฆฌ์™€ ์ˆซ์ž๋ฅผ ๋ชจ๋‘ ๋น„๊ตํ•˜๊ธฐ ์œ„ํ•ด HashSet์— ์ €์žฅ๋œ ๊ฐ์ฒด๋“ค์„ ArrayList์— ๋‹ด์•˜๋‹ค.Set set = new HashSet();while (set..
[git & github] error: failed to push some refs to.. git pull ๋กœ ํ•ด๊ฒฐ
ยท
git & github
๐Ÿคท‍โ™‚๏ธ vscode - ๊นƒํ—ˆ๋ธŒ ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ Error ๐Ÿ’ฅ ์ƒˆ๋กœ์šด ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ๋ฅผ ์œ„ํ•ด ํ‰์†Œ์™€ ๊ฐ™์ด push! ํ•˜์ง€๋งŒ.. ์—๋Ÿฌ ๋ฐœ์ƒ error ์™€์˜ ํ•œํŒ ์Šน๋ถ€ ์˜ค๋Š˜๋„ ํ•ด๊ฒฐํ•˜๋Ÿฌ ๊ฐ€๋ณด์ž.. ! [rejected] main -> main (fetch first)error: failed to push some refs to 'https://github.com/sihyun22/CoffeeOrder-Web.git'hint: Updates were rejected because the remote contains work that you do nothint: have locally. This is usually caused by another repository pushing tohint: the ..
[Javascript] ๊ฐ„๋‹จํ•œ ๋ฉ”๋ชจ์žฅ์„ ๋งŒ๋“ค์–ด๋ณด์ž createTextNode() createElement() appendChild() remove()๐Ÿง
ยท
JavaScript
1. getElementById() ์ž…๋ ฅ์ฐฝ, ์ž…๋ ฅ์ฐฝ๊ฐ’(value) ๊ฐ€์ ธ์˜ค๊ธฐ2. createTextNode() ์ž…๋ ฅํ•œ ๋‚ด์šฉ์„ ํ…์ŠคํŠธ ๋…ธ๋“œ๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ3. createElement() HTML ์š”์†Œ ์ƒ์„ฑํ•˜๊ธฐ4. appendChild() ๋ถ€๋ชจ ์š”์†Œ์— ์ƒ์„ฑ๋œ ์ž์‹ ์š”์†Œ ์ถ”๊ฐ€ํ•˜๊ธฐ5. addEventListener() ํด๋ฆญ ์ด๋ฒคํŠธ ํ•จ์ˆ˜ (์ถ”๊ฐ€ / ์‚ญ์ œ)6. remove() HTML ์š”์†Œ ์ œ๊ฑฐํ•˜๊ธฐ  ๊ฐ„๋‹จํ•œ ๋ฉ”๋ชจ์žฅ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด ์ž…๋ ฅ ์˜์—ญ, ์ถ”๊ฐ€ ์˜์—ญ, ๋ฆฌ์ŠคํŠธ ์˜์—ญ์„ ๊ฐ„๋‹จํ•œ HTML ์ฝ”๋“œ๋กœ ์ž‘์„ฑํ•˜๊ณ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ(Javascript) ๋กœ ์ถ”๊ฐ€, ์‚ญ์ œ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜์˜€๋‹ค. 1. HTML ์ฝ”๋“œ ์ž‘์„ฑ(์œ„ ์‚ฌ์ง„์€ CSS ๋”ฐ๋กœ ์ ์šฉ) ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ฉ”๋ชจ์žฅ ์ถ”๊ฐ€/์‚ญ์ œ ๋ฉ”๋ชจ ์ถ”๊ฐ€  2. Java..