Reproduced:MySQL string intercept function:left(), right (), substring (), Substring_index (). There is also mid (), substr (). wheremid (), substr ( ) is equivalent to the substring () function,the function ofsubstring ( ) is very powerful and
MySQL is one of the most commonly used relational databases in development work, and he is an open source database management Nishinomiya, developed, released and supported by MySQL AB. MySQL is a cross-platform open source relational database
Query fuzzy query (like) scope query
Non-contiguousselect * from students where id in(1,3,8);
Continuous select * from students where id between 3 and 8 and gender=1;
Polymerizationget statistical data quickly
COUNT (*)
First, Introduction
Inserting data Insert
Third, update data updates
Iv. Deleting data Delete
Five, query data select
VI. Rights Management
First, IntroductionMySQL Data manipulation: DML======================================
MySQL Database syntax-multi-table query exercise oneYun ZhengjieCopyright Notice: Original works, declined reprint! Otherwise, the legal liability will be investigated.This blog mainly describes the foreign key constraints of multi-table queries,
MySQL server-side Use tool program
mysqld-SQL Daemon (that is, the MySQL server process). The program must start running to connect to the server to access the database.
mysqld_safe-Server startup script, you can start the MYSQLD server
I. Summary of MYSQL commands1. Create a librarycreate database test1;2. Authorizing a usergrant all privileges on *.* to ‘feng‘@‘%‘ identified by ‘[email protected]‘;3. Create a tablecreate table Teacher(teaId int not null,teaname varchar(100),age
In my hundred tear not his sister case, Baidu to a pro-test useful articles, as follows:1. Here I install MySQL in the/usr/local/mysql directory, but also can be installed in other places;Mkdir/usr/local/mysql2. Download MySQL compression packwget
Waiting to be written ~Explain:SELECTCase-------------IfWhen the sex= ' 1 ' then ' Male '-------------sex= ' 1 ', the return value ' male 'When the sex= ' 2 ' then ' female '-------------sex= ' 2 ', the return value ' female 'else 0 return ' other '-
1) Prepare test data: Build a table and insert test data in bulk by writing scripts.[email protected] scripts]# cat ceshi.sh#/bin/bashPath= "/usr/local/mysql/bin: $PATH" #定义mysql命令所在路径Myuser=root #定义数据用户名Dbpath=/server/backup #定义数据备份目录mypass=xiwei199
The table structure is as follows, the article has only 690 articles.Article table article (id,title,content)Tag table tag (tid,tag_name)Label Article intermediate table Article_tag (id,tag_id,article_id)One of the labels for the TID is 135, and the
Code for custom functions:drop FUNCTION IF EXISTS fn_hrstaffbase_getnamefromidcard Delimiter// CREATE FUNCTION Fn_hrstaffbase_getnamefromidcard (a VARCHAR ()) RETURNS VARCHAR () Begin Return (SELECT staff_ name from hr_staff_base where idcard =
First of all to ensure that the account or password input error, you can log in to MySQL through CMD, if you confirm the password is correct, with the Python connection or report 1045 using Password:no, can be modified:Because mysql8.0 and mysql5.7
☆1. Q.ques_group passed in as null or"'do not query for this condition: value="SELECT * fromQuestion QWHERE 1=1 and(Q.ques_group=: Quesgroupor: Quesgroup is NULL or: Quesgroup="') andQ.type=: Type ",1: (Q.ques_group=: Quesgroupor:
Installing PIP3 install Pymysql on the cmd command lineIf the installation is successful, the database can be pycharm and checked in the operation.Import pymysql# Module # CREATE link conn=Pymysql.connect (Host='127.0.0.1', Port=3306, the user='Root'
mentioned aboveCentOS7 default does not support MySQL, using yum install MySQL installation is mariadb,mariadb MySQL is an open source branch, so we need to configure a new Yum source for MySQL installationOperationStep 1: Download the yum source to
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