Practice makes perfect

[Python] SQLite 연동 본문

Anaconda/Python

[Python] SQLite 연동

kerpect 2020. 7. 30. 18:24

SQLite

: Oracle 데이터 베이스와 동일하게 table 형태로 데이터를 저장해주고, 매우 가볍기 때문에 스마트 폰이나 메모리가 적은 곳에서 많이 이용되는 데이터 베이스입니다. 

 

www.sqlite.org/download.html

 

SQLite Download Page

Templates (1) and (2) are used for source-code products. Template (1) is used for generic source-code products and templates (2) is used for source-code products that are generally only useful on unix-like platforms. Template (3) is used for precompiled bi

www.sqlite.org

 

spqlte-tools-win32-x86-3320300.zip 을 다운받아주세요

 

 

압축을 풀고 sqlite3.exe를 관리자 권한으로 실행해주세요.

 

 

 이러한 화면이 출력 됩니다. 특정 계정으로 로그인 하지 않아도 작업할 수 있습니다. 

 

 

- 테이블 생성

: sqlite>create table phonebook (name char(32), phone char(32), email char(64) primary key); 

: sqlite> .schema phonebook

문자형 - char 

 

 

- 레코드 추가

: sqlite>insert into phonebook (name, phone, email)

 

- 데이터 확인 

: sqlite>select * from phonebook;

 

- 데이터 수정

: update

 

- 데이터 삭제

: drop

- 테이블 삭제

 

 

파이썬 – SQLite 연동 절차 - in pycharm 

 

 

1) 테이블 생성

 

2) 데이터 입력 

 

 

3)  데이터 출력 

 

4) 데이터 수정 

 

5) 데이터 삭제 

* tuple의 자료일 때 하나만 입력하려 (,)를 통해서 가능