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

  • 相关阅读:
    vue-router的基本使用
    SQL Server加密存储过程的破解
    IIS绑定Active Directory账号自动登录网站的方法
    .Net Install类的Install、Commit等事件触发顺序
    正态分布公式
    HDU4417 Super Mario
    CodeChef
    Gym101630C Connections
    CF916C
    CF912D Fishes
  • 原文地址:https://www.cnblogs.com/liang-xp/p/12297291.html
Copyright © 2011-2022 走看看