튜플 정렬하기 | Ordering the Display of Tuples select distince name from instructor where TRUE order by name order by name (asc) => 튜플들을 알파벳 오름차순(디폴트)(123,abc)으로 정렬해 보여줌 order by name desc => 내림차순으로 정렬 order by dept_name, name => 복수개의 컬럼으로 정렬 가능 (앞에꺼로 1차정렬, 겹치는거 대해 2차) order by dept_name asc, name asc 만약 select에 없는 걸 order by에 썼다면, 정렬부터 하고 select하게 됨 (select는 항상 마지막) |
where절 술부 | Where 절의 술부 – 범위질의 between, Tuple comparison ( , ) = ( , ) where salary between 90000 and 100000 => 90000 <= salary <= 100000 //이상, 이하. 포함함 where (instructor.ID, dept_name) = (teaches.ID, ‘Biology’); => 각각의 인덱스끼리 [ i ] 같은게 조건 |
'데이터베이스설계' 카테고리의 다른 글
[데이터베이스설계] 3-6 집계함수, group by (0) | 2024.11.25 |
---|---|
[데이터베이스설계] 3-5 set 연산, null값 (1) | 2024.11.24 |
[데이터베이스설계] 3-3 rename 연산, string 연산 (0) | 2024.11.22 |
[데이터베이스설계] 3-2 where절, from절 (0) | 2024.11.21 |
[데이터베이스설계] 3-1 기본 쿼리 구조, select절 (1) | 2024.11.20 |