zoukankan      html  css  js  c++  java
  • python和数据库

    一:数据库创建,增删改查

    • 数据库操作

        create database db_name;

        drop database db_name;

        create database db_name if not exists db_name;

        show databases;

        show create database db_name;

        alteratabase db_name character set 编码方式;

    • 表操作

        use db_name;

        select database();

        desc tb_name;

        create table user(id int [primary key,auto_increment],name varchar(10),age tinyint default 19);

        insert into user(id,name)values(1,'alex');

        insert into user(id,name)values(1,'alex'),(2,'tom');

        insert into user set id=3,name='xxx';

        update user set name='lanfei' where id=3;

        delete from user where id=1;

        delete user;

        truncate table tb-name;

    二:数据库信息查询

      

  • 相关阅读:
    175. 组合两个表
    101. 对称二叉树
    292. Nim游戏
    319. 灯泡开关
    155. 最小栈
    232. 用栈实现队列
    225. 用队列实现栈
    145. 二叉树的后序遍历
    144. 二叉树的前序遍历
    【leetcode】977. Squares of a Sorted Array
  • 原文地址:https://www.cnblogs.com/Mr-l/p/11168172.html
Copyright © 2011-2022 走看看