数据库MySQL
后打开撒打发了
有些人注定要生活在彼岸 可以亲近可以爱怜 甚至可以穷尽一生去思念 只是无法触及 有些距离 注定不能跨越 只能俩俩相望 就像有些爱只能养在心里 长在眼中 不要捧在手里 放在身边 注定只能邂逅 无法遭遇
展开
-
题目1:MySQL----------Combine Two Tables
Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+Per原创 2015-05-18 00:34:50 · 1005 阅读 · 0 评论 -
redis源码分析(二)、redis源码分析之sds字符串
sds字符串 根据传统, C 语言使用长度为N+1的字符数组来表示长度为 N 的字符串,并且字符数组的最后一个元素总是空字符 ‘\0’ 。C 语言使用的这种简单的字符串表示方式, 并不能满足 Redis 对字符串在安全性、效率、以及功能方面的要求, 本节接下来的内容将详细对比 C 字符串和 SDS 之间的区别, 并说明 SDS 比 C 字符串更适用于 Redis 的原因。SDS又叫简单动态字符串,原创 2017-11-12 00:35:37 · 1042 阅读 · 1 评论 -
redis源码分析(一)复习redis命令、持久化方案、主从同步原理、配置
源码分析之前复习一下redis知识,好久没用过redis有点生疏了。 一、redis的数据结构 redis可以存储键与5种不同数据结构类型之间的映射,这5种数据类型就是string(字符串)、list(列表)、set(集合)、hash(散列)、zset(有序集合)。redis命令对于这5种结构都是通用的,如del、type、range等。 1、string操作: string是redis原创 2017-11-03 01:43:39 · 499 阅读 · 0 评论 -
数据库连接池c++ (msyql) mysql connector c++ 的使用
Mysql Connector/C++ 使用介绍一、下载mysql connector c++和 boost库wget https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-1.1.8-linux-glibc2.5-x86-64bit.tar.gz下载:根据自己的系统下载mysql con原创 2017-04-02 21:41:15 · 14370 阅读 · 3 评论 -
MySQL Connector/C++ 例子(二)
/* Copyright 2008, 2010, Oracle and/or its affiliates. All rights reserved.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License a原创 2017-04-02 22:19:37 · 965 阅读 · 0 评论 -
MySQL Connector/C++ 例子(一)
/* Copyright 2008, 2010, Oracle and/or its affiliates. All rights reserved.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License a原创 2017-04-02 22:17:01 · 4017 阅读 · 0 评论 -
Mysql Connector(C++)的数据库连接池的实现
基于MysqlConnector/C++的数据库连接池的实现1.连接池的介绍:1.1应用背景:一般的应用程序都会访问到数据库,在程序访问数据库的时候,每一次数据访问请求都必须经过下面几个步骤:建立数据库连接,打开数据库,对数据库中的数据进行操作,关闭数据库连接。而建立数据库连接和打开数据库是一件很消耗资源并且费时的工作,如果在系统中很频繁的发生这种数据库连接,必然会影响到系转载 2017-03-31 11:14:27 · 1615 阅读 · 0 评论 -
题目9:MySQL---------Department Top Three Salaries
The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary | DepartmentId |+--原创 2015-10-18 16:47:03 · 668 阅读 · 0 评论 -
题目8:MySQL---------Department Highest Salary
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary | Departme原创 2015-10-18 14:18:43 · 686 阅读 · 0 评论 -
题目7:MySQL----------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 | Na原创 2015-05-24 00:37:24 · 1402 阅读 · 3 评论 -
题目11:MySQL---------Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person.+----+---------+| Id | Email |+----+---------+| 1 | [email protected] || 2 | [email protected] || 3 | [email protected] |+----+---------+For原创 2015-10-18 18:47:10 · 616 阅读 · 0 评论 -
题目10:MySQL---------Rising Temperature
Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates.+---------+------------+------------------+| Id(INT) | Date(DA原创 2015-10-18 18:31:41 · 629 阅读 · 0 评论 -
题目4:MySQL----------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.原创 2015-05-23 23:46:21 · 1501 阅读 · 0 评论 -
题目6:MySQL----------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 |原创 2015-05-24 00:27:52 · 1060 阅读 · 0 评论 -
题目5:MySQL----------Consecutive Numbers
Write a SQL query to find all numbers that appear at least three times consecutively.+----+-----+# Write your MySQL query statement belowselect distinct Num from ( select Num, c原创 2015-05-23 23:49:20 · 1376 阅读 · 0 评论 -
题目3:MySQL----------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 exampl原创 2015-05-23 03:04:06 · 1648 阅读 · 9 评论 -
题目2:MySQL----------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 exa原创 2015-05-18 01:58:28 · 1011 阅读 · 0 评论 -
mysql学习从0开始:表的创建
下面的例子是一个名为 "persons" 的表:IdLastNameFirstNameAddressCity1AdamsJohnOxford StreetLondon2BushGeorgeFifth AvenueNew York3原创 2015-03-30 12:10:35 · 1136 阅读 · 0 评论