본문 바로가기
728x90
반응형

테이블 생성3

oracle sql 2. 서브 게시판 테이블 (1) 테이블 생성(고유번호,한줄내용, 패스워드, 글쓴이,등록일, 본문 고유번호)create table subBoard(unq number(9) not null,pwd varchar2(20) not null,name varchar2(10),comm varchar2(100),rdate timestamp,cUnq number(9)); select unq,title,writer,rdate,(select count(*) from subBoard where cUnq=a.unq) subCnt from (select rownum rm,unq,title, writer,rdate from (select unq,title,writer,rdate from board order by unq desc).. 2015. 9. 25.
oracle sql 1. create table board(unq number(5) not null,title varchar2(30) not null,pwd varchar2(30) not null,writer varchar2(30) not null,content varchar2(200),hit number(5));rdate timestamp); 2. insert into board values('1','aaa','1234','aaa1','sodan','',sysdate); 3. select *from board order by rdate desc;4.select *from board where title like '%a2%' or content like '%a2%'; 5.select *from board where to_c.. 2015. 9. 24.
mysql 테이블생성(create),테이블 삭제(drop), 데이터 삽입(insert), 데이터 출력(select),데이터 갯수출력(count) 1. 접근 ]$ mysql -u아이디 -p패스워드 DBName ]$ mysql -uschool -p1234 school (enter) ---------------------------------------------------------- show tables; // 테이블 목록 출력 -테이블 생성- 기본형 - create table [테이블 명](필드명 타입); create table a ( id varchar(50), name varchar(20) ); (enter) desc a; (enter) //나열 -데이터 삽입- 기본형-insert into [테이블명](필드명) values(데이터); insert into a(id,name) values('test1','tv'); (enter) -데이터 출력-.. 2015. 8. 4.
728x90
반응형