【Android】Sqlite3命令详解
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命令详解的更多相关文章
- android adb 命令详解
ADB (Android Debug Bridge) 是android SDK中的工具,需要先配置环境变量才能使用.起调试桥的作用,可以管理安卓设备.(也叫debug工具) ---------查看设 ...
- Android ADB命令详解
adb的全称为Android Debug Bridge.是android司机经常用到的工具 . 你能在本篇文章中学到什么? adb基本指令 Shell AM&PM adb模拟用户事件 logc ...
- Android logcat命令详解
一.logcat命令介绍 1.android log系统 2.logcat介绍 logcat是android中的一个命令行工具,可以用于得到程序的log信息 log类是一个日志类,可以在代码中使用lo ...
- Android pm 命令详解
一.pm命令介绍与包名信息查询 1.pm命令介绍 pm工具为包管理(package manager)的简称 可以使用pm工具来执行应用的安装和查询应用宝的信息.系统权限.控制应用 pm工具是Andro ...
- 转: android emulator 命令详解
在命令行输入: emulator -help,即可显示emulator支持的所有命令. Android Emulator usage: emulator [options] [-qemu args] ...
- adb shell 命令详解,android
http://www.miui.com/article-275-1.html http://noobjava.iteye.com/blog/1914348 adb shell 命令详解,android ...
- adb shell 命令详解,android, adb logcat
http://www.miui.com/article-275-1.html http://noobjava.iteye.com/blog/1914348 adb shell 命令详解,android ...
- Android Studio系列教程五--Gradle命令详解与导入第三方包
Android Studio系列教程五--Gradle命令详解与导入第三方包 2015 年 01 月 05 日 DevTools 本文为个人原创,欢迎转载,但请务必在明显位置注明出处!http://s ...
- Android的logcat命令详解
前言 欢迎大家我分享和推荐好用的代码段~~ 声明 欢迎转载,但请保留文章原始出处: CSDN:http://www.csdn.net ...
随机推荐
- 教程-隐藏/显示任务栏-程序不在任务显示-全面控制Windows
1.隐藏任务条 var h:THandle; //变量h:=FindWindow('Shell_TrayWnd',nil);ShowWindow(h,SW_hide); 2.显示任务条h:=Find ...
- [二]Ajax基本实现
<script text="text/javascript"> function ajax(){ var httpRequest; if(windows.httpReq ...
- php-fpm正在生成页面时,浏览器刷新后,php-fpm会退出吗?
好久没写博客了,因为没有啥可写. 之所以有此疑问,是因为看了一篇大牛的文章:PHP升级导致系统负载过高问题分析.看完后,其中有些文字触发了我这个想法,也想验证一下. 方案,用tcpdump抓包,用st ...
- Git简介:
Git中文文档 1.详解在Visual Studio中使用git版本系统(图文) 2.GitExtensions下载地址:http://gitextensions.codeplex.com/ 3.Gi ...
- 关于JAVA中URL传递中文参数的问题
今天在调用一个接口时,需要传递一个中文参数,结果获取不到数据,原因就在于中文传参的编码问题. 问题来源:URL url= new URL("http://XXX?OrganName=司法厅& ...
- 通过WMI配置IP
$wmi = gwmi win32_networkadapterconfiguration -filter "ipenabled = 'true'"$wmi.EnableStati ...
- 成员方法的this指针
1.我们知道成员方法中,有个隐式的this常量指针.考虑,Derived继承的成员方法中this指针的表面类型是什么?子类重写的虚方法中this指针的表面类型是什么? 2.Derived继承的方法,就 ...
- android111 java中调用c代码
MainActivity: package com.itheima.helloworld1; import android.os.Bundle; import android.app.Activity ...
- MYSQL----myownstars(102)
http://blog.itpub.net/15480802/cid-84815-list-1/
- Open quote is expected for attribute "{1}" associated with an element type "name".
xml属性必须用引号“”,不能缺少.