zoukankan      html  css  js  c++  java
  • android 数据库_sql语句总结


    表的创建
    db.execSQL("create table info(_id integer primary key autoincrement,name varchar(20)");

    db.execSQL("alter table info add phone varchar(20)");


    增删改查sql语句

    --insert into info(name,phone) values('王五','13777777');
    --delete from info where name='王五';
    --update info set phone='139999999'where name='王五';
    --select name,phone from info


    ------------------------------
    数据库事务
        db.execSQL("create table info (_id integer primary key autoincrement,name varchar(20),phone varchar(20),money varchar(20))");
            db.execSQL("insert into info ('name','phone','money') values ('张三','138888','2000')");
            db.execSQL("insert into info ('name','phone','money') values ('李四','139999','5000')");





    db.execSQL("update info set money= money-200 where name=?",new String[]{"AA"});
    //                    int i = 100/0;
                        db.execSQL("update info set money= money+200 where name=?",new String[]{"BB"});




  • 相关阅读:
    mmall商城用户模块开发总结
    Hadoop伪分布式安装与配置
    1.2假设空间
    1.1基本术语
    文献笔记
    文献下载
    文献管理
    文献检索
    python:函数详解2
    python:函数详解
  • 原文地址:https://www.cnblogs.com/liangqiyuan/p/5690511.html
Copyright © 2011-2022 走看看