当前位置:网站首页>Daily sql-statistics of the number of professionals (including the number of professionals is 0)
Daily sql-statistics of the number of professionals (including the number of professionals is 0)
2022-08-11 07:15:00 【Eating too much sugar will not gain weight】
Daily sql-count the number of professionals (including 0 professionals)
DDL
CREATE TABLE IF NOT EXISTS student (student_id INT,student_name VARCHAR(45), gender VARCHAR(6), dept_id INT);CREATE TABLE IF NOT EXISTS department (dept_id INT, dept_name VARCHAR(255));insert into student (student_id, student_name, gender, dept_id) values (1, 'Jack', 'M', 1);insert into student (student_id, student_name, gender, dept_id) values (2, 'Jane', 'F', 1);insert into student (student_id, student_name, gender, dept_id) values (3, 'Mark', 'M', 2);insert into department (dept_id, dept_name) values (1, 'Engineering');insert into department (dept_id, dept_name)values (2, 'Science');insert into department (dept_id, dept_name) values (3, 'Law'); 
sql
select t2.dept_name,count(t1.student_id) as student_number from student t1 right join department t2 on t1.dept_id = t2.dept_id group by t2.dept_name;
边栏推荐
猜你喜欢
随机推荐
TOP2两数相加
知识蒸馏Knownledge Distillation
EasyPlayer针对H.265视频不自动播放设置下,loading状态无法消失的解决办法
Top20括号匹配
HCIA知识复习
torch.cat()用法
iptables的状态
类的定义、类的继承以及super的使用
京东商品详情API调用实例讲解
Coordinate system in navigation and positioning
抖音分享口令url API工具
使用Keras构建GAN,以Mnist为例
daily sql - query for managers and elections with at least 5 subordinates
已解决EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
Taobao API interface reference
矩阵分析——矩阵分解
Eight-legged text jvm
iptables 使用脚本来管理规则
Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
Eight-legged text of mysql









