Banner

My Tech Blog (์ฝ”ํ…Œ)

๐Ÿ“‘ 1. ๋ฌธ์ œ์„ค๋ช…โŒ 2. ์‹คํŒจํ•œ ์‹œ๋„์ฝ”๋“œ๋Š” ์ž‘๋™ํ•˜์ง€๋งŒ ์ •๋‹ต ์ฒ˜๋ฆฌ X์ด์œ : CAR_ID ์ค‘๋ณต๋จSELECT A.Car_idFROM Car_rental_company_car A JOIN Car_rental_company_rental_history B ON A.Car_id = B.Car_idWHERE A.Car_type = '์„ธ๋‹จ' AND B.Start_date BETWEEN '2022-10-01' AND '2022-10-31'ORDER BY A.Car_id DESC;โญ 3. ์ •๋‹ต์ฝ”๋“œCAR_ID ์ค‘๋ณต์ด ์—†์–ด์•ผ ํ•˜๋ฉฐ -> DISTINCT๋Œ€์—ฌ ๊ธฐ๋ก์ด ์žˆ๋Š” -> ON A.CAR_ID = B.CAR_IDSELECT DISTINCT(A.Car_id)FROM ..
๐Ÿ“‘ 1. ๋ฌธ์ œ์„ค๋ช…โญ 2. ์ •๋‹ต์ฝ”๋“œ์ถœ๊ณ ์ผ์ด 2022-05-01 ๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์œผ๋ฉด '์ถœ๊ณ ์™„๋ฃŒ'๋Šฆ์œผ๋ฉด ์ถœ๊ณ  ๋Œ€๊ธฐ, ์—†์œผ๋ฉด ์ถœ๊ณ  ๋ฏธ์ •์ด๊ณ  ํ•ด๋‹น ์ปฌ๋Ÿผ๋ช…์€ ์ถœ๊ณ ์—ฌ๋ถ€๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ์„ค์ •์–ด๋ ค์šด ๋ถ€๋ถ„์€ ์—†๋Š” ์‰ฌ์šด ๋ฌธ์ œ๐ŸฅณSELECT Order_id, Product_id, DATE_FORMAT(Out_date,'%Y-%m-%d') AS Out_date, CASE WHEN Out_date '2022-05-01' THEN '์ถœ๊ณ ๋Œ€๊ธฐ' ELSE '์ถœ๊ณ ๋ฏธ์ •'END AS ์ถœ๊ณ ์—ฌ๋ถ€FROM Food_orderORDER BY Order_id;
๐Ÿ“‘ 1. ๋ฌธ์ œ์„ค๋ช…โญ 2. ์ •๋‹ต์ฝ”๋“œSELECT Animal_id, name, CASE WHEN Sex_upon_intake LIKE '%Neutered%' OR Sex_upon_intake LIKE '%Spayed%' THEN 'O' ELSE 'X' END AS ์ค‘์„ฑํ™”FROM ANIMAL_INSORDER BY ANIMAL_ID; ๐Ÿ˜Š 3. TMIANSI SQL ํ‘œ์ค€์—์„œ๋Š” ALIAS ์— ์ž‘์€๋”ฐ์˜ดํ‘œ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ํ—ˆ์šฉ๋˜์ง€ ์•Š์ง€๋งŒ ์จ๋„ ์ƒ๊ด€์€ ์—†๋‹ค. (๋‚˜๋Š” ๋”ฐ์˜ดํ‘œ ์ผ์Œ)SELECT Animal_id, name, CASE WHEN Sex_upon_intake LIKE '%Neutered%' ..
๐Ÿ“‘ 1. ๋Œ€์†Œ๋ฌธ์ž ๋ฐ”๊ฟ”์„œ ์ถœ๋ ฅํ•˜๊ธฐimport java.util.Scanner;public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); System.out.println(swapCase(a)); } public static String swapCase(String str) { StringBuilder result = new StringBuilder(); for(char c:str.toCharArray()) { if(Character.isUpperCase(c) ) { resu..
์ธ์ ˆ๋ฏธ์˜€๋˜๊ฒƒ
'์ฝ”ํ…Œ' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก
์ƒ๋‹จ์œผ๋กœ