SQLITE入门 逐步讲解SQLITE命令行(二)
可以接着上一步操作,直接向DOS窗口输入.help命令来查看SQLite的所有命令行及解释如下:
F:\>sqlite3
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .help
也可以ctrl+c结束命令,想DOS窗口 输入sqlite3执行后再输入.help命令如下:
F:\>sqlite3
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .help
显示如下:
.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
.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.
.genfkey ?OPTIONS?
Options are:
--no-drop: Do not drop old fkey triggers.
--ignore-errors: Ignore tables with fkey errors
--exec: Execute generated SQL immediately
See file tool/genfkey.README in the source
distribution for further information.
.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 on TABLE
.load FILE ?ENTRY?
Load an extension library
.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
.rest
相关文档:
(1) 如何建立自动增长字段?
简短回答:声明为 INTEGER PRIMARY KEY 的列将会自动增长。
长一点的答案: 如果你声明表的一列为 INTEGER PRIMARY KEY,那么, 每当你在该列上插入一NULL值时, NULL自动被转换为一个比该列中最大值大1的一个整数,如果表是空的, 将会是1。 (如果是最大可能的主键 9223372036854775807 ......
在SQL Server中,创建表格的时候,对于时间列有时候我们可以根据需要指定默认值为当前时间(也就是说记录生成的时候有默认的时间戳)。例如:
create table log(
content varchar(256),
logtime datetime default getdate()
)
然 ......
OS X自从10.4后把SQLite这套相当出名的数据库软件,放进了作业系统工具集里。OS X包装的是第三版的SQLite,又称SQLite3。这套软件有几个特色:
软件属于公共财(public domain),SQLite可说是某种「美德软件」(virtueware),作者本人放弃着作权,而给使用SQLite的人以下的「祝福」(blessing):
May you do good an ......
SQLite学习笔记
1.查看有哪些数据库,显示数据库列表
show databases;
2.显示表的结构
方法一:
use student;
describe student;
方法二:
des student.student;
方法三:
show columns from student;
3.显示MYSQL的版本
select version();
4.显示库中的数据表
use mysql;
show tables;
5.建库
......
SqLite.net的dll为System.Data.SQLite.dll,这种dll分为32位、64位和适用于compactframework三种,在引用时要注意,选择正确的dll。
将要保存图片的字段类型设为blob。代码如下:
private void savePicture()
{
using (SQLiteConnection cnn = new SQLiteConnection(dbPath))
......