반응형

I. 스크립트 내용 확인

II. 스크립트 불러와서 데이터 조회

  • 스크립트 파일 불러오기
  • 스크립트 내용 불러오기
  • 스크립트 내용 실행
  • 스크립트의 테이블 데이터 조회
  • 조회 결과에서 상위부터 2개 레코드 출력

결과


SOURCE CODE

 

https://github.com/hyunmin94/study_exam/commit/acc3e302d6046a603351c6f97598750fc241995e

 

[SQLite] 스크립트 내용을 트랜잭션에 적용 · hyunmin94/study_exam@acc3e30

Permalink Browse files [SQLite] 스크립트 내용을 트랜잭션에 적용 Loading branch information Showing 1 changed file with 22 additions and 0 deletions. +22 −0 SQLite/scriptMemoryExam.py @@ -0,0 +1,22 @@ import sqlite3 try: conn = sqlite3.conne

github.com

 

반응형
반응형

I. 트랜잭션에서의 작업 스크립트 처리

  • 테이블 생성 : phonebook
  • 테이블에 데이터 삽입
  • 트랜잭션에서의 작업내용 scriptFile.sql 파일에 저장(iterdump 함수 사용)

II. 스크립트 확인

  • 트랜잭션에서의 작업 스크립트 확인


SOURCE CODE

 

https://github.com/hyunmin94/study_exam/blob/master/SQLite/memoryScripteExam.py

 

hyunmin94/study_exam

Contribute to hyunmin94/study_exam development by creating an account on GitHub.

github.com

 

반응형
반응형

I. 테이블 데이터 확인

II. 테이블에 데이터 Update 처리

  • DB : sqlite
  • TABLE : tblmember
id 가 3이상인 레코드의 id를 id + 10 로 수정

III. 테이블 데이터 확인 


SOURCE CODE

 

https://github.com/hyunmin94/study_exam/blob/master/SQLite/updateExam.py

 

hyunmin94/study_exam

Contribute to hyunmin94/study_exam development by creating an account on GitHub.

github.com

 

반응형
반응형

I. 테이블 데이터 확인

II. 테이블에 데이터 Insert 처리

  • DB : sqlite
  • TABLE : tblmember
단일 레코드로 삽입시 (execute 함수)

다중 레코드 삽입시 (executemany 함수)

결과는 동일

III. 테이블 데이터 확인 


SOURCE CODE

 

hyunmin94/study_exam

Contribute to hyunmin94/study_exam development by creating an account on GitHub.

github.com

 

반응형
반응형

I. SQLite DB확인

  • (1) DataBase : sqlite
  • (2) Table : tblmember
  • (3) Table Data  

II. Python환경에서 SQLite의 데이터 조회

  • C:\DBExam\SQLiteExam\sqlite.db의 DataBase에 내용은 상위 사진과 동일하다.

출력 결과


SOURCE CODE

 

hyunmin94/study_exam

Contribute to hyunmin94/study_exam development by creating an account on GitHub.

github.com

반응형
반응형

■ SQLite

MySQL나 PostgreSQL와 같은 데이터베이스 관리 시스템이지만, 서버가 아니라 응용 프로그램에 넣어 사용하는 비교적 가벼운 데이터베이스이다.


설치 경로

 

SQLite administration | SQLite Expert

SQLite Expert: The expert way to SQLite SQLite Expert is a powerful tool designed to simplify the development of SQLite3 databases. It is a feature rich administration and development tool for SQLite designed to answer the needs of all users from writing s

sqliteexpert.com


 설치 순서

▶ DOWNLOAD 카테 고리 선택

▶ 필자는 64비트 이므로 SQLite Expert Personal 64bit 설치

▶다운로드 경로에 있는 설치 파일(SQLiteExpertPersSetup63.exe) 실행

▶ I accept the agreement 체크

▶ Next 버튼 클릭

▶ 다운로드 경로 지정 후 Next 버튼 클릭

▶ Next 버튼 클릭

▶ shortcut으로 추가 하고 싶은 부분 체크

▶ Next 버튼 클릭

▶ Install 버튼 클릭

▶ 설치 진행

▶ Finish 버튼 클릭

설치완료!!!

반응형

+ Recent posts