일단 연습문제에 사용할 데이터 테이블은 이렇다.
더보기
SELECT department_name as "학과 명", category "계열"
FROM TB_department;
더보기
SELECT department_name || '의 정원은 ' || capacity || '명 입니다' as "학과별 정원"
FROM TB_department;
더보기
SELECT student_name
FROM TB_STUDENT
where department_no = 001 and absence_yn = 'Y' and student_ssn LIKE '_______2%';
더보기
SELECT student_name
FROM TB_STUDENT
where student_no in ('A513079', 'A513090', 'A513091', 'A513110', 'A513119');
더보기
Between A and B 사용
select department_name, category
from TB_department
where capacity between 20 and 30;
비교 연산자와 논리 연산자 사용
select department_name, category
from TB_department
where 20 <= capacity and capacity <= 30;
더보기
select professor_name
from TB_professor
where department_no is Null;
더보기
select student_name
from TB_student
where department_no is null;
더보기
select class_no, class_name
from TB_class
where preattending_class_no is not null;
더보기
select distinct category
from TB_department;
더보기
select student_no, student_name, student_ssn
from TB_student
where Entrance_date like '02%' and absence_yn = 'N' and student_address like '전주%';
반응형
'SK 행복성장캠퍼스 > SQL' 카테고리의 다른 글
2020-09-09, SQL_2일차_연습문제 (0) | 2020.09.10 |
---|---|
2020-09-09, SQL_2일차 (0) | 2020.09.10 |
2020-09-08, SQL_1일차 (0) | 2020.09.09 |
2020-09-07, oracle db, sql developer 설치하기 (0) | 2020.09.08 |
2020-09-08, Oracle SQL 사전테스트 (답 없음) (0) | 2020.09.08 |
댓글