盘绰网教程:是一个免费提供流行视频软件教程、在线学习分享的学习平台!

MySQL怎么完成单表查询?MySQL单表查询语句

时间:2023/12/29作者:未知来源:盘绰网教程人气:


[摘要]MySQL如何实现单表查询?本篇文章就给大家介绍MySQL单表查询的方法。有一定的参考价值,有需要的朋友可以参考一下,希望对你们有所帮助。首先我们来创建表、插入数据:# 创建表 mysql> ...
MySQL如何实现单表查询?本篇文章就给大家介绍MySQL单表查询的方法。有一定的参考价值,有需要的朋友可以参考一下,希望对你们有所帮助。

首先我们来创建表、插入数据:

# 创建表 mysql> create table company.employee5( id int primary key AUTO_INCREMENT not null, name varchar(30) not null, sex enum('male','female') default 'male' not null, hire_date date not null, post varchar(50) not null, job_description varchar(100), salary double(15,2) not null, office int, dep_id int ); # 插入数据 mysql> insert into company.employee5(name,sex,hire_date,post,job_description,salary,office,dep_id) values ('jack','male','20180202','instructor','teach',5000,501,100), ('tom','male','20180203','instructor','teach',5500,501,100), ('robin','male','20180202','instructor','teach',8000,501,100), ('alice','female','20180202','instructor','teach',7200,501,100), ('tianyun','male','20180202','hr','hrcc',600,502,101), ('harry','male','20180202','hr',NULL,6000,502,101), ('emma','female','20180206','sale','salecc',20000,503,102), ('christine','female','20180205','sale','salecc',2200,503,102), ('zhuzhu','male','20180205','sale',NULL,2200,503,102), ('gougou','male','20180205','sale','',2200,503,102); # 查看表结构 mysql> desc employee5; +-----------------+-----------------------+------+-----+---------+----------------+

关键词:  MySQL如何完成单表查询?MySQL单表查询语句





Copyright © 2012-2018 盘绰网教程(http://www.panchuo.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版