mysql基础语句

发布日期:2017-07-05 阅读量:513

1. 查看数据库

    show databases;

2. 使用数据库

    use database_name;

3. 查看表

    show tables;

4. 查看表详情

    desc table_name;

5、查询数据语句

    select field1,field2 from table_name where condition and condition or condition order by field limit start,size;

6、插入数据语句

    insert into table_name(field1, field2, field3 ...) values(value1, value2, value3 ...), (value1, value2, value3 ...);

7. 更新数据语句

    update table_name set field = value where condition;

8. 删除数据语句

    delete from table_name where condition;