- 博客(7)
- 收藏
- 关注
原创 数据库:外键约束
现在父类的班级删改的话,可能会出错,因为子表有些学生信息绑定着这个班级,删除无法直接执行。需要在外键约束上再添加一些附加条件。这种方法的使用需要谨慎,因为一但你有什么误操作,连带很多子表列也将被删除。为了建立两表之间的关系 子表需要添加外键约束。首先创建父表 班级表。
2023-03-27 20:50:37
153
原创 数据库:上升的温度
题目链接:https://leetcode-cn.com/problems/rising-temperature/# Write your MySQL query statement below#输入:#Weather 表:#+----+------------+-------------+#| id | recordDate | Temperature |#+----+------------+-------------+#| 1 | 2015-01-01 | 10 |
2022-05-05 14:44:17
537
原创 数据库:部门工资前三高的所有员工
题目链接:https://leetcode-cn.com/problems/department-top-three-salaries/#Employee 表:#+----+-------+--------+--------------+#| id | name | salary | departmentId |#+----+-------+--------+--------------+#| 1 | Joe | 85000 | 1 |#| 2 | Henry
2022-05-03 15:54:59
991
原创 数据库:第N高的薪水
题目链接:https://leetcode-cn.com/problems/nth-highest-salary/#method1#case1CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INTBEGINset N = N - 1; RETURN ( select ifnull( ( select distinct Salary from Employee
2022-04-20 18:43:49
490
原创 数据库:第二高的薪水
题目链接:https://leetcode-cn.com/problems/second-highest-salary/#method1#分页查询select ifNull( ( select distinct Salary from Employee order by Salary desc limit 1,1 ),null) as SecondHighestSalaryselect coalesce( ( select distinct S
2022-04-11 16:50:17
723
原创 数据库:组合两个表
题目链接:https://leetcode-cn.com/problems/combine-two-tables/#method1select p.FirstName,p.LastName,a.City,a.Statefromperson p left join address aonp.personid=a.personid#method2select FirstName, LastName, (select City from Address a wher
2022-04-11 14:28:57
473
原创 Java基础:类与类之间的关系
Table of Content依赖关系关联关系聚合关系组合关系继承关系类与类之间的关系有依赖关系,关联关系,聚合关系,组合关系和继承关系依赖关系依赖关系(Dependency),是临时性的关联,代码中一般指由局部变量、函数参数、返回值建立的对于其他对象的调用关系class A{ public B method(C c,D d){ E e = new E(); //... B b = new B(); //... return b; } }关联关系关联关系(Assoc
2022-04-07 19:03:13
546
16套精美简历模板(附简历参考)
2023-03-27
金三银四,奉上27道胖乎乎的MySQL高频面试题
2023-03-27
Pythonpython3廖大佬讲解-python经典案例
2023-03-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅