Last active
August 29, 2015 14:24
-
-
Save lazybios/614e8203652dfaa030f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite3 test.sqlite3 | |
sqlite> create table awesome_video_games(name text, type text); | |
sqlite> insert into awesome_video_games values('fallout', 'rpg'); | |
sqlite> insert into awesome_video_games values('final fantasy', 'rpg'); | |
sqlite> insert into awesome_video_games values('deus ex', 'rpg'); | |
sqlite> insert into awesome_video_games values('hitman', 'stealth'); | |
sqlite> select * from awesome_video_games where type='rpg'; | |
fallout|rpg | |
final fantasy|rpg | |
deus ex|rpg | |
sqlite> .tables | |
awesome_video_games | |
sqlite> .schema awesome_video_games | |
CREATE TABLE awesome_video_games(name text, type text); | |
导入数据 | |
sqlite> create table failed_banks(name text, city text, state text, | |
zip integer, close_date, updated_date text) | |
sqlite> .separator "," | |
sqlite> .import banklist.csv failed_banks | |
导入数据 via Python | |
import sqlite3; | |
from datetime import datetime, date; | |
conn = sqlite3.connect('banklist.sqlite3') | |
c = conn.cursor() | |
c.execute('drop table if exists failed_banks') | |
c.execute('create table failed_banks(id integer primary key autoincrement, | |
name text, city text, state text, zip integer, close_date text, updated_date text)') |
Author
lazybios
commented
Jul 15, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment