随笔分类 -  Mysql

Mysql笔记
摘要:1、下载和解压 下载mysql的zip包,参考下载链接:oracle官网下载链接 把zip包解压到指定的文件夹中,指定文件夹绝对路径不能有中文和空格。 2、创建data文件夹 进入%mysql%目录,在%mysql%下新建data目录。 注:%mysql%是解压目录,例如:D:\tool\mysql 阅读全文
posted @ 2017-05-10 15:30 练子 阅读(199) 评论(0) 推荐(0)
摘要:The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users tabl 阅读全文
posted @ 2016-03-22 15:57 练子 阅读(321) 评论(0) 推荐(0)
摘要:The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id. The Department table holds all dep 阅读全文
posted @ 2016-03-22 15:55 练子 阅读(249) 评论(0) 推荐(0)
摘要:Write a SQL query to find all numbers that appear at least three times consecutively. For example, given the above Logs table, 1 is the only number th 阅读全文
posted @ 2016-03-22 15:53 练子 阅读(123) 评论(0) 推荐(0)
摘要: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 num 阅读全文
posted @ 2016-03-22 15:49 练子 阅读(221) 评论(0) 推荐(0)
摘要:Write a SQL query to get the nth highest salary from the Employee table. For example, given the above Employee table, the nth highest salary where n = 阅读全文
posted @ 2016-03-21 18:36 练子 阅读(169) 评论(0) 推荐(0)
摘要:The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id. The Department table hol 阅读全文
posted @ 2016-03-21 18:35 练子 阅读(158) 评论(0) 推荐(0)
摘要:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. For example, aft 阅读全文
posted @ 2016-03-21 18:33 练子 阅读(152) 评论(0) 推荐(0)
摘要:Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. For example, ret 阅读全文
posted @ 2016-03-21 18:31 练子 阅读(174) 评论(0) 推荐(0)
摘要:Table: Person Table: Address Write a SQL query for a report that provides the following information for each person in the Person table, regardless if 阅读全文
posted @ 2016-03-21 18:27 练子 阅读(195) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2016-03-21 18:23 练子 阅读(135) 评论(0) 推荐(0)
摘要:Write a SQL query to find all duplicate emails in a table named Person. For example, your query should return the following for the above table: CREAT 阅读全文
posted @ 2016-03-21 18:21 练子 阅读(127) 评论(0) 推荐(0)
摘要:The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. Given the Em 阅读全文
posted @ 2016-03-21 18:18 练子 阅读(180) 评论(0) 推荐(0)
摘要:Mysql中执行SET NAMES utf8这条SQl的作用 1)首先,Mysql服务器的编码和数据库的编码在配置文件my.ini中设置; 用记事本打开配置文件,修改代码:default-character-set=utf8,这里 保证了Mysql服务器以及数据库的编码是utf8; 2)打开Mysq 阅读全文
posted @ 2016-01-29 11:28 练子 阅读(216) 评论(0) 推荐(0)
摘要:有一个三级结构的数据表,自身连接分别查看分类的结构,包括 父类,子类创建数据表:mysql> create table tdb_goods_type( -> type_id tinyint unsigned auto_increment primary key, -> type_name... 阅读全文
posted @ 2016-01-22 15:50 练子 阅读(511) 评论(0) 推荐(0)