Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Base Mysql.

Similar presentations


Presentation on theme: "Data Base Mysql."— Presentation transcript:

1 Data Base Mysql

2 접속하기 서버에 접속한다 DB접속하기 SSH Secure Shell 프로그램 이용 Host : et2.hknu.ac.kr
Id : t학번 Pwd : a <- 초기값 DB접속하기 mysql –uhk학번 -pa12345 hk학번 ex) mysql –uhk pa12345 hk

3 접속된 상태 mysql –uhk pa hk

4 Table Table 확인 mysql> show tables; 테이블 생성 CREATE TABLE test (
name VARCHAR (15), VARCHAR (25), hp VARCHAR(25), ID INT AUTO_INCREMENT, PRIMARY KEY (ID) );

5 Table 생성 확인

6 desc를 이용한 Table 확인

7 Table에 입력하기 #1 insert into test values ('이화', ' ', NULL);

8 Table에 입력하기 #2 insert into test(name,hp) values('lee wha', ' ');

9 Table에 친구 10명 등록하기 insert into test(name,email,hp)
values('lee sang wha', ' '); values('lee mi sook', ' '); values('kim wha jung', ' '); values('park min kyu', ' '); values('kim jung sook', ' '); values('choi min sang', ' ');

10 입력하기 Query

11 입력 확인 Query

12 SELECT문 사용하기 Ex) select * from test; select name from test;
SELECT [항목, 항목2 …] FROM [Table Name] WHERE [검색조건] Ex) select * from test; select name from test; select name, hp from test; select * from test where name='lee'; select * from test where name like 'lee%'; select * from test where name like 'lee%' or name like 'kim%'; select * from test where name like '%a%'; select * from test where name like 'lee%' and hp like '011%';


Download ppt "Data Base Mysql."

Similar presentations


Ads by Google