Blog

python tutorials and learn python

Created with Sketch.

MySQL Reset Auto Increment Values

MySQL Reset Auto Increment Values Summary: in this tutorial, we  will show you various ways to reset auto-increment values of AUTO_INCREMENT columns in MySQL. MySQL provides you with a useful feature called auto-increment. You can assign the AUTO_INCREMENT attribute to a column of a table to generate a unique identity for the new row. Typically,…
Read more

How To Select The nth Highest Record In MySQL

How To Select The nth Highest Record In MySQL Summary: in this tutorial, you will learn how to select the nth highest record in a database table using various techniques. It is easy to select the highest or lowest record in the database table with the MAX or MIN function. However, it’s a little bit…
Read more

MySQL Select Random Records

MySQL Select Random Records Summary: in this tutorial, you will learn various techniques to select random records from a database table in MySQL. Sometimes, you have to select random records from a table, for example: Selecting some random posts in a blog and display them in the sidebar. Selecting a random quote for displaying “quote…
Read more

MySQL row_number, This Is How You Emulate It.

MySQL ROW_NUMBER, This is How You Emulate It   Summary: in this tutorial, you will learn how to emulate the row_number() function in MySQL. We will show you how to add a sequential integer to each row or group of rows in the result set. Notice that MySQL has supported the ROW_NUMBER() since version 8.0. If…
Read more

MySQL REGEXP: Search Based On Regular Expressions

MySQL REGEXP: Search Based On Regular Expressions   Summary: in this tutorial, you will learn how to use the MySQL REGEXP operator to perform complex searches based on regular expressions. Introduction to regular expressions A regular expression is a special string that describes a search pattern. It is a powerful tool that gives you a…
Read more

How To Change MySQL Storage Engine

How To Change MySQL Storage Engine Summary: in this tutorial, you will learn how to which storage engine a table is using and how to change the storage engine of the table to a different one. MySQL supports many kinds of storage engines that provide different capabilities and characteristics. For example, the InnoDB tables support…
Read more

How To Compare Successive Rows Within The Same Table in MySQL

How To Compare Successive Rows Within The Same Table in MySQL Summary: in this tutorial, we will show you how to compare successive rows within the same table using the self-join technique. Suppose you have a table called inventory with the structure defined by the CREATE TABLE statement as follows: CREATE TABLE inventory( id INT AUTO_INCREMENT…
Read more

MySQL SELECT INTO Variable

MySQL SELECT INTO Variable Summary: in this tutorial, you will learn how to use the MySQL SELECT INTO variable to store query results in variables. MySQL SELECT INTO Variable syntax To store query result in one or more variables, you use the SELECT INTO variable syntax: SELECT c1, c2, c3, … INTO @v1, @v2, @v3,……
Read more

MySQL Variables

MySQL Variables Summary: in this tutorial, you will learn how to use MySQL user-defined variables in SQL statements. Introduction to MySQL user-defined variables Sometimes, you want to pass a value from an SQL statement to another SQL statement. To do this, you store the value in a MySQL user-defined variable in the first statement and…
Read more

How To Copy a MySQL Database

How To Copy a MySQL Database Summary: this tutorial shows you how to copy a MySQL database on the same server and from a server to another. Copy a MySQL database on the same server To copy a MySQL database, you need to follow these steps: First, create a new database using CREATE DATABASE statement.…
Read more