素材: 表名:worker-- 表中字段均为中文,比如 部门号 工资 职工号 参加工作 等
mysql8.0 [chap03]>select * from worker;
mysql8.0 [chap03]>select distinct(部门号) from worker;
mysql8.0 [chap03]>select 职工号,姓名,2023-year from worker;
mysql8.0 [chap03]>select 部门号, 职工号,姓名,政治面貌 from worker where 部门号 in (102,103);
mysql8.0 [chap03]>select 部门号,count(政治面貌) from worker where 政治面貌='党员' group by 部门号;