Sqlite3常用命令

Sqlite3命令有“.”符合作为前缀。

基本操作

1、创建或者打开数据库 sqlite3 xxx.db

如果xxx.db存在则打开如果没有则新建此时执行创建表的命令后才会出现xxx.db文件。

创建xxx.db数据库

sqlite3 xxx.db

CREATE TABLE record(id integer primary key autoincrement,time varchar(20),name varchar(30),count int);

2、查看表结构

sqlite> .schema record

查看表record结构

3、查看所有表

sqlite> .tables

4、查看数据库

sqlite> .databases

5、执行sql脚本

sqlite> .read insert.sql

6、查看帮助

sqlite> .help

7、备份数据库

sqlite> .backup C:/users/ghost/desktop/lemo/xx.sql

数据的增删改查

1、创建表

CREATE TABLE record(id integer primary key autoincrement,time varchar(20),name varchar(30),count int);

2、修改表

 

3、插入数据

insert into record(time,name) values('20160124','徐凤年');

4、查询数据

select * from record;

5、改数据

update record set name='g' where id=1;

6、删

delete from record where id=1

 

 

.backup ?DB? FILE           Backup DB (default "main") to FILE
.bail ON|OFF Stop after hitting an error. Default OFF
.databases List names and files of attached databases
.dump ?TABLE? ... Dump the database in an SQL text format
If TABLE specified, only dump tables matching
LIKE pattern TABLE.
.echo ON|OFF Turn command echo on or off
.exit Exit this program
.explain ?ON|OFF? Turn output mode suitable for EXPLAIN on or off.
With no args, it turns EXPLAIN on.
.header(s) ON|OFF Turn display of headers on or off
.help Show this message
.import FILE TABLE Import data from FILE into TABLE
.indices ?TABLE? Show names of all indices
If TABLE specified, only show indices for tables
matching LIKE pattern TABLE.
.log FILE|off Turn logging on or off. FILE can be stderr/stdout
.mode MODE ?TABLE? Set output mode where MODE is one of:
csv Comma-separated values
column Left-aligned columns. (See .width)
html HTML <table> code
insert SQL insert statements for TABLE
line One value per line
list Values delimited by .separator string
tabs Tab-separated values
tcl TCL list elements
.nullvalue STRING Print STRING in place of NULL values
.output FILENAME Send output to FILENAME
.output stdout Send output to the screen
.prompt MAIN CONTINUE Replace the standard prompts
.quit Exit this program
.read FILENAME Execute SQL in FILENAME
.restore ?DB? FILE Restore content of DB (default "main") from FILE
.schema ?TABLE? Show the CREATE statements
If TABLE specified, only show tables matching
LIKE pattern TABLE.
.separator STRING Change separator used by output mode and .import
.show Show the current values for various settings
.stats ON|OFF Turn stats on or off
.tables ?TABLE? List names of tables
If TABLE specified, only list tables matching
LIKE pattern TABLE.
.timeout MS Try opening locked tables for MS milliseconds
.vfsname ?AUX? Print the name of the VFS stack
.width NUM1 NUM2 ... Set column widths for "column" mode
.timer ON|OFF Turn the CPU timer measurement on or off

over

【Android】Sqlite3命令详解的更多相关文章

  1. android adb 命令详解

    ADB (Android Debug Bridge)  是android SDK中的工具,需要先配置环境变量才能使用.起调试桥的作用,可以管理安卓设备.(也叫debug工具) ---------查看设 ...

  2. Android ADB命令详解

    adb的全称为Android Debug Bridge.是android司机经常用到的工具 . 你能在本篇文章中学到什么? adb基本指令 Shell AM&PM adb模拟用户事件 logc ...

  3. Android logcat命令详解

    一.logcat命令介绍 1.android log系统 2.logcat介绍 logcat是android中的一个命令行工具,可以用于得到程序的log信息 log类是一个日志类,可以在代码中使用lo ...

  4. Android pm 命令详解

    一.pm命令介绍与包名信息查询 1.pm命令介绍 pm工具为包管理(package manager)的简称 可以使用pm工具来执行应用的安装和查询应用宝的信息.系统权限.控制应用 pm工具是Andro ...

  5. 转: android emulator 命令详解

    在命令行输入: emulator -help,即可显示emulator支持的所有命令. Android Emulator usage: emulator [options] [-qemu args] ...

  6. adb shell 命令详解,android

    http://www.miui.com/article-275-1.html http://noobjava.iteye.com/blog/1914348 adb shell 命令详解,android ...

  7. adb shell 命令详解,android, adb logcat

    http://www.miui.com/article-275-1.html http://noobjava.iteye.com/blog/1914348 adb shell 命令详解,android ...

  8. Android Studio系列教程五--Gradle命令详解与导入第三方包

    Android Studio系列教程五--Gradle命令详解与导入第三方包 2015 年 01 月 05 日 DevTools 本文为个人原创,欢迎转载,但请务必在明显位置注明出处!http://s ...

  9. Android的logcat命令详解

    前言          欢迎大家我分享和推荐好用的代码段~~ 声明          欢迎转载,但请保留文章原始出处:          CSDN:http://www.csdn.net        ...

随机推荐

  1. Modules you should know in Python Libray

    前两天被问到常用的python lib和module有哪些?最常用的那几个,其他的一下子竟然回答不上.想想也是,一般情况下,遇到一个问题,在网上一搜,顺着线索找到可用的例子,然后基本没有怎么深究.结果 ...

  2. 联通超级战舰W910 Root 后不能 上网 解决方案

    联通版的超级战舰w910root后不能上网,一下是root方法: 超级战舰W910 Root方法: 电脑上安装“刷机精灵”(http://www.shuame.com/ ),在手机“菜单”——“系统设 ...

  3. 3D案例,导航,导航升级版

    /*****************************百度钱包旋转变内容******************************/ <!DOCTYPE html> <htm ...

  4. [2014.5.22][UBUNTU]Ubuntu与Windows系统时间不同步的问题

    安装Ubuntu+Windows双系统时会遇到Windows和Ubuntu系统时间不同步的问题,这是由于Windows系统默认读取主板bios等硬件系统时间作为OS的当地时间;而MAc,Linux类的 ...

  5. 百度之星资格赛——Disk Schedule(双调旅行商问题)

    Disk Schedule Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) To ...

  6. leecode 每日解题思路 127-Factorial Trailing Zeroes

    原题描述: 原题地址: Factorial Trailing Zeroes 题目描述很直接, 给出一个整数N, 求这个N的阶乘后尾有几个零.(要求O(logN)时间复杂度) 个人思路: 一开始,最简单 ...

  7. oracle Form Builer:ID_NULL Built-in

    Description                                                                     Returns a BOOLEAN va ...

  8. eclipse引入jar类包的源代码

    为了方便查看源代码,有时候需要对jar类包,引入源代码. 下载源代码 源代码是zip或者rar的压缩包 引入到项目中

  9. Socket.io各个发送消息的含义

    // send to current request socket client socket.emit('message', "this is a test"); // send ...

  10. JQuery设置缓慢下拉大行多次执行的解决办法,以及stop()函数的简单理解

    $(function(){ $('.all>li').mouseover(function(e) {        $(this).children().stop().slideDown(300 ...