/images/avatar.png

MySQL Cookbook 第5章 处理字符串

5.0. Introduction

  • A string can be binary or nonbinary. Binary strings are used for raw data such as images, music files, or encrypted values. Nonbinary strings are used for character data such as text and are associated with a character set and collation (sort order).
  • A character set determines which characters are legal in a string. You can choose collations according to whether you need comparisons to be case sensitive or case insensitive, or to use the rules of a particular language.
  • Data types for binary strings are BINARY, VARBINARY, and BLOB. Data types for nonbinary strings are CHAR, VARCHAR, and TEXT, each of which permits CHARACTER SET and COLLATE attributes.
  • You can convert a binary string to a nonbinary string and vice versa, or convert a nonbinary string from one character set or collation to another.
  • You can use a string in its entirety or extract substrings from it. Strings can be combined with other strings.
  • You can apply pattern-matching operations to strings.
  • Full-text searching is available for efficient queries on large collections of text.

5.1. String Properties

One string property is whether it is binary or nonbinary:

MySQL Cookbook 第4章 表管理

4.0. Introduction

This chapter covers topics that relate to creating and populating tables: • Cloning a table • Copying from one table to another • Using temporary tables • Generating unique table names • Determining what storage engine a table uses or converting it from one storage engine to another

4.1. Cloning a Table

Problem

You want to create a table that has exactly the same structure as an existing table.

MySQL Cookbook 第3章 从表中查询数据

3.0. 介绍

本章专注使用SELECT语句从你的数据库获取信息。

3.1. 指定SELECT哪行哪列

问题

你想要从一张表中展示特定行和列。

解决方法

为了指示展示哪一列,在输出列表中指定它。为了指示展示哪一行,使用WHERE语句指定满足条件的行。

MySQL Cookbook 第2章 编写基于MySQL的程序

2.0. 介绍

MySQL Client API Architecture

Each MySQL programming interface covered in this book uses a two-level architecture:

  • The upper level provides database-independent methods that implement database access in a portable way that’s the same whether you use MySQL, PostgreSQL, Ora‐ cle, or whatever.
  • The lower level consists of a set of drivers, each of which implements the details for a single database system.

2.1. Connecting, Selecting a Database, and Disconnecting

Problem

MySQL Cookbook 第1章 使用mysql客户端

1.0 介绍

本章描述了mysql的能力以使你能够更有效的使用它:

  • 设置一个MySQL账户以使用cookbook数据库
  • 指定连接参数和使用配置文件
  • 交互模式和批量模式执行SQL语句
  • 控制mysql输出格式
  • 使用用户定义的变量保存信息

为了你自己试验本书中的例子,你需要一个MySQL用户和一个数据库。接下来假设::