概述1. 数据库、表的建立,记录的添加、查询、修改和删除 F:\>sqlite3 database.db sqlite> create table admin(username text,age integer); sqlite> insert into admin values('kuang',25); sqlite> select * from admin; sqlite> update admi
1. 数据库、表的建立,记录的添加、查询、修改和删除 F:\>sqlite3 database.db sqlite> create table admin(username text,age integer); sqlite> insert into admin values('kuang',25); sqlite> select * from admin; sqlite> update admin set username='kk',age=24 where username='kuang' and age=25; sqlite> delete from admin where username='kk'; 注:每条SQL语句后必须以";"号结尾! 2.sqlite系统命令 .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(以sql格式输出表结构) .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. .header(s) ON|OFF Turn display of headers on or off .help Show this message(显示帮助信息) .import file table import data from file into table(把文件中的数据导入到表中,各字段用separator的值为分隔符) .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 @R_403_6823@-aligned columns. (See .wIDth)(以.wIDth设置的宽度显示各字段) HTML HTML <table> code(HTML表格格式输出) insert sql insert statements for table(以insert SQL语句形式输出) line One value per line(fIEld = value的形式逐行输出) List Values delimited by .separator string(各字段以separator的值为分隔符输出) 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(执行文件中的SQL语句) .schema ?table? Show the Create statements(以sql格式输出表结构) .separator STRING Change separator used by output mode and .import(修改分隔符) .show Show the current values for varIoUs settings(显示配置信息) .tables ?PATTERN? List names of tables matching a liKE pattern(看看有创建了多少表) .timeout MS Try opening locked tables for MS milliseconds(超时时间,单位:毫秒) .wIDth NUM NUM ... Set column wIDths for "column" mode(设置列宽) 总结
以上是内存溢出为你收集整理的SQLite3命令 *** 作大全全部内容,希望文章能够帮你解决SQLite3命令 *** 作大全所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
评论列表(0条)