Showing entries 1 to 2
Displaying posts with tag: Learning MySQL (reset)
Getting Started with MySQL Cloud Service

MySQL Cloud Service is a new(ish) way to run MySQL in the cloud, without worrying about installing the server yourself and configuring security, performance, or monitoring, because that's all taken care of by the service. This makes it great for setting up quick throwaway instances that you can just as easily tear down, and it's ideal for developers who don't want to get in line to wait for their DBAs to set up a server for them.

If you've got an account with Oracle Public Cloud (or even a trial account) that has MySQL Cloud Service enabled, it's only a few clicks to get an instance set up. Here's a short overview.

When you've got your instance, you can connect to it with several different …

[Read more]
How to Create an Index Based on an Expression, with Generated Columns

One of the many great new features included in MySQL 5.7 is the generated column. A generated column is a column in a table where the data is calculated for you, based on an expression that you provide.

To understand the benefits of using generated columns, let's consider a very simple example. Imagine that I want to find out how many new hires my organization had in the year 2000. Here's my table:

mysql> DESC employees; +------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+---------------+------+-----+---------+-------+ | emp_no | int(11) | NO | PRI | NULL | | | birth_date | date | NO | | NULL | | | first_name | varchar(14) | NO | | NULL | | | last_name | varchar(16) | NO | | NULL | | | gender | enum('M','F') | NO | | NULL | | | hire_date | date | NO | | NULL | | +------------+---------------+------+-----+---------+-------+ 6 rows in set (#.## sec)

[Read more]
Showing entries 1 to 2