본문 바로가기
SQL

Oracle SQL

by Minius 2018. 2. 12.
반응형

demo_madang.sql


마당 SQL


select * from book; // * 모든 book 출력

select * from customer; // * 모든 customer 출력

select * from orders; // * 모든 orders 출력

select * from imported_book; // * 모든 imported_book 출력

select bookid, bookname from book where price >= 10000; // 10000원 이상 ~~ 출력

select bookid, bookname from book where bookname like '%축구%' and price <=10000;

select bookid, bookname from book where bookname like '축구%';

select name, address from customer;

select orderid, saleprice from orders;


DISTINCT 중복제거

SELECT DISTINCT PUBLISHER

FROM BOOK;


WHERE 조건





select * from book order by price desc; // 가격순 정렬 


INSERT INTO book VALUES (11,'기초자바정석3판','도우출판사',30000); //입력

update book set price = 40000 where bookid = '11'; //변경


delete from book where bookid ='11';


select distinct publisher from book;


select bookid, bookname from book where price not IN(10000,20000);


create table person(

    num number(2) primary key,

    name varchar2(20),

    phone varchar2(13)

    );

drop table person;

'SQL' 카테고리의 다른 글

View  (0) 2018.03.08
2018-03-07 SQL  (0) 2018.03.07
SQL 연습문제 답  (0) 2018.03.06
[SQL] DDL, DML이란?  (0) 2018.03.05
[SQL] p.193 연습문제  (0) 2018.03.02

댓글