当前位置:网站首页>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;
边栏推荐
猜你喜欢
随机推荐
torch.cat()使用方法
TOP2两数相加
Daily sql: request for friend application pass rate
抖音获取douyin分享口令url API 返回值说明
什么是Inductive learning和Transductive learning
Redis + lua implements distributed interface current limiting implementation scheme
Douyin API interface
HCIP 重发布/路由策略实验
kill 命令
WiFi Deauth 攻击演示分析 // mdk4 // aireplay-ng// Kali // wireshark //
OA项目之待开会议&历史会议&所有会议
docker安装mysql5.7(仅供测试使用)
姿态解算-陀螺仪+欧拉法
TOP2 Add two numbers
HCIP MGRE\OSPF Comprehensive Experiment
Pinduoduo API interface (attach my available API)
华为防火墙-7-dhcp
exness:黄金1800关口遇阻,静待美国CPI出炉
concept noun
OA项目之项目简介&会议发布