zoukankan      html  css  js  c++  java
  • 数据记录增删改查操作

    INSERT INTO pet VALUES('Fluffy','Harold','cat','f','1993-02-04',NULL);
    Query OK, 1 row affected (0.10 sec)

    mysql> INSERT INTO pet VALUES('Claws','Gwen','dog','m','1994-03-17',NULL);
    Query OK, 1 row affected (0.13 sec)

    mysql> INSERT INTO pet VALUES('Buffy','Harold','dog','m','1989-05-13',NULL);
    Query OK, 1 row affected (0.01 sec)

    mysql> INSERT INTO pet VALUES('Fang','Benny','dog','m','1990-08-27',NULL);
    Query OK, 1 row affected (0.13 sec)
    mysql> INSERT INTO pet VALUES('Bowser','Diane','dog','m','1979-08-31','1995-07-29');
    Query OK, 1 row affected (0.01 sec)

    mysql> INSERT INTO pet VALUES('Chirpy','Gwen','bird','f','1998-09-11',NULL);
    Query OK, 1 row affected (0.00 sec)

    mysql> INSERT INTO pet VALUES('Whistler','Gwen','bird',NULL,'1997-12-09',NULL);
    Query OK, 1 row affected (0.00 sec)

    mysql> INSERT INTO pet VALUES('Slim','Benny','snake','m','1996-04-29',NULL);
    Query OK, 1 row affected (0.01 sec)

    VALUES('Puffball','Diane','hamster','f','1990-03-30',NULL);
    Query OK, 1 row affected (0.01 sec)

    mysql> select * from pet;
    +----------+--------+---------+------+------------+------------+
    | name | owner | species | sex | birth | death |
    +----------+--------+---------+------+------------+------------+
    | Puffball | Diane | hamster | f | 1999-03-30 | NULL |
    | 旺财 | 周星驰 | 狗 | 公 | 1990-01-01 | NULL |
    | Fluffy | Harold | cat | f | 1993-02-04 | NULL |
    | Claws | Gwen | dog | m | 1994-03-17 | NULL |
    | Buffy | Harold | dog | m | 1989-05-13 | NULL |
    | Fang | Benny | dog | m | 1990-08-27 | NULL |
    | Bowser | Diane | dog | m | 1979-08-31 | 1995-07-29 |
    | Chirpy | Gwen | bird | f | 1998-09-11 | NULL |
    | Whistler | Gwen | bird | NULL | 1997-12-09 | NULL |
    | Slim | Benny | snake | m | 1996-04-29 | NULL |
    | Puffball | Diane | hamster | f | 1990-03-30 | NULL |
    +----------+--------+---------+------+------------+------------+
    11 rows in set (0.00 sec)

    删除数据

    mysql> delete from pet where name='Fluffy';
    Query OK, 1 row affected (0.15 sec)

    修改数据

    mysql> update pet set name='旺旺财' where owner='周星驰';
    Query OK, 1 row affected (0.04 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

  • 相关阅读:
    php打印出10*10表格
    php打印出1到2000年之间所有的闰年
    借鉴一篇好文章
    女程序员的预备篇
    SQL存储过程删除数据库日志文件的方法
    Mongodb无法访问28107的问题
    使用 xsd.exe 命令工具将 xsd 架构生成 类(CS) 文件
    C# 用POST提交json数据
    WinForm 使用 HttpUtility
    Sql Server 分区之后增加新的分区
  • 原文地址:https://www.cnblogs.com/liang-xp/p/12297291.html
Copyright © 2011-2022 走看看