Search

2020๋…„ 4ํšŒ

2020๋…„ 4ํšŒ ๊ธฐ์ถœ๋ถ„์„

๋ฒˆํ˜ธ
๊ณผ๋ชฉ
์ฃผ์š” ๊ฐœ๋…
๊ธฐ์ถœ ํ†ต๊ณ„
1
7. SQL ์‘์šฉ
์ฆ‰์‹œ ๊ฐฑ์‹  ํšŒ๋ณต ๊ธฐ๋ฒ•
2
7. SQL ์‘์šฉ
์ด์ƒํ˜„์ƒ
์‚ฝ์ž…์ด์ƒ, ์‚ญ์ œ์ด์ƒ, ๊ฐฑ์‹ ์ด์ƒ
3
7. SQL ์‘์šฉ
SELECT ๊ทธ๋ฃนํ•จ์ˆ˜
GROUP BY, COUNT(*)
4
6. ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ํ™œ์šฉ
[Java] 2์ง„์ˆ˜ ๋ณ€ํ™˜
5
6. ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ํ™œ์šฉ
[Java] 2์ฐจ์› ๋ฐฐ์—ด
6
6. ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ํ™œ์šฉ
[Python]ย  ์ค‘์ฒฉ ๋ฆฌ์ŠคํŠธ
7
6. ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ํ™œ์šฉ
[C] ํฌ์ธํ„ฐ
8
6. ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ํ™œ์šฉ
[Java] ์˜ค๋ฒ„๋ผ์ด๋”ฉ, ์žฌ๊ท€ํ˜ธ์ถœ
๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ํšŒ๋ณต(Recovery) ๊ธฐ๋ฒ• ์ค‘ Rollback ์‹œ Redo, Undo๊ฐ€ ๋ชจ๋‘ ์‹คํ–‰๋˜๋Š” ํŠธ๋žœ์žญ์…˜ ์ฒ˜๋ฆฌ๋ฒ•์œผ๋กœ ํŠธ๋žœ์žญ์…˜ ์ˆ˜ํ–‰ ์ค‘ ๊ฐฑ์‹  ๊ฒฐ๊ณผ๋ฅผ ๋ฐ”๋กœ DB์— ๋ฐ˜์˜ํ•˜๋Š” ๊ธฐ๋ฒ•์€ ๋ฌด์—‡์ธ๊ฐ€?
๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด์ƒ ํ˜„์ƒ(Anomaly)์˜ ์ข…๋ฅ˜ 3๊ฐ€์ง€๋ฅผ ์“ฐ์‹œ์˜ค.
๋‹ค์Œ ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜๋ฉด์„œ ํ•™๊ณผ๋ณ„๋กœ ํŠœํ”Œ ์ˆ˜๊ฐ€ ์–ผ๋งˆ์ธ์ง€ ๊ตฌํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.
[ํ•™์ƒ]
ํ•™๊ณผ
ํ•™์ƒ
์ „๊ธฐ
์ด์ˆœ์‹ 
์ปดํ“จํ„ฐ
์•ˆ์ค‘๊ทผ
์ปดํ“จํ„ฐ
์œค๋ด‰๊ธธ
์ „์ž
์ด๋ด‰์ฐฝ
์ „์ž
๊ฐ•์šฐ๊ทœ
[๊ฒฐ๊ณผ]
ํ•™๊ณผ
ํ•™๊ณผ๋ณ„ ํŠœํ”Œ์ˆ˜
์ „๊ธฐ
1
์ปดํ“จํ„ฐ
2
์ „์ž
2
๋‹ค์Œ์€ n์ด 10์ผ ๋•Œ, 10์„ 2์ง„์ˆ˜๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ์ž๋ฐ” ์†Œ์Šค ์ฝ”๋“œ์ด๋‹ค. A, B ๊ด„ํ˜ธ ์•ˆ์— ์•Œ๋งž์€ ๊ฐ’์„ ์ ์œผ์‹œ์˜ค.
class good { public static void main (String[] args) { int[]a = new int[8]; int i=0; int n=10; while ( ๊ด„ํ˜ธ A ) { a[i++] = ( ๊ด„ํ˜ธ B ); n /= 2; } for(i=7; i>=0; i--){ System.out.print(a[i]); } } }
Java
๋ณต์‚ฌ
๋‹ค์Œ์€ ์ž๋ฐ” ์†Œ์Šค ์ฝ”๋“œ์ด๋‹ค. ์ถœ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ๋ณด๊ณ  ๊ด„ํ˜ธ A, B์— ์•Œ๋งž์€ ๊ฐ’์„ ์ ์œผ์‹œ์˜ค.
public class good { public static void main(String[] args) { int[][]a = new int[( ๊ด„ํ˜ธA )][( ๊ด„ํ˜ธB )]; for(int i = 0; i < 3; i++){ for(int j=0; j < 5; j++){ a[i][j] = j*3+(i+1); System.out.print(a[i][j]+""); } System.out.println(); } } }
Java
๋ณต์‚ฌ
[์ถœ๋ ฅ๊ฒฐ๊ณผ] 1 4 7 10 13 2 5 8 11 14 3 6 9 12 15
Java
๋ณต์‚ฌ
๋‹ค์Œ์€ ํŒŒ์ด์ฌ ์†Œ์Šค ์ฝ”๋“œ์ด๋‹ค. ์ถœ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ์“ฐ์‹œ์˜ค.
lol = [[1,2,3],[4,5],[6,7,8,9]] print(lol[0]) print(lol[2][1]) for sub in lol: for item in sub: print(item, end = '') print()
Java
๋ณต์‚ฌ
๋‹ค์Œ์€ C์–ธ์–ด ์†Œ์Šค ์ฝ”๋“œ์ด๋‹ค. ์ถœ๋ ฅ ๊ฐ’์„ ์“ฐ์‹œ์˜ค.
#include <stdio.h> void main(){ char *p = "KOREA" printf("%s\n" , p); printf("%s\n" , p+3); printf("%c\n" , *p); printf("%c\n" , *(p+3)); printf("%c\n" , *p+2); }
C
๋ณต์‚ฌ
๋‹ค์Œ์€ ์ž๋ฐ”(Java) ์†Œ์Šค ์ฝ”๋“œ์ด๋‹ค. ์ถœ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ์“ฐ์‹œ์˜ค.
class Parent { public int compute(int num){ if(num <=1) return num; return compute(num-1) + compute(num-2); } } class Child extends Parent { public int compute(int num){ if(num<=1) return num; return compute(num-1) + compute(num-3); } } public class Test { public static void main (String[] args){ Parent obj = new Child(); System.out.print(obj.compute(4)); } }
Java
๋ณต์‚ฌ