- 博客(5)
- 收藏
- 关注
原创 牛客题霸sql篇之42
描述删除emp_no重复的记录,只保留最小的id对应的记录。CREATE TABLE IF NOT EXISTS titles_test (id int(11) not null primary key,emp_no int(11) NOT NULL,title varchar(50) NOT NULL,from_date date NOT NULL,to_date date DEFAULT NULL);insert into titles_test values (‘1’, ‘10001’
2021-10-13 20:49:44 71
原创 牛客sql刷题sql11
第一个表是员工表第一行表示为员工编号为10001的部门是d001部门。下表是部门经理表第一行表示为d001部门的经理是编号为10002的员工。输出:获取所有的员工和员工对应的经理,如果员工本身是经理的话则不显示select d.emp_no,m.emp_no as manager from dept_emp d JOIN dept_manager m ON(d.dept_no=m.dept_no)# 排除是经理的员工where d.emp_no<>m.emp_nogroup
2021-10-11 17:17:02 94
原创 sqlzoo-more join
13.List the film title and the leading actor for all of the films ‘Julie Andrews’ played in.select title, namefrom movie mjoin casting c on m.id = c.movieidjoin actor a on a.id = c.actoridwhere movieid in ( SELECT movieid FROM casting WHERE actori
2021-09-27 14:25:42 105
原创 python编程300例
合并两个升序的数组A和B,形成一个新的数组,新数组也要有序例:输入A=[1,1],B=[1,2,3]输出【1,1,1,2,3】思路:依次顺序比较数组元素的大小class Solution(): i,j = 0,0 res = [] while i <len(A) and j< len(B): if A[i] < B[j]: res.append(A[i]) i +=1 else: res.append(B[j]) j+=1 # 遍历下一个元素
2021-09-23 21:38:00 1120 1
原创 sqlzoo练习之JOIN,运行成功
1.The first example shows the goal scored by a player with the last name ‘Bender’. The * says to list all the columns in the table - a shorter way of saying matchid, teamid, player, gtimeSELECT matchid,player FROM goal WHERE teamid='GER'2.Show id, sta
2021-09-23 16:00:48 217
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人