一款很好用的插件,来做SQLite 数据库的创建,数据插入修改,删除,更新等测试验证。
1. 安装插件
https://chrome.google.com/webstore/detail/sqlite-reader/clpnhenadbibdbfendahnlakkcpocmej
轻松浏览,编辑和管理浏览器内的SQLite数据库!
SQLite Reader是一個擴展,可以幫助您輕鬆瀏覽,編輯和呈現SQLite數據庫。在我們的網站上,您可以輕鬆地從PC或Google Drive中加載SQLite數據庫,編輯數據庫並將文件保存在PC上或Google雲端硬盤上,而無需將其保存到桌面上。您可以在瀏覽器中使用所有操作!該軟件100%免費,無需您付費。
2. 测试SQLite
https://sqlreader.freebusinessapps.net/reader
可以从本地加载数据库,也可以网盘加载数据库,可以插件Sample数据库
DROP TABLE IF EXISTS colleagues;
CREATE TABLE colleagues(id integer,name text,title text,manager integer,hired date,salary integer,commission float, dept integer);
INSERT INTO colleagues VALUES (1,'JOHNSON','ADMIN',6,'2011-12-17',18000,NULL,4);
INSERT INTO colleagues VALUES (2,'HARDING','MANAGER',9,'2011-02-02',52000,300,3);
INSERT INTO colleagues VALUES (3,'TAFT','SALES I',2,'2015-01-02',25000,500,3);
INSERT INTO colleagues VALUES (4,'HOOVER','SALES II',2,'2011-04-02',27000,NULL,3);
INSERT INTO colleagues VALUES (5,'LINCOLN','TECH',6,'2012-06-23',22500,1400,4);
INSERT INTO colleagues VALUES (6,'GARFIELD','MANAGER',9,'2013-05-01',54000,NULL,4);
INSERT INTO colleagues VALUES (7,'POLK','TECH',6,'2014-09-22',25000,NULL,4);
INSERT INTO colleagues VALUES (8,'GRANT','ENGINEER',10,'2014-03-30',32000,NULL,2);
INSERT INTO colleagues VALUES (9,'JACKSON','CEO',NULL,'2011-01-01',75000,NULL,4);
INSERT INTO colleagues VALUES (10,'FILLMORE','MANAGER',9,'2012-08-09',56000,NULL,2);
INSERT INTO colleagues VALUES (11,'ADAMS','ENGINEER',10,'2015-03-15',34000,NULL,2);
INSERT INTO colleagues VALUES (12,'WASHINGTON','ADMIN',6,'2011-04-16',18000,NULL,4);
INSERT INTO colleagues VALUES (13,'MONROE','ENGINEER',10,'2017-12-03',30000,NULL,2);
INSERT INTO colleagues VALUES (14,'ROOSEVELT','CPA',9,'2016-10-12',35000,NULL,1);
SELECT name, hired FROM colleagues ORDER BY hired ASC;
SELECT title, COUNT(*) AS count, (AVG(salary)) AS salary FROM colleagues GROUP BY title ORDER BY salary DESC;
执行结果如下:
基本的语法和常用的SQL语法类似。
删除数据表使用 drop:
DROP TABLE IF EXISTS 表名;
创建表 CREATE:
CREATE TABLE 表名(字段名称 类型,字段名称2 类型2);
插入数据 Insert:
INSERT INTO 表名 VALUES (值,值2);
查询数据 Select:
SELECT 字段名称 FROM 表名 ORDER BY 字段名称 ASC;
修改数据UPDATA:
UPDATE 表名 SET 字段名称="值" where 字段名=值
网友评论