• MySQL 向表中插入、删除数据


    一、向表中插入一条信息

    1、查看表中的数据

    mysql> SELECT * FROM user;
    +----+---------+----------+
    | id | account | password |
    +----+---------+----------+
    |  1 | mk      | 123      |
    |  2 | seven   | 456      |
    +----+---------+----------+
    2 rows in set (0.00 sec)

    2、插入数据

    mysql> INSERT INTO user (account, password) VALUES('brk', '789');
    Query OK, 1 row affected (0.56 sec)

    3、再次查看表中的数据

    mysql> SELECT * FROM user;
    +----+---------+----------+
    | id | account | password |
    +----+---------+----------+
    |  1 | mk      | 123      |
    |  2 | seven   | 456      |
    |  3 | brk     | 789      |
    +----+---------+----------+
    3 rows in set (0.00 sec)

    二、从表中删除一条信息

    1、查看表中的数据

    mysql> SELECT * FROM user;
    +----+---------+----------+
    | id | account | password |
    +----+---------+----------+
    |  1 | mk      | 123      |
    |  2 | seven   | 456      |
    |  3 | brk     | 789      |
    +----+---------+----------+
    3 rows in set (0.00 sec)

    2、删除数据

    mysql> DELETE FROM user WHERE account='brk';
    Query OK, 1 row affected (0.57 sec)

    3、再次查看表中的数据

    mysql> SELECT * FROM user;
    +----+---------+----------+
    | id | account | password |
    +----+---------+----------+
    |  1 | mk      | 123      |
    |  2 | seven   | 456      |
    +----+---------+----------+
    2 rows in set (0.00 sec)
  • 相关阅读:
    面向对象编程的三大特征: 封装、继承、多态
    CDH和HDP对比
    mapreduce、spark、tez区别
    minio原理和使用
    HDP、CDH、CDP升级
    常用的分布式文件系统
    linux平台下防火墙iptables原理(转)
    php 1207
    php 1209
    php 1130
  • 原文地址:https://www.cnblogs.com/Satu/p/10652242.html
Copyright © 2020-2023  润新知