๐Ÿ‘โ€๐Ÿ—จ[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] ์ด๋ฆ„์— el์ด ๋“ค์–ด๊ฐ€๋Š” ๋™๋ฌผ ์ฐพ๊ธฐ

3364 ๋‹จ์–ด dbselectquerymysqloracleFROM

๋ฌธ์ œ ์„ค๋ช…

ANIMAL_INS ํ…Œ์ด๋ธ”์€ ๋™๋ฌผ ๋ณดํ˜ธ์†Œ์— ๋“ค์–ด์˜จ ๋™๋ฌผ์˜ ์ •๋ณด๋ฅผ ๋‹ด์€ ํ…Œ์ด๋ธ”์ž…๋‹ˆ๋‹ค. ANIMAL_INS ํ…Œ์ด๋ธ” ๊ตฌ์กฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์œผ๋ฉฐ, ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE๋Š” ๊ฐ๊ฐ ๋™๋ฌผ์˜ ์•„์ด๋””, ์ƒ๋ฌผ ์ข…, ๋ณดํ˜ธ ์‹œ์ž‘์ผ, ๋ณดํ˜ธ ์‹œ์ž‘ ์‹œ ์ƒํƒœ, ์ด๋ฆ„, ์„ฑ๋ณ„ ๋ฐ ์ค‘์„ฑํ™” ์—ฌ๋ถ€๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

NAMETYPENULLABLE
ANIMAL_IDVARCHAR(N)FALSE
ANIMAL_TYPEVARCHAR(N)FALSE
DATETIMEDATETIMEFALSE
INTAKE_CONDITIONVARCHAR(N)FALSE
NAMEVARCHAR(N)TRUE
SEX_UPON_INTAKEVARCHAR(N)FALSE

๋ณดํ˜ธ์†Œ์— ๋Œ์•„๊ฐ€์‹  ํ• ๋จธ๋‹ˆ๊ฐ€ ๊ธฐ๋ฅด๋˜ ๊ฐœ๋ฅผ ์ฐพ๋Š” ์‚ฌ๋žŒ์ด ์ฐพ์•„์™”์Šต๋‹ˆ๋‹ค. ์ด ์‚ฌ๋žŒ์ด ๋งํ•˜๊ธธ ํ• ๋จธ๋‹ˆ๊ฐ€ ๊ธฐ๋ฅด๋˜ ๊ฐœ๋Š” ์ด๋ฆ„์— 'el'์ด ๋“ค์–ด๊ฐ„๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋™๋ฌผ ๋ณดํ˜ธ์†Œ์— ๋“ค์–ด์˜จ ๋™๋ฌผ ์ด๋ฆ„ ์ค‘, ์ด๋ฆ„์— "EL"์ด ๋“ค์–ด๊ฐ€๋Š” ๊ฐœ์˜ ์•„์ด๋””์™€ ์ด๋ฆ„์„ ์กฐํšŒํ•˜๋Š” SQL๋ฌธ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ์ด๋•Œ ๊ฒฐ๊ณผ๋Š” ์ด๋ฆ„ ์ˆœ์œผ๋กœ ์กฐํšŒํ•ด์ฃผ์„ธ์š”. ๋‹จ, ์ด๋ฆ„์˜ ๋Œ€์†Œ๋ฌธ์ž๋Š” ๊ตฌ๋ถ„ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์˜ˆ์‹œ
์˜ˆ๋ฅผ ๋“ค์–ด ANIMAL_INS ํ…Œ์ด๋ธ”์ด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค๋ฉด

ANIMAL_IDANIMAL_TYPEDATETIMEINTAKE_CONDITIONNAMESEX_UPON_INTAKE
A355753Dog2015-09-10 13:14:00NormalElijahNeutered Male
A352872Dog2015-07-09 17:51:00AgedPeanutbutterNeutered Male
A353259Dog2016-05-08 12:57:00InjuredBjNeutered Male
A373219Cat2014-07-29 11:43:00NormalEllaSpayed Female
A382192Dog2015-03-13 13:14:00NormalMaxwell2Intact Male
  • ์ด๋ฆ„์— 'el'์ด ๋“ค์–ด๊ฐ€๋Š” ๋™๋ฌผ์€ Elijah, Ella, Maxwell 2์ž…๋‹ˆ๋‹ค.
  • ์ด ์ค‘, ๊ฐœ๋Š” Elijah, Maxwell 2์ž…๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ SQL๋ฌธ์„ ์‹คํ–‰ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋‚˜์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค.

ANIMAL_IDNAME
A355753Elijah
A382192Maxwell 2

๋ณธ ๋ฌธ์ œ๋Š” Kaggle์˜ "Austin Animal Center Shelter Intakes and Outcomes"์—์„œ ์ œ๊ณตํ•˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์˜€์œผ๋ฉฐ ODbL์˜ ์ ์šฉ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.

๋‚˜์˜ ํ’€์ด

SELECT ANIMAL_ID, NAME
FROM ANIMAL_INS
WHERE (NAME LIKE '%el%' OR '%EL%') AND ANIMAL_TYPE='Dog'
ORDER BY NAME

์ด๋ฆ„์— el ์ด ๋“ค์–ด๊ฐ€๋Š” (๋Œ€์†Œ๋ฌธ์ž๋Š” ๋ชจ๋‘ ํฌํ•จ) ๊ฐœ ๋ฅผ ์ด๋ฆ„์ˆœ์œผ๋กœ ์ •๋ ฌํ•ด ์กฐํšŒํ•จ

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ