일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- mysql
- 자바스크립트
- 프로그래머스
- SQL
- 스프링부트 채팅서버
- pygame
- java8
- oauth2
- 스프링
- kotlin 클래스
- Leetcode
- LeetCode SQL
- 오라클
- springboot
- python
- oracle
- spring boot
- 코틀린 클래스
- 파이게임
- MSA
- Spring
- 스프링부트
- javascript
- 구글로그인
- 자바8
- 자바 스트림
- SQL 문제풀이
- SQL프로그래머스
- 스프링시큐리티
- js
- Today
- Total
목록SQL (30)
웅겹살의 프로그래밍 삼매경

저장 프로시저 (Stored Procedure) 프로시저는 SQL Server에서 제공되는 프로그래밍 기능이며, 쿼리 문의 집합체라고 볼 수 있다. 간단하게로는 SELECT, INSERT, UPDATE, DELETE 등의 DQL, DML을 사용할 수 있으며, 조금 더 나아가서 IF 문이나 DECLARE, SET 등의 프로그래밍 문법을 사용할 수도 있다. ⚡ 장점 보안성 향상 프로시저 단위로 실행 권한을 부여할 수 있기 때문에, 기본적인 보안 사고에 대처가 유연한 편이다. 네트워크 소요 시간 절감 쿼리를 다중으로 실행하는 경우, 한번의 호출을 통해 다중의 쿼리가 실행되기 때문에 네트워크에 대한 부담과 소요 시간을 줄일 수 있다. 운영 배포 용이성 별도의 WAS 서버 재기동 없이 SP 수정으로 조회, 수정,..

⚡ 힌트의 쓰임과 사용방법 힌트를 사용하여 아래와 같은 것들을 할 수 있다 액세스 경로, 조인 순서, 병렬 및 직렬 처리, Optimizer의 목표(Goal)를 변경 가능 데이터 값을 정렬해야 하는 경우, 힌트의 사용이 필요 또한, 드라이빙 테이블을 원하는 대로 선정하고자 할 때도 사용 -- 모든 힌트의 기본 사용법은 쿼리 서두에 힌트를 명시하는 것이다. 예를 들어 아래와 같다. -- index_asc, index 힌트 : 인덱스 영역에서 순방향으로 스캔 하라는 뜻 SELECT /*+ index_asc(e idx_myemp1_ename) */ EMPNO, ENAME, SAL FROM MYEMP1 e WHERE ENAME >= '가' -- (앞부분에 +기호가 붙는다는 점에서 주석과의 차이 유의) 🔥 OPT..

postgreSQL DB | 데이터베이스 확인 select * from pg_catalog.pg_namespace; postgreSQL schema | 스키마 확인 select * from pg_catalog.pg_tables; postgreSQL DB, schema | 특정 스키마, 데이터베이스 조회 SELECT * FROM pg_catalog.pg_tables WHERE schemaname = 'public' AND tablename LIKE 'Weath%'; postgreSQL diagram Visualization | 우클릭으로 Diagram Visualization 확인 (DATAGRIP) postgreSQL table | 테이블명 변경 alter table "1.book2" rename ..

Github에 잘 못 올라간 특정 폴더 삭제하는법 만약 삭제할려는 폴더의 이름이 removedDir 라하고 삭제 방법을 적어봤다. 1. git bash를 킨다. 2. 해당 리포(repo)를 clone 한다. 3. git rm -r --cached removedDir 4. git commit -m "해당 디렉토리를 삭제했습니다" 5. git push origin master(master나 사용중인 브랜치명)

row 를 array 또는 string으로 변환하기 1. unnest() 는 array 데이터를 row로 변환 unnest 결과는 하단의 내용과 같다 2. array_agg, array_agg_string 적용 결과는 하단의 내용과 같다 array_agg 는 group by와 함께 사용하는 함수이다. group by 된 값들을 array로 반환. distinct 와 order by 를 함께 이용하면 중복제거된 값을 구하거나, 원하는 순서로 정렬하여 array를 만들 수 있다. ex : array_agg(distinct col2 order by col2) -- 임시테이블 생성하여 테스트진행 with make_array as ( select unnest(array['고기', '고기', '고기', '채소', ..

https://programmers.co.kr/learn/courses/30/lessons/59044 코딩테스트 연습 - 오랜 기간 보호한 동물(1) ANIMAL_INS 테이블은 동물 보호소에 들어온 동물의 정보를 담은 테이블입니다. ANIMAL_INS 테이블 구조는 다음과 같으며, ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE는 각각 동물의 아이디 programmers.co.kr mySql SELECT I.NAME, I.DATETIME FROM ANIMAL_INS AS I LEFT JOIN ANIMAL_OUTS AS O ON I.ANIMAL_ID = O.ANIMAL_ID WHERE I.ANIMAL_ID NOT IN (..

https://leetcode.com/problems/rank-scores/ Rank Scores - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com -- MYSQL SELECT score , DENSE_RANK() OVER (ORDER BY score DESC ) 'rank' FROM Scores; -- ORACLE SELECT score , DENSE_RANK() OVER (ORDER BY score DESC ) as rank FROM Scores;

https://leetcode.com/problems/department-highest-salary/ Department Highest Salary - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 부서별 salary가 가장높은 친구들 뽑기

https://leetcode.com/problems/nth-highest-salary/ Nth Highest Salary - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 함수(Function) 문제가 나타났다 Mysql Oracle

https://leetcode.com/problems/second-highest-salary/ Second Highest Salary - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com salary가 2번째로 높은친구 뽑기 예외조건은 row가 1개일경우 null 출력 MYSQL Oracle