zoukankan      html  css  js  c++  java
  • sql基础

    1、mysql基础命令

    查看数据库:show databases;

    查看数据库中的表:show tables;

    显示表结构:description或者DESC users;

    查看记录:select user,password from users where user_id=1;

    2、 information_schema

    • TABLE_SCHEMA:数据库名

    • TABLE_NAME:表名

     

     

    2.1 TABLES表

    显示所有信息:select * from information_schema ;
    查询数据库:select DISTINCT TABLE_SCHEMA from information_schema.TABLES ;
    查询数据库和数据表:select TABLE_SCHEMA ,GROUP_CONCAT(TABLE_NAME) from information_schema.tables group by TABLE_SCHEMA G
    显示数据表:select TABLE_NAME from information_schema.tables where TABLE_SCHEMA='dvwa' ;

    2.2 columns表

    column_name:字段名

    查询所有列:select * from information_schema.columnsG

    查询某个库的某个表:select column_name from information_schema.columns where TABLE_SCHEMA ='dvwa' and TABLE_NAME ='users';

    查询某个表:select column_name from information_schema.columns where TABLE_NAME ='SCHEMA_PRIVILEGES';

    显示数据库的信息:select first_name,last_name from users where user_id =1 union select version(),database()
    select first_name,last_name from users where user_id =1 union select user(),database();

     

  • 相关阅读:
    探寻京东云核心竞争力的源泉
    在线公开课 | 教你如何自行搭建一个威胁感知大脑?
    推迟学习系统调用
    linux中未实现的系统调用
    man(2) V
    man(2) W
    图像叠加
    man(2) readv writev
    qt 视频播放
    ffmpeg参数
  • 原文地址:https://www.cnblogs.com/zyh0430/p/11202591.html
Copyright © 2011-2022 走看看