본문 바로가기

전체 글191

23.04.11 flowchart - 알고리즘이나 프로그램의 논리 혹은 흐름을 그림으로 표현하는 방법 직선형, 분기형, 반복형이 있다. 조건문 형태 if (조건식) { 조건식의 결과가 참일 때 실행하고자 하는 문장; } if (조건식) { 조건식의 결과가 참일 때 실행하고자 하는 문장; } else { 조건식의 결과가 거짓일 때 실행하고자 하는 문장; } if (조건식1) { 조건식1의 결과가 참일 때 실행하고자 하는 문장; } else if (조건식2) { 조건식2의 결과가 참일 때 실행하고자 하는 문장; } else { 조건식1의 결과도 거짓이고, 조건식2의 결과도 거짓일 때 실행하고자 하는 문장; 즉, 위의 어느 조건식에도 만족하지 않을 때 수행 } if (조건식1) { 조건식1의 결과가 참일 때 실행하고자 하는 .. 2023. 4. 11.
23.04.10 변수 선언 - 변수타입 변수이름; ex) int age; / char grade; / double score, point; - my_name이나 myName 과 같은 형태의 이름으로 선언 변수의 종료 - 클래스, 인스턴스, 지역 변수 class Variable1_4 { static int classVal = 100; // 클래스 변수 int instanceVal = 200; // 인스턴스 변수 public static void main(String[] args) { int num; // 지역 변수 // System.out.println("int = " + num); // Error 발생 num = 300; System.out.println("int = " + num); // 100 // 인스턴스 변수 /.. 2023. 4. 11.
23.04.07 subquery(query문 안에 들어가는 query문)사용법 (tab키를 이용해 들여쓰기 신경쓰기) 1. where 문에서 이용 SELECT * from users u WHERE user_id in ( select user_id from orders o WHERE payment_method = 'kakaopay' ) 2. select 문에서 이용 select checkin_id, user_id , likes, ( select avg(likes) from checkins c where user_id = c.user_id ) as avg_likes_user from checkins 3. inner join 문에서 이용 select pu.user_id, pu.point from point_users pu i.. 2023. 4. 7.
23.04.07 1. fetch를 통해 데이터 가져오기 fetch("데이터를 가져올 url').then(res => res.json()).then(data => { console.log(data) }) ex) fetch("http://spartacodingclub.shop/sparta_api/seoulair").then(res => res.json()).then(data => { let rows = data['RealtimeCityAir']['row'] rows.forEach((a) => { console.log(a['MSRSTE_NM'],a['IDEX_MVL']) }); }) fetch와 JQuery에 대해 배운 내용을 같이 활용하여 쓴 것 뿐인데도 코드가 복잡해진 기분이 든다 이전에 만들었던 코드를 참고하며 어찌저찌.. 2023. 4. 7.