![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4219 Articles for MySQLi
![Abhinaya](https://www.tutorialspoint.com/assets/profiles/13548/profile/60_54851-1512705920.jpg)
848 Views
‘FIELDS TERMINATED BY’ option should be used when the text file which we want to import into MySQL table is having the values which are separated by a comma(, ) or maybe with any other separator like a colon(:), semicolon(;) etc. It can be understood with the help of the following example −ExampleSuppose we are having the following data, separated by a semicolon(;), in the text file ‘A.txt’ which we want to import into a MySQL file −100;Ram;IND;15000 120;Mohan;IND;18000Now with the help of the following query by using the option ‘FIELDS SEPARATED BY ‘we can import the data into MySQL ... Read More
![Govinda Sai](https://www.tutorialspoint.com/assets/profiles/13542/profile/60_86497-1512650655.jpg)
69 Views
Suppose if we want to upload the changed value rather than the value written in a text file then we need to use user variables along with the SET command. It can be understood with the help of the following example −ExampleSuppose we are having the following data in ‘A.txt’ −105, Chum, USA, 11000 106, Danny, AUS, 12000But we want to upload the value of salary after adding 500 to it at the time of importing it without changing the value of salary in a text file then it can be done with the help of the following query by ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
65 Views
We can use MySQL INSERT() function to insert new string within a string after removing the characters from the original string.SyntaxINSERT(original_string, @pos, @len, new_string)Here, original_string is the string in which we want to insert new string at the place of some specific number of characters.@pos is the position at which the insertion of new string should start.@len is the number of characters should delete from the original string. The starting point of deletion of characters is value of @pos.New_string is the string we want to insert into the original string.Examplemysql> Select INSERT('Yash Sharma', 5, 7, ' Pal'); +----------------------------------+ | ... Read More
![Alankritha Ammu](https://www.tutorialspoint.com/assets/profiles/13523/profile/60_83090-1512649277.jpg)
67 Views
We can also use comparison operators in WHERE clause along with LIKE operator to get specific output. It is demonstrated in the following example −ExampleSuppose we want to get the names end with letter ‘v’ from a table but we do not want a specific name say ‘Gaurav’ in the result set then we need to use comparison operator along with LIKE operator as follows −mysql> Select * from student where name like '%v'and name != 'gaurav'; +------+-------+---------+---------+--------------------+ | Id | Name | Address | Subject | year_of_admission | +------+-------+---------+---------+--------------------+ | 2 | Aarav | Mumbai | History ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
324 Views
As we know that LIKE operator is used along with WILDCARD characters to get the string having specified string. Basically, WILDCARD is the characters that help search data matching complex criteria. Followings are the types of wildcard which can be used in conjunction with LIKE operator % -The PercentageThe ‘%’ wildcard is used to specify a pattern of 0, 1 or more characters. A basic syntax for using % wildcard is as followsSelect Statement…Where column_name LIKE ‘X%’Here, X, is any specified starting pattern such as the single character of more and % matches any number of characters starting from 0.The percentage ... Read More
![Ramu Prasad](https://www.tutorialspoint.com/assets/profiles/13539/profile/60_87996-1512650215.jpg)
159 Views
Suppose if there is a blank line between two line written in the text file then MySQL evaluates it as the data line while importing that text file into MySQL table. It can be understood with the help of the following example −ExampleSuppose we are having a blank line between two lines in a text file named ‘A.txt’ as follows −105, Chum, USA, 11000 106, Danny, AUS, 12000Now we can write the following query to import the data from text file into MySQL table −mysql> LOAD DATA LOCAL INFILE 'd:\A.txt' INTO table employee10_tbl FIELDS TERMINATED BY ', '; Query OK, ... Read More
![Ayyan](https://www.tutorialspoint.com/assets/profiles/13521/profile/60_79767-1512650417.jpg)
326 Views
MySQL returns a specified number of characters of a string with the help of LEFT() and RIGHT() functions.MySQL LEFT() function will return the specified number of characters from the left of the string.SyntaxLEFT(str, length)Here str is the string from which a number of characters would be returned and the length is an integer value which specifies how many characters to be returned.Examplemysql> Select LEFT('My Name is Ram', 7); +---------------------------+ | LEFT('My Name is Ram', 7) | +---------------------------+ | My Name | +---------------------------+ 1 row in set (0.00 sec)MySQL RIGHT() function will ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
67 Views
We can find a string of specified pattern within another string by using LIKE operator along with WILDCARDS.SyntaxLIKE specific_patternSpecific_pattern is the pattern of string we want to find out within another string.ExampleSuppose we have a table named ‘student’ having names of the students and we want to get the details of all those students which are having the pattern of string ‘av’ within their names. It can be done with the help of following MySQL query −mysql> Select * from Student Where Name LIKE '%av%'; +------+--------+---------+-----------+ | Id | Name | Address | Subject | +------+--------+---------+-----------+ ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
102 Views
We can use LCASE() and LOWER() functions for changing the character case of a string to lower case and UCASE() and UPPER() functions for changing the character case of a string to upper case.Examplemysql> Select LCASE('NEW DELHI'); +--------------------+ | LCASE('NEW DELHI') | +--------------------+ | new delhi | +--------------------+ 1 row in set (0.00 sec) mysql> Select LOWER('NEW DELHI'); +--------------------+ | LOWER('NEW DELHI') | +--------------------+ | new delhi | +--------------------+ 1 row in set (0.00 sec) mysql> Select UCASE('new delhi'); +--------------------+ | UCASE('new delhi') | +--------------------+ ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
309 Views
As we know, both the functions are used to search a string from the arguments provided in them but there are some significant differences between them as followsFIND_IN_SET() function uses the string list that is itself a string containing the substring separated by commas. Whereas, INSTR() function contains a string from which it will find the position of the first occurrence of the substring if present. In case of integers, FIND_IN_SET() is much more suitable than INSTR() function. It can be understood by the following exampleExamplemysql> Select IF(INSTR('10, 11, 12, 13', 2) > 0, 1, 0) As Result; +--------+ | Result ... Read More