둘 다 특정 기준으로 데이터를 그룹화하고, 집계하는 함수라고 생각했는데 뭐가 다른걸까?참고: https://kimsyoung.tistory.com/entry/GROUP-BY-vs-PARTITION-BY-%EC%9C%A0%EC%82%AC%EC%A0%90%EA%B3%BC-%EC%B0%A8%EC%9D%B4%EC%A0%90 GROUP BY vs. PARTITION BY: 유사점과 차이점윈도우 함수는 SQL의 유용한 기능 중 하나입니다. 윈도우 함수를 잘 사용할 줄 안다면 여러분의 인생은 보다 편안해질 것입니다. 이 글에서는 GROUP BY와 PARTITION BY의 차이점을 살펴보고자 합니다. Pkimsyoung.tistory.com 이 블로그에서 자세히 다뤄서 여기서 보는게 나은듯 하다 결론:GROUP BY는..
이 쿼리를 보면 full table scan이다 처음 행부터 마지막 행까지 다 본다 단점: slow Indexing이라는 것이 있으면 전체 체크를 안해도 빠르게 찾을 수 있다 most of database has this index 이런 느낌으로 index가 있으면 전체 데이터를 안 탐색하고 빠르게 찾을 수 있다 index is not bianry tree It is B-Tree Duration: Query를 처리하는 시간 Fetch: Result를 가져와서 보여주는 시간 EXPLAIN SELECT * FROM employees WHERE last_name = 'Peron'; EXPLAIN 키워드를 추가하면 추가적인 정보를 얻을 수 있다 possible_keys: 이 쿼리에 적합한 index 목록 key..
Referential Actions ON DELETE CASCADE ON DELETE NO ACTION ON DELETE RESTRICT ON DELETE SET NULL ON DELETE DEFAULT ON DELETE CASCADE ON DELETE SET NULL Referential Actions은 referencing하는 테이블에서 건다 CREATE TABLE employee( empno int NOT NULL, empname varchar(45), title varchar(45) DEFAULT '사원', manager int, salary int, dno int, CONSTRAINT UQ_empname UNIQUE (empname), CONSTRAINT CH_salary CHECK (salar..
QUIZ Query 1: HOW many languages are spoken in the USA? SELECT CountryCode, COUNT(Language) FROM countrylanguage WHERE CountryCode='USA'; Query2: Count how many languages are in the world SELECT COUNT(DISTINCT Language) AS languages FROM countrylanguage; INTERMEDIATE DDL MySQL constraints UNIQUE CHECK DEFAULT DEFAULT는 title VARCHAR(45) DEFAULT '사원' UNIQUE는 CONSTRAINT UP_empname UNIQUE(empnam..
Data Definition Language DDL: 데이터베이스 구조를 다루는 언어 Statements CREATE //생성 DROP //삭제 ALTER //변경 TRUNCATE //데이터만 삭제 Database SQL CREATE DATABASE testDB; DROP DATABASE testDB; SHOW DATABASES; USE testDB; Relation SQL CREATE TABLE department( deptno INT NOT NULL, deptname VARCHAR(45) NOT NULL, floor INT CONSTRAINT PK_Deptno PRIMARY KEY(deptno) ); DROP TABLE department; TRUNCATE TABLE department; ..
용어 정리 relation == table tuple == row == record attribute == column degree: attribute의 수 5 cardinality: 튜플의 수 4 degree는 1이상이어야한다 cardinality는 0 일 수 있다 null value null은 0이 아니다 null != empty space or blank characteristic of relatoin 같은 이름을 가진 relaiton은 존재할 수 없다 attribute도 마찬가지 key is an attribute types of keys super key candidate key primary key alternate key foreign key super key: uniq..
Data: 컴퓨터에서 보낼 수 있고 저장돼있는 파일들 Database: an organized collection of data 구조를 가진 데이터의 모임 Data Model: 데이터를 저장, 연결, 접근하는 방식을 설명하는 것 ex) Realtional Model, Object-Oriented Model ... relation==table DBMS(Database Manament System) : A software designed to store, retrieve, define, and manage data in a database 데이터베이스의 데이터를 다루는 소프트웨어 ex) Oracle, MySQL, MongoDB ... Query: 질의 dbms에서 어떤 정보를 요..
- Total
- Today
- Yesterday
- infcon 2024
- 프로그래머스
- authorization_code
- CSS
- DDL
- 로스트아크 캐릭터
- 인프콘2024
- authorization code
- bfs
- DML
- git 예전 커밋 수정
- 데이터베이스
- oauth
- 우분투
- html
- javascript
- 리눅스
- 데이터3법
- kloa
- git commit 수정
- SQL
- SpringBoot
- git
- 2024인프콘
- Android Studio
- html #웹 #웹사이트 #플레이리스트
- 오픈소스
- 데이터 3법
- oauth2.0
- 클로아
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |