mysql
ballyyang
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
mysql select into和insert into select
1、SELECT INTO FROM语句 语句形式为:SELECT vale1, value2 into Table2 from Table1 2、INSERT INTO SELECT语句 语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Table1 ...原创 2018-11-03 11:28:01 · 217 阅读 · 0 评论 -
175.Combine Two Tables
Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId | int | | FirstName | varchar | | LastName | varchar | +-------------+---------+ Pe...原创 2018-11-05 20:08:52 · 207 阅读 · 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 exam...原创 2018-11-05 20:09:50 · 176 阅读 · 0 评论 -
181.Employees Earning More Than Their Managers
The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. +----+-------+--------+-----------+ | Id | Name | Salary | ...原创 2018-11-05 20:11:09 · 175 阅读 · 0 评论 -
181.Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything. Table: Customers. +----+-------+ | Id | Name ...原创 2018-11-05 20:13:29 · 183 阅读 · 0 评论 -
centos mysql5.6 升级5.7
系统环境:centos7.2,linux3.10 [root@VM_0_15_centos ~]# uname -a Linux VM_0_15_centos 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux [root@VM_0_15_centos ~]#...原创 2018-11-15 19:59:39 · 1104 阅读 · 0 评论 -
数据库设计三大范式
数据库设计三大范式 何为范式? 1、设计关系型数据库的时候,需要遵从不同的规范要求,设计出合理的关系型数据库。这些规范被称作范式。 2、范式越高,数据库冗余度就越低。 理解三大范式: <div align="center">第一范式: 1、数据库表的每一列都是不可分割的原子数据项,不可分 例子: (1)、当address为记录省市的时候需进行拆分,拆出provice,c...原创 2018-11-16 21:29:54 · 250 阅读 · 0 评论 -
centos下mysql忘记密码重置方法
1、首先确认服务器处于安全的状态,可以将mysql对外的端口关闭。 2、设置mysql登录无需密码: (1)、进入my.cnf [root@VM_0_15_centos ~]# vi /etc/my.cnf (2)、在 [mysqld]中 添加skip-grant-tables, 如下操作,保存(wq)并退出 # For advice on how to change settin...原创 2018-11-16 22:13:16 · 541 阅读 · 0 评论 -
centos执行systemctl start firewalld报错Failed to start firewalld.service: Unit is masked.
[root@VM_0_15_centos ~]# systemctl start firewalld Failed to start firewalld.service: Unit is masked. 装防火墙的时候,遇到了这个错误。 查了一下,firewalld服务被锁定了,取消锁定即可。 [root@VM_0_15_centos ~]# systemctl unmask firew...原创 2018-11-16 22:42:07 · 711 阅读 · 0 评论 -
FirewallD is not running
执行firewall-cmd --add-port=3306/tcp --permanent时报的错 [root@VM_0_15_centos ~]# firewall-cmd --state //查看运行状态 not running [root@VM_0_15_centos ~]# systemctl start firewalld //启动服务 [root@VM_0_15_c...原创 2018-11-16 22:46:12 · 229 阅读 · 0 评论 -
mysql decimal
mysql decimal 本篇讨论mysql decimal数据类型特征 分别从以下3个方面进行介绍: 1、最大位数 2、存储格式 3、存储要求 参考值:decimal(M, D) 1、最大位数 (1)M是最多的位数,范围从1到65; (2)D是小数点右边的位数,范围从0到30,且不得大于M。 如:decimal(6,2)表示存储的最大位数为6位(小数点左边+右边),小数点右...原创 2018-11-23 00:56:06 · 6118 阅读 · 0 评论 -
centos7开启关闭3306端口
背景:闲来想着用navicat访问下centos上的数据库,发现连接不上。。。尴尬。。 如图:一直在连接。。然后报了一个unknown error。。 解决: 1、查看一下防火墙状态 [root@VM_0_15_centos ~]# systemctl status iptables.service ● iptables.service - IPv4 firewall with...原创 2018-11-17 14:48:46 · 2317 阅读 · 0 评论
分享