- Trending Categories
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 6702 Articles for Database
![Anjana](https://www.tutorialspoint.com/assets/profiles/13774/profile/60_78029-1512648681.jpg)
48 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)
![Govinda Sai](https://www.tutorialspoint.com/assets/profiles/13542/profile/60_86497-1512650655.jpg)
70 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)
![Ramu Prasad](https://www.tutorialspoint.com/assets/profiles/13539/profile/60_87996-1512650215.jpg)
81 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.
![Rama Giri](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
50 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)
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
56 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)
![Vikyath Ram](https://www.tutorialspoint.com/assets/profiles/13780/profile/60_74413-1512648006.jpg)
162 Views
MySQL cannot perform a case-sensitive comparison when comparing characters. It can be illustrated with the following example from table ‘Employee’ having the following data −mysql> Select * from Employee; +----+--------+--------+ | ID | Name | Salary | +----+--------+--------+ | 1 | Gaurav | 50000 | | 2 | Rahul | 20000 | | 3 | Advik | 25000 | | 4 | Aarav | 65000 | | 5 | Ram | 20000 | | 6 | Mohan | 30000 | | 7 | Aryan | NULL | | 8 | Vinay | NULL | +----+--------+--------+ 8 rows in set (0.09 sec)The result set of the following query shows that MySQL is not case sensitive when comparing characters.mysql> Select * from Employee WHERE Name IN ('gaurav','RAM'); +----+--------+--------+ | ID | Name | Salary | +----+--------+--------+ | 1 | Gaurav | 50000 | | 5 | Ram | 20000 | +----+--------+--------+ 2 rows in set (0.00 sec)
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
494 Views
As we know that MySQL is not case-sensitive while comparing characters but it can be changed i.e. MySQL can perform case-sensitive string comparison if we will use BINARY keyword before the expression. Actually, BINARY keyword instructs MySQL to compare the characters in the string using their underlying ASCII values rather than just their letters. It can be illustrated with the following example from table ‘Employee’ having the following data −mysql> Select * from Employee; +----+--------+--------+ | ID | Name | Salary | +----+--------+--------+ | 1 | Gaurav | 50000 | | 2 | Rahul | 20000 | | 3 ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
2K+ Views
Actually, both MySQL IFNULL() and NULLIF() functions are having an almost same syntax as given below −The syntax of IFNULL()IFNULL(expression1, expression2)The syntax of NULLIF()NULLIF(expression1, expression2)They can be distinguished in the way they return the first argument as result. IFNULL() function will return the first argument as a result if it is not NULL and NULLIF() function will return the first argument as a result if both the arguments are not same.mysql> Select IFNULL('Ram', 'Shyam'); +-----------------------+ | IFNULL('Ram', 'Shyam') | +-----------------------+ | Ram | +-----------------------+ 1 row in set (0.00 sec) mysql> Select ... Read More
![Prabhas](https://www.tutorialspoint.com/assets/profiles/13554/profile/60_90506-1512543588.jpg)
119 Views
Once we get connected to the MySQL server, it is required to select a database to work with. This is because there might be more than one database available with the MySQL Server.It is very simple to select a database from the mysql> prompt. We can use SQL command ‘use’ to select a database. To illustrate it we are selecting the database named ‘Tutorials’ in the following example −Example[root@host]# mysql -u root -p Enter password:****** mysql> use TUTORIALS; Database changed mysql>Now, we have selected the TUTORIALS database and all the subsequent operations will be performed on the TUTORIALS database.Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
988 Views
As we know that if no comparison or condition is true then CASE statement returns the result specified after ELSE statement. But what if there is no ELSE statement, then in this situation, CASE statement would return NULL. Following is an example to demonstrate it.Examplemysql> Select CASE 100 -> WHEN 150 THEN 'It is matched' -> WHEN 200 THEN 'It is not matched' -> END As 'It Returns NULL'; +-----------------+ | It Returns NULL | +-----------------+ | NULL | +-----------------+ 1 row in set (0.00 sec)The query below, using the data from ... Read More