zoukankan      html  css  js  c++  java
  • 轻量级sqlite是增删改查

    --创建数据库

    create database ios

    --使用数据库

    use ios

    --创建数据表

    create table student

    (

        stuid int primary key autoincrement,

        stuname varchar(20),

        stupwd varchar(20)

    )

    --查询所有信息

    select * from student

    --增加信息

    insert into student(stuname,stupwd)

    values ('lisi','123456')

    --修改

    update student set stuname = '李四'

    where stuid = 1

    update student set stuname = '李四',stupwd='Sd123'

    where stuid = 1

    --删除

    delete from student where stuid=1

    查询

     1、查询所有信息

     select * from student

     2、查询表中的行数

     select count(*) from student 

     3、降序排列

     select * from student order by stuid desc

     升序排列

     select * from student order by stuid asc

     4、分组

     select count(*)from student group by stuname

  • 相关阅读:
    7-11
    7-9
    7-8
    7-7
    7-6
    7-5
    7-4
    7-3
    第08次:升级《陋习手记》完善主从UI
    第07次:升级《陋习手记》显示多条数据
  • 原文地址:https://www.cnblogs.com/pruple/p/5309212.html
Copyright © 2011-2022 走看看