Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use cases for annotations in MySQL

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the use cases of annotations in MySQL, which is very detailed and has certain reference value. Friends who are interested must finish it!

Each language has its own way of annotating, and the more code there is, the more important it is. In general, comments can appear anywhere in the program to prompt or explain the function and function of the program to the user or programmer. This article focuses on the comments in MySQL.

1. Field comment

Create table test1 (id int primary key comment 'user_id')

two。 Table comments

Create table test2 (id int primary key,name varchar (20) not null) comment='table_comment'

3. Single-line comment

A) A single-line comment can be made with a # comment character, which is followed by a comment directly. The format is as follows:

Create table test3 (id int primary key,name varchar (20) not null# pair is just a single-line attribute)

B) single-line comments can use-- comment characters,-- need to add a space after the comment character before the comment can take effect. The format is as follows:

Create table test4 (id int primary key,name varchar (20) not null-- one-line attribute school varchar (20) not null-- I am a-- (wrong comment because-- there is no space after it))

4. Multiline comment

Create table test5 (id int primary key,name varchar (30) not null/*) is so big that it can't be stewed for thousands of miles, so there is a heavenly eye * /). The above is all the content of this article, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report