Thu, 2 May 2024


Category: Databases


How to join results with UNION in MySQL?

How to join results with UNION in MySQL?

The UNIONs were introduced in MySQL 4. The unions are useful if you wish to join the results from more than one query, but be aware that ...
Tue, 29 March 2022

How to use regular expressions in MySQL database queries?

One of the things I like the most in MySQL is the possibility to use regular expressions in the SQL queries. A very simple example illustrating this is to select ...
Sun, 12 December 2021

How to create and use temporary tables in MySQL?

The temporary tables could be very useful in some cases to keep temporary data. The most important thing that should be know for temporary tables is that they will be ...
Fri, 8 October 2021

Is the LOAD DATA statement faster than INSERT and how much?

The LOAD DATA statement could be 15 even 20 faster than an ordinary INSERT so you should consider to use it when intending to insert a lot of data ...
Fri, 5 February 2021

How to connect and execute SELECT statements in MySQL with JAVA?

import java.sql.*; public class Select { public static void main (String[ ] args) { Connection conn = null; String url = "jdbc:mysql://localhost/"; String userName = "username1"; String password = "password1"; try { Class.forName ("com.mysql.jdbc.Driver").newInstance ( ); conn = DriverManager.getConnection (url, userName, password); // ...
Mon, 28 September 2020

How to speed up the execution of INSERT statement in MySQL?

A very good approach to speed up the execution of an INSERT statement is to temporarly disable the keys (when executing your query), this will help MySQL to concetrate on ...
Fri, 12 June 2020

What is the difference between indexes for HEAP MyISAM and MERGE MySQL tables?

Some of the most important things concerning indexes for the different table types are listed below: MyISAM BLOB and TEXT indexes can exist. Null values are permissible in indexes ...
Sun, 7 June 2020

How to load data from CSV or any other character delimited file in a MySQL table?

To do that, you may use the following query: LOAD DATA INFILE 'Input.txt' INTO TABLE MyInputTable FIELDS TERMINATED BY '~'; where ~ could be whatever char delimiter you might have
Mon, 27 April 2020



See All Scripts




Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox