Mysql Study Notes 001 and mysql Study Notes 001

Source: Internet
Author: User

Mysql Study Notes 001 and mysql Study Notes 001
Mysql is case-insensitive and requires the server to tell him the version number.

Select version ();

Mysql> select version ();
+ ----------- +
| VERSION () |
+ ----------- +
| 5.7.18 |
+ ----------- +
1 row in set (0.09 sec)

Mysql>

Current Time

SELECT CURRENT_TIME ();

Mysql> SELECT CURRENT_TIME ();
+ ---------------- +
| CURRENT_TIME () |
+ ---------------- +
| 13:57:15 |
+ ---------------- +
1 row in set (0.00 sec)

Current date

SELECT CURRENT_DATE ();

Mysql> SELECT CURRENT_DATE ();
+ ---------------- +
| CURRENT_DATE () |
+ ---------------- +
|
+ ---------------- +
1 row in set (0.00 sec)

Mysql>

Another now

Select now ();

Mysql> select now ();
+ --------------------- +
| NOW () |
+ --------------------- +
| 13:57:43 |
+ --------------------- +
1 row in set (0.00 sec)

Mysql>

Simple Calculator

Mysql> select sin (PI ()/4), (4 + 1) * 5;
+ -------------------- + --------- +
| SIN (PI ()/4) | (4 + 1) * 5 |
+ -------------------- + --------- +
| 1, 0.7071067811865475 | 25 |
+ -------------------- + --------- +
1 row in set (0.00 sec)

Mysql>

Who am I

Select user ();

Mysql> select user ();
+ ---------------- +
| USER () |
+ ---------------- +
| Root @ localhost |
+ ---------------- +
1 row in set (0.00 sec)

Mysql>

If I decide not to execute a command in the input process, enter \ c to cancel it.

Mysql> SELECT
-> USER ()
-> \ C
Mysql>

The following table shows the various prompts that you can see and briefly describes the mysql status they represent.

For example, I want to find an 18-year-old girl named Lu in the beautiful girl table, but I have no hands left. I accidentally typed it wrong...

Mysql> SELECT * from beautifulgirls where name = 'lu AND age = 18
'>' \ C
Mysql>

In this way, I can find the pretty girl I want to find (\ happy)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.