-
[5주차] 레코드 삭제, 수정, 검색25 - 1/데이터베이스 2025. 4. 23. 12:56
1. 이름이 '박지성'인 고객의 전화번호와 주민등록번호 검색
select phone, ssn
from client
where name = '박지성';
2. '성남지점'에서 계좌를 개설한 고객의 이름과 주소, 그리고 예금 잔액 검색select c.name, c.address, d.balance
from client c, deposit d
where c.ssn = d.ssn and branch_name = '성남지점'
order by name;
3. 예금 잔액이 10만원 이상인 계좌가 개설된 지점의 이름과 지점장 이름 검색select distinct d.branch_name, b.branch_head
from branch b, deposit d
where d.branch_name = b.branch_name and balance >= 100000;
4. 이름이 '김기식'인 고객이 소유한 예금의 계좌번호, 개설지점, 지점장, 잔액 검색select distinct b.branch_name, b.branch_head
from deposit d, branch b
where d.branch_name= b.branch_name and d.balance >= 100000
order by b.branch, b.branch_head;
5. 자신의 주소와 같은 지점에 계좌 소유하고 있는 고객의 이름과 예금 잔액 검색select c.name, d.balance
from branch b, client c, deposit d
where b.address = c.address and c.ssn = d.ssn and b.branch_name = d.branch_name;
6. 계좌가 없는 고객의 이름과 ssn, 전화번호를 검색하라. (집합연산)select name, ssn, phone
from client
minus'25 - 1 > 데이터베이스' 카테고리의 다른 글
06장 데이터베이스 설계 - 1 (0) 2025.06.03 [7주차] nested query, view 실습 (0) 2025.04.23 [6주차] join, aggregate 실습 (0) 2025.04.23 [4주차] 테이블 생성과 레코드 생성 (0) 2025.04.23 [3주차] 관계 대수 실습 (0) 2025.04.23