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

Example Analysis of MySQL Database function for Software testing

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

Share

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

This article will explain in detail about the MySQL database function of software testing sample analysis, Xiaobian feel quite practical, so share to you as a reference, I hope you can have some harvest after reading this article.

I.MySQL function

1. mathematical function

PI() #Returns the value of pi (pi) The default display decimal place is 6 digits

FLOOR(x) Returns the largest integer less than x (rounded off)

CEILING(x)

ROUND (x,y) Rounds the operation Su to the nearest decimal place. If y is negative, the left decimal place is reserved.

RAND(x) returns random number x same returns random number same

TURNCATE(x,y) returns x to y decimal places

ABS (X) Returns the absolute value of x

MOD(X, Y) returns the remainder of X divided by Y, even for fractions

SQRT(x) returns the second square root of nonnegative x

SIGN(X) Returns the sign of the parameter. For positive, 0, negative x, return 1, 0,-1 respectively.

POW(X,Y), POWER(X,Y), EXP(X) power function

LOG(X), LOG10 (X) Logarithmic operations

RADIANS(X), DEGREES(X) Angle and radian interconversion function

SIN(X), ASIN(X) sine function, arcsine function

COS(X), ACOS(X) cosine function and inverse cosine function

2. aggregate function

AVG (x)#Average

COUNT (col)#Returns the number of uncontrolled values in a column

MIN (col)#Returns the minimum value of a column

MAX (col)#Returns the maximum value of a column

SUM (col)#Returns the sum of a column

3. String functions

CONCAT(s1,s2,s3,...)# Connection strings s1, s2, s3,...

LTRIM(str) #Remove spaces at the beginning of str

RTRIM(str)#Remove spaces at the end of str

TRIM(str)#Remove spaces at both ends of STR

substring(str, start intercept loc, intercept length len)#loc=1: first bit, 2 second bit

4. date functions

YEAR(date) #Returns date year (1000-9999)

MONTH(data)#Returns date month (1-12)

DAY(data)#Returns date (1-31)

HOUR(time)

MINUTE(time)

SECOND(time)

DATE(datetime)

TIME(datetima)

5. Grouping function

as Keyword for alias, optional

select mathematical function (field name) alias, field name from indicates group by field name

Find the average grade of each class

#If grouping functions are used, fields that are not in the grouping must be placed after group by

About "software testing MySQL database function sample analysis" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

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