Connecting MySQL with NodeJS
Connecting MySQL with NodeJS
MySQL server is a very popular database server and it is supported by many programming languages. MySQL server is now becoming popular for Node developers also. Node developers start using MySQL server with MongoDB for some special features of the MySQL server. How you can make a connection with MySQL server using the node-mysql client is shown in this tutorial.
Connecting MySQL with NodeJS
How to use MySQL Explain Statement
How to use MySQL Explain Statement
Many queries don't return the expected results and the database administrator needs to find out the reason. MySQL contains a useful tool named EXPLAIN to diagnosis the error for which the query statement is not working properly. It is used at the beginning of any query statement to provide information about the execution of the query. EXPLAIN keyword can be used with SELECT, INSERT, UPDATE, DELETE and REPLACE statements. How to EXPLAIN keyword works with SELECT statements to diagnose errors of the query or optimize the query is shown in this article.
How to use MySQL Explain Statement
Using MySQL Left Join
Using MySQL Left Join
One of the useful clauses of MySQL is JOIN. It is used to retrieve data from two or more related tables. MySQL contains mainly two types of JOIN. One is INNER JOIN and another is OUTER JOIN. The OUTER JOIN is again divided into LEFT JOIN and RIGHT JOIN. This tutorial is mainly focused on the uses of LEFT JOIN. The LEFT JOIN is used to retrieve all records of the left-side table based on the specific conditions and those records from the right-side table where the JOIN fields of both tables match. This tutorial shows the uses of LEFT JOIN in MySQL by using various examples.
Using MySQL Left Join
Using MySQL UNION Operator
Using MySQL UNION Operator
One of the useful MySQL operators is UNION. It is used to combine records from two or more tables by writing a single query. Each select statement used with the UNION operator must contain the same numbers of fields and the data type of each field will be the same also. It retrieves all common and uncommon fields values of all tables mentioned in the query by removing duplicate entries.
Using MySQL UNION Operator