일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 안드로이드 바탕화면
- 안드로이드 2.0 개발
- 스카이 안드로이드폰 시리우스
- 아이폰 바탕화면
- 아이폰 배경화면
- 하루 한마디 영어
- 안드로이드 개발
- 영어
- 구글안드로이드
- 구글 안드로이드
- 구글 안드로이드 개발
- 안드로이드
- android
- 안드로이드 개발 2.0
- 안드로이드폰
- Form Stuff
- 인기있는 블로그 만들기
- MapView
- 안드로이드2.0
- 하루한마디영어
- SKY 시리우스
- 스마트폰 배경화면
- 안드로이드개발
- 안드로이드 배경화면
- objective-c
- 안드로이드2.0개발
- 스카이 안드로이드폰 시리우스 K양 동영상
- sky 시리우스폰
- 안드로이드 개발 2.0 강좌
- 안드로이드 개발 강좌
- Today
- Total
moozi
9/12 sql 본문
-- database 생성
create database sampledb;
-- database선택
use sampledb;
-- table생성
create table student(
id char(7) primary key,
name varchar(10) not null,
dept varchar(20) not null
);
-- 데이터입력
insert into student values('1091011','김철수','컴퓨터시스템');
insert into student values('0792012','최고봉','멀티미디어');
insert into student values('0494013','이기자','컴퓨터공학');
-- 조회
select * from student;
create table books(
no char(6) primary key, -- 책번호
title varchar(50) not null, -- 책이름
author varchar(50) not null -- 저자
);
insert into books values('000001','오라클기본','이황');
insert into books values('000002','자바정복','율곡');
insert into books values('000003','HTML5','강감찬');
select * from books;
-- 책대여
drop table bookRent;
create table bookRent
( no char(10) primary key, -- 대여번호
id char(10) not null, -- 학번
bookNo char(6) not null, -- 책번호
rDate char(8) not null ,-- 대여일
constraint fk_bookrent foreign key(id)
references student(id)
);
insert into bookRent values('2017071301','2018001','000001','20170713');
insert into bookRent values('2017071302','2018002','000003','20170713');
insert into bookRent values('2017071303','2018003','000003','20170713');
insert into bookRent values('2017071304','0792012','000001','20170713');
insert into bookRent values('2017071305','0792012','000003','20170713');
insert into bookRent values('2017071306','1091011','000003','20170713');
-- 학번, 학생이름, 책이름, 대여일
select s.id, s.name, b.title, br.rDate
from student s, books b, bookRent br
where br.id=s.id
and br.bookNo=b.no;
select s.id, s.name, b.title, br.rDate
from student s, books b, bookRent br
where br.id=s.id and br.bookNo=b.no
and s.dept='컴퓨터시스템'
order by b.no;
'TIS_2018 > 응용sw2018_2기' 카테고리의 다른 글
9/12 haksa (0) | 2018.09.12 |
---|---|
9/12 haksa menu - Haksa.java (0) | 2018.09.12 |
bookRent (0) | 2018.09.12 |
자바연습문제18 (0) | 2018.09.11 |
9/11 haksa (0) | 2018.09.11 |