
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 4381 Articles for MySQL

103 Views
After running a query, MySQL returns the number of rows and gives time in the output that shows how much it took for running that query. As for example, if we run the following querymysql> create table e1(id int); Query OK, 0 rows affected (0.23 sec)It is showing the time (0.23 sec).

188 Views
MySQL provides help command to get server-side help. The syntax of this command is as follows −mysql> help search_stringMySQL uses the argument of help command as the search string for accessing the contents of MySQL reference manual. The search will fail if there would be no match for the search string.For example − suppose I want to get server-side help regarding INTEGER data type then the command for the same would be as follows −mysql> help INTEGER Name: 'INTEGER' Description: INTEGER[(M)] [UNSIGNED] [ZEROFILL] This type is a synonym for INT. URL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.htmlRead More

92 Views
Suppose if we are trying to add the numbers having non-numeric text between numbers of a string, then MySQL simply use the first number of that string to evaluate the addition along with a warning. Following example will exhibit this −Examplemysql> Select '1525 * 2' + '200'As Total; +-------+ | Total | +-------+ | 1725 | +-------+ 1 row in set, 1 warning (0.00 sec)From the above query, it is clear that MySQL uses only first number i.e. 1525 for evaluating the addition and ignores the non-numeric text.

160 Views
In MySQL, we can combine two or more strings along with a separator by using CONCAT_WS() function. The syntax of this function is CONCAT_WS(Separator, String1, String2, …, StringN)Here, the arguments of CONCAT_WS functions are Separator and the strings which need to be concatenated along with that separator as a single string. Separator except for numeric value must enclose within quotes.Examplemysql> Select CONCAT_WS('.', 'www', 'tutorialspoint', 'com'); +---------------------------------------------+ | CONCAT_WS('.', 'www', 'tutorialspoint', 'com') | +---------------------------------------------+ | www.tutorialspoint.com | +---------------------------------------------+ 1 row in set (0.00 sec)In this example above, we can see that the separator ... Read More

82 Views
Suppose if we are trying to add the numbers having non-numeric text before them, then MySQL simply evaluate the value of such number as 0. Following example will exhibit this −Examplemysql> Select 'Kg 1525' + 'Oz 200'As Total; +-------+ | Total | +-------+ | 0 | +-------+ 1 row in set, 2 warnings (0.00 sec) mysql> Select 'Kg 1525' + '200'As Total; +-------+ | Total | +-------+ | 200 | +-------+ 1 row in set, 1 warning (0.00 sec)

118 Views
The following MySQL statement can find out the storage engine used for ‘Student’ table in database named ‘tutorial’ −mysql> SELECT ENGINE FROM information_schema.TABLES -> WHERE TABLE_SCHEMA = 'tutorial' -> AND TABLE_NAME = 'Student'; +--------+ | ENGINE | +--------+ | MyISAM | +--------+ 1 row in set (0.13 sec)

126 Views
While creating a MySQL table, the storage engine can be specified as follows −mysql> CREATE TABLE Student(id INTEGER PRIMARY KEY, Name VARCHAR(15)) -> ENGINE = 'MyISAM'; Query OK, 0 rows affected (0.28 sec)The ENGINE keyword specifies the storage engine used for this particular table.

83 Views
Suppose if we are trying to add the numbers having non-numeric text after them, then MySQL simply discard the non-numeric text and evaluates the addition of numeric values along with warnings. Following example will exhibit this −Examplemysql> Select '1525 Kg' + '200 Oz'As Total; +-------+ | Total | +-------+ | 1725 | +-------+ 1 row in set, 2 warnings (0.00 sec)

106 Views
If we are trying to add two numbers that are contained in quotes, means we are treating the string as a number. In this case, MySQL converts the value into the closet numeric equivalent and evaluates the result. Following example will demonstrate it.Examplemysql> Select '1525' + '200'As Total; +-------+ | Total | +-------+ | 1725 | +-------+ 1 row in set (0.00 sec)