본 포스팅은 SQLite Database를 사용하면서 스스로 연습하고자 아래 공식 튜터리얼을 참고하며 만든다.
https://www.sqlitetutorial.net/
SQLite Tutorial - An Easy Way to Master SQLite Fast
This SQLite tutorial teaches you everything you need to know to start using SQLite effectively. You will learn SQLite via extensive hands-on practices.
www.sqlitetutorial.net
먼저 SQL을 사용하기 위해서는 다운로드를 해야 한다.
필자의 OS는 윈도우10 이며, 이곳에 설치를 하여 사용하도록 한다.
1. SQL을 다운로드 한다. 아래 링크에 들어가서 Window버전으로 다운로드 한다.
https://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

2. 다운로드가 다되면 압축을 풀고, 내부에는 exe 실행 파일 3개만 있을 것이다.
필자의 경우 C드라이브 아래 _sqlite 폴더를 만들고 옮겼다. 여기서 sqlite3.exe 파일을 앞으로 실행하여
데이터베이스를 구동시킬것이다.

3. SQLite 실행해보기
윈도우 cmd창을 연다.

4. 명령어 cd를 이용하여 아까 만든 폴더의 디렉터리로 이동한다.
처음에는 본인 home디렉터리에 위치해 있는데, <cd ..> 명령어를 이용하여 C: 까지 뒤로간다.

그리고나서 아까 만든 디렉터리 위치로 이동한다. (윈도우 창에서 복사하여 붙여넣기하면 편리하다)

5. 해당 위치에서 잘 들어왔는지 <dir> 명령어를 이용해서 디렉터리들을 확인해본다.
(아래와 같이 sqldiff.exe , sqlite3.exe, sqlite3_analyzer.exe 파일 3개가 들어있음을 확인한다)

6. 이제 여기서 SQLITE를 실행이 되는지 테스트 해본다.
실행 방법은 간단한다. 위 Tutorial에서 제공해주는 테스트 db파일을 동일 위치에 옮겨주고, (아래 첨부)

그리고 아래와 같이 실행해본다. >sqlite3.exe [db파일 이름]
>sqlite3.exe chinook.db
그럼 오류 메세지 없이 sqlite> 으로 뜨면, db파일 내부로 들어온 것이다.

7. db내 어떤것이 있는지 확인해본다.
>.table 을 입력한다.


8. 종료하기 위해서는 .quit 을 입력하면 된다.

<UI를 이용해 손쉽게 table생성하기>
https://ansan-survivor.tistory.com/724
[SQLite] SQLite 설치 및 데이터베이스(db) 테이블 생성하기
SQL 테이블을 코딩없이 UI로 손쉽게 db파일을 생성할 수 있다. 아래 사이트에서 SQLite를 설치한다. https://sqlitebrowser.org/dl/ Downloads - DB Browser for SQLite (Please consider sponsoring us on Patreo..
ansan-survivor.tistory.com
<SQL 내 테이블 변경하기>
https://ansan-survivor.tistory.com/88
SQLite 테이블 이름 바꾸기(table rename)/ 테이블 내 Column(title)추가
기존 table내 RES라는 이름을 RESS으로 바꾸기. sqlite> alter table [기존테이블명] rename to [바꿀테이블명]; 테이블 내 column (title) 추가하기 (class라는 title을 추가함) sqlite> alter table [테이블명..
ansan-survivor.tistory.com
<SQL db를 윈도우 ODBC와 연결 시키기>
https://ansan-survivor.tistory.com/725
[SQLite] SQL 데이터베이스(db)를 Window ODBC와 연결시키기
아래 포스팅은 SQLite로 간단한 db (데이터베이스)를 생성했다. https://ansan-survivor.tistory.com/724 [SQLite] SQLite 설치 및 데이터베이스(db) 테이블 생성하기 SQL 테이블을 코딩없이 UI로 손쉽게 db파일을..
ansan-survivor.tistory.com
<CSV파일 (엑셀정보)를 SQL 테이블로 불러오기>
https://ansan-survivor.tistory.com/727
[SQLite] csv파일에 있는 모든 테이블 정보를 SQL db로 불러오기 (엑셀 -> SQL테이블 변환)
SQL 테이블을 코딩없이 저장된 csv파일을 UI를 이용해 손쉽게 db파일을 생성할 수 있다. 아래 사이트에서 SQLite를 설치한다. https://sqlitebrowser.org/dl/ Downloads - DB Browser for SQLite (Please consider..
ansan-survivor.tistory.com
'DB관련 > SQLITE' 카테고리의 다른 글
[SQLite] SQL 데이터베이스(db)를 Window ODBC와 연결시키기 (0) | 2021.07.08 |
---|---|
[SQLite] SQLite 설치 및 데이터베이스(db) 테이블 생성하기 (0) | 2021.07.08 |
SQLite Column(title)에 값(value)추가하기. (0) | 2020.01.16 |
SQLite 테이블 이름 바꾸기(table rename)/ 테이블 내 Column(title)추가 (0) | 2020.01.16 |
SQLite DB파일 생성, 테이블 생성, 테이블 제거 (0) | 2020.01.16 |