분류 전체보기
-
데이터 베이스 _ 뷰(view)SQL/sql 문법(mysql, mariaDB) 2024. 5. 13. 09:31
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ 뷰(view)뷰(view)란 데이터 베이스에 존재하는 가상의 테이블을 말한다. 뷰를 이용해서 실제 테이블처럼 행과 열을 가지고 있지만, 데이터를 저장하고 있지 않는다.✨장점보안 강화 ) 특정 사용자에게 테이블 전체가 아닌 필요한 자료만 보여줄 수 있다.복잡한 쿼리를 단순화해서 사용할 수 있다.독립성 확보) 사용한 쿼리를 재사용할 수 있다.논리적 테이블을 만들기때문에 메모리 절감 효과가 있다.✨ 단점삽입, 삭제, 갱신 작업에 많은 제한 사항을 가진다자신만의 인덱스를 가질 수 없다.⌨ 형식CREATE [or REPLACE] VIEW [view_name] AS SELECT문;DRO..
-
다중 행 서브쿼리 : ANY, ALL, EXISTS (+ subquery와 join)SQL/sql 문법(mysql, mariaDB) 2024. 5. 9. 14:43
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ subquery VS join💻 코드로 보기총무부에 근무하는 직원들이 관리하는 고객 출력하기joinSELECT gogek_no, gogek_name, gogek_tel FROM gogekINNER JOIN jikwon ON jikwon.jikwon_no = gogek_damsanoINNER JOIN buser ON buser_num = buser_noWHERE buser_name='총무부'; subquerySELECT gogek_no, gogek_name, gogek_tel FROM gogek WHERE gogek_damsano IN (SELECT jikwon_no FROM jik..
-
COCOMO 모형정보처리기사/개념 2024. 5. 9. 06:49
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ COCOMO 모형의 개요✒️COCOMO (COnstructive COst MOdel)모형보헴(boehm)이 제안했다.원시 프로그램의 규모인 LOC(원시 코드 라인 수)에 의한 비용 산정 기법이다.작은 프로젝트들을 통해 분석 결과를 반영한 모델이므로 중소 규모 소프트웨어 프로젝트 비용 추정에 적합하다.비용 산정 결과는 프로젝트를 완성하는데 필요한 노력(Man-Month)로 나타난다.특징비용 예측 : 시스템 크기로 예측한다.(LOC,DSI)의존성 : 소프트웨어 속성(조직, 반분리, 내장)에 의존유연성 : 프로젝트의 여러 특성을 고려할 수 있도록 융통성 부여이용성 : 현재까지 소프트웨어 비용 측정 중 가장 이해하기 쉬운 실험..
-
subquery _ 상관쿼리( correlated subquery )SQL/sql 문법(mysql, mariaDB) 2024. 5. 8. 18:21
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스지난번 subquery에대해 정리를 했다.서브쿼리란 쿼리 안에 다른 쿼리가 들어간 것을 의미한다.밖의 쿼리는 outer 쿼리, 메인쿼리라고 하며 안쪽 쿼리는 inner 쿼리, 서브쿼리라고 한다. 지금까지는 메인 쿼리가 실행되다가 서브쿼리의 반환값을 가져와 쿼리가 진행되었다.✔ 상관(연관) 관계가 있는 서브쿼리( correlated subquery )내부 쿼리가 외부쿼리에서 얻은 정보에 의해 실행되는 쿼리가 있다.이와 같이 상관관계가 있는 서브쿼리가 있다.상관쿼리는 서브쿼리 단독으로 실행할 수 없다.상관관계가 있는 서브쿼리 또한 SELECT, WHERE, FROM문에 사용된다. ⌨ 실행되는..
-
mariaDB) 내장 함수 정리SQL/sql 문법(mysql, mariaDB) 2024. 5. 7. 13:53
▤ 목차">HTML 삽입미리보기할 수 없는 소스✔ 1. 문자형 함수⌨ substr (문자 자르기)SELECT SUbstr('hello World',3) FROM DUAL; SELECT SUbstr('hello World',3,6) FROM DUAL; SELECT SUBstr('hello World',-3,2) FROM DUAL; SELECT SUBstr(jikwon_name,2) FROM jikwon WHERE jikwon_no ⌨ 데이터 문자열 길이 lengthSELECT LENGTH('hello') FROM DUAL; ⌨ 특정 문자 위치 찾기 instrselect instr('hello','e') FROM DUAL; ⌨특정 문자 채우기 LPAD/RPA..
-
2.JOIN _ inner, outer (+ on과 where의 차이)SQL/sql 문법(mysql, mariaDB) 2024. 5. 6. 15:16
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ INNER JOIN일치하는 데이터만 나온다. null 값이 있다면 포함하지 않는다.있는 자료를 기준으로 진행한다.위의 사진처럼 교집합의 값을 가져온다.⌨ 형식SELECT [COLUMN 목록] FROM [테이블1] INNER JOIN [테이블2] ON [조인 조건]WHERE [검색 조건]💻 코드로 보기# oracle 방식SELECT jikwon_no, jikwon_name, buser_name FROM jikwon,buserWHERE buser_num =buser_no;SELECT jikwon.jikwon_no, jikwon.jikwon_name, buser.buser_na..
-
1. JOIN _ CROSS JOIN, SELF JOIN, EQUI JOINSQL/sql 문법(mysql, mariaDB) 2024. 5. 4. 09:12
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 한 개 이상의 테이블 들을 연결 또는 결합하여 데이터를 출력하는 방법이다. JOIN은 관계형 데이터베이스의 가장 큰 장점이면서 대표적인 핵심 기능이라고 할 수 있다. 일반적인 경우 행들은 PRIMARY KEY(PK)나 FOREIGN KEY(FK) 값의 연관에 의해 JOIN이 성립된다. 2개의 테이블이 존재할 때, 공통된 열을 통해 2개의 테이블을 합치는 것을 말한다. JOIN의 종류CROSS JOINSELF JOINEQUI JOININNER JOINOUTER JOIN✔ cross join두 개의 테이블 사이에 모든 가능한 조합을 만들어낸다.💻 코드로 보기SELECT j..