How can I use SPACE() function with MySQL WHERE clause?

Ankith Reddy
Published on 20-Feb-2018 16:28:01
In this case, SPACE() function would add white spaces depending upon the condition given in WHERE clause. The following example from student table will demonstrate it.Examplemysql> Select Id, Name, Space(5) from student WHERE Name='Harshit'; +------+---------+----------+ | Id   | Name    | Space(5) | +------+---------+----------+ | 15   | Harshit ... Read More

How can I use SPACE() function along with MySQL’s column data?

Sai Nath
Published on 20-Feb-2018 16:28:29
MySQL table’s column name can be used along with SPACE() function to add white spaces between two column, after or before a specified column. Following the example from the data of ‘Student’ table is used to demonstrate it.Examplemysql> Select Id, Space(8), Name from Student; +------+----------+---------+ | Id   | Space(8) ... Read More

How can INTERSECTION between tables be implemented with the help of MySQL joins?

Published on 20-Feb-2018 16:26:11
Actually, INTERSECTION is just an inner join on all columns. We are taking a simple example of two tables, having the data as follows −mysql> Select * from value1; +------+------+ | i    | j    | +------+------+ | 1    | 1    | | 2    | 2 ... Read More

How can we subtract values in MySQL table with the help of LEFT JOIN?

Vrundesha Joshi
Published on 20-Feb-2018 16:25:26
It can be understood with the help of an example in which two tables are having some values and we subtract the values with the help of LEFT JOIN. Here we are taking two tables having the following data −mysql> Select * from value_curdate; +----+----------+-------+ | Id | Product  | ... Read More

Which function in MySQL is used to add white spaces between two strings?

Swarali Sree
Published on 20-Feb-2018 16:24:21
MySQL SPACE() function is used to add white spaces between two strings. The argument passed in SPACE() function is an integer which specifies how many white spaces we want to add.SyntaxSPACE(N)Here, N is an integer specifies the number of white spaces we want to add.Examplemysql> Select 'My Name is', Space(5), ... Read More

In MySQL, how can we maintain data-driven table relationship using joins?

Published on 20-Feb-2018 16:22:42
Actually, sometimes we can avoid data-driven relationships in tables and we need to join them. It can be done with the help of CASE statement in the SELECT list to handle the joining possibilities. To understand it, we are taking the example of three data-driven tables namely ‘Student_Detail’ which have ... Read More

What MySQL returns if I do not use the keyword ‘RIGHT’ or ‘LEFT’ while writing the query for RIGHT JOIN or LEFT JOIN?

Rishi Rathor
Published on 20-Feb-2018 16:21:02
In both the cases i.e. on not using ‘RIGHT’ or ‘LEFT’ keyword in the query, MySQL will return the result by taking it as INNER JOIN query. It is because the only difference between RIGHT, LEFT and INNER JOIN is the keyword of RIGHT or LEFT. To understand it, we ... Read More

What are the different wildcard characters that can be used with MySQL RLIKE operator?

Ankith Reddy
Published on 20-Feb-2018 16:17:31
The use of wildcards with RLIKE operators can save a lot of effort when we write a query that looks for some pattern (regular expression) in character string. The wildcards used with RLIKE are:^ − It signifies BEGINING of the string. In other words when we use this wildcard with ... Read More

What is MySQL RIGHT JOIN and how can we write MySQL query for it?

Published on 20-Feb-2018 16:16:55
It is similar to LEFT join except that the treatment of tables is reversed. With a RIGHT join, every row from the right table will appear in the result set. For the rows in the right table that do not have the matching rows in the left table, NULL appears ... Read More

What is MySQL LEFT JOIN and how can we write MySQL query for it?

Nancy Den
Published on 20-Feb-2018 16:14:19
While joining two tables using a LEFT join, the concept of left table and right table are introduced and a join-predicate is also required. It returns all the rows in the left table including rows that satisfy join-predicate and also rows which do not satisfy join-predicate. For the rows that do ... Read More