반응형

오라클 DBMS MySQL Workbench 설치는 아래 참고

https://ansan-survivor.tistory.com/1130

 

[MySQL] MySQL windows 10에 설치하기 환경 세팅하기, 오라클 DBMS 설치하기

기본 요구사항 Windows 10 64 bit. (win7은 MySQL 8.0.3 rc버전) (32bit는 MySQL 5.7.x 버전) 1. 아래 공식 다운로드 페이지에서 다운로드 https://downloads.mysql.com/archives/community/?version=8.0.17 MySQL..

ansan-survivor.tistory.com

 

 

새로운 Table을 생성 한 후, 다른 Database에서 table을 가져온다.

 (SQL 코드)

CREATE TABLE indexTable
	(first_name varchar(14), last_name varchar(16), hire_date date);
	INSERT INTO indexTable
		SELECT first_name, last_name, hire_date
        FROM employees.employees
        LIMIT 500;
        
SELECT * FROM indexTable

1. indexTable 이라는 테이블을 새로 생성.

2. 생성한 indexTable에 INSERT (데이터 삽입). employees 데이터베이스 내의 employees 테이블을 불러옴. 500개 까지

3. indexTable에서 전체( * ) 선택

 

4. 특정 데이터를 WHERE 문으로 뽑아내기

CREATE TABLE indexTable
	(first_name varchar(14), last_name varchar(16), hire_date date);
	INSERT INTO indexTable
		SELECT first_name, last_name, hire_date
        FROM employees.employees
        LIMIT 500;
        
SELECT * FROM indexTable WHERE first_name = 'Mary';

indexTable 테이블 내의 first_name 내에 Mary 라는 사람의 정보를 찾기

 

 

반응형

+ Recent posts