![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
文章平均质量分 63
My_Vina
不被金钱,他人和过去所打扰.
展开
-
JDBC连接MySQL数据库
以下为JDBC连接MySQL数据库的一个简单示例:package MysqlConnection;import java.sql.*;public class Test { public static void main(String[] args) { // https://blog.csdn.net/javaniuniu/article/details/52403509 tr...原创 2018-04-07 14:52:33 · 127 阅读 · 0 评论 -
JSP+Servlet+JavaBean模式 -- 简易登录注册模型
模式分析:对于Jsp来说:Model层:实现系统的业务逻辑,即javaBean部分View层:负责与用户交互,即在界面上展示数据对象给用户,即html,jspControl层:Model与View之间沟通的桥梁,它可以分派用户的请求并选择恰当的视图以用于显示,同时它也可以解释用户的输入并将它们映射为模型层可执行的操作,当然就是Servlet的职责了。Model层代码:User.Javapackag...原创 2018-04-08 09:07:04 · 710 阅读 · 0 评论 -
ERROR 1215: Cannot add foreign key constraint
关于数据库无法创建外键的问题。上网搜索了很多,大多说的是数据类型和存储字符类型的问题。但自己检查了很多道,发现都没问题。偶然发现一篇文章提到了索引问题。于是我为需要创建外键的列单独添加索引后,添加外键就可以了。如没有索引,可为那一列单独创建索引再尝试。希望对你有所帮助。...原创 2018-05-05 19:41:39 · 981 阅读 · 0 评论 -
设置服务器上MySQL允许外网访问
1.修改配置文件sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf把bind-address参数的值改成你的内/外网IP或0.0.0.0,或者直接注释掉这行.2.登录数据库mysql -u root -p输入密码mysql> use mysql;3.查询hostmysql> select user,host from user;4.创建host如果没...原创 2018-06-09 10:12:38 · 14769 阅读 · 1 评论 -
175. Combine Two Tables
Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+Pe...原创 2019-04-28 15:37:38 · 91 阅读 · 0 评论 -
176. Second Highest Salary
Write a SQL query to get the second highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+For exampl...原创 2019-04-28 15:56:05 · 106 阅读 · 0 评论 -
177. Nth Highest Salary
Write a SQL query to get the nth highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+For example, ...原创 2019-04-28 16:13:39 · 91 阅读 · 0 评论 -
178. Rank Scores
Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value....原创 2019-04-28 16:24:04 · 108 阅读 · 0 评论 -
180. Consecutive Numbers
Write a SQL query to find all numbers that appear at least three times consecutively.+----+-----+| Id | Num |+----+-----+| 1 | 1 || 2 | 1 || 3 | 1 || 4 | 2 || 5 | 1 || 6 | ...原创 2019-04-28 16:36:19 · 188 阅读 · 0 评论