Category: MySQL Tutorial

python tutorials and learn python

Created with Sketch.

MySQL Natural Sorting

MySQL Natural Sorting Summary: in this tutorial, you will learn about some natural sorting techniques in MySQL using the ORDER BY clause. Setting up a sample table First, create a new table named items by using the following  CREATE TABLE statement: CREATE TABLE items ( id INT AUTO_INCREMENT PRIMARY KEY, item_no VARCHAR(255) NOT NULL );…
Read more

MySQL Export Table to CSV

MySQL Export Table to CSV Summary: in this tutorial, you will learn various techniques of how to export a MySQL table to a CSV file. The CSV stands for comma separated values. You often use the CSV file format to exchange data between applications such as Microsoft Excel, Open Office, Google Docs, etc. It will be useful…
Read more

Import CSV File Into MySQL Table

Import CSV File Into MySQL Table This tutorial shows you how to use the LOAD DATA INFILE statement to import CSV file into MySQL table. The  LOAD DATA INFILE statement allows you to read data from a text file and import the file’s data into a database table very fast. Before importing the file, you need…
Read more

MySQL Collation

MySQL Collation Summary: in this tutorial, you will learn about MySQL collation and how to set character sets and collations for the MySQL server, database, table, and column. Introduction to MySQL collation A MySQL collation is a set of rules used to compare characters in a particular character set. Each character set in MySQL has…
Read more

MySQL Character Set

MySQL Character Set Summary: in this tutorial, you will learn about MySQL character set. After the tutorial, you will know how to get all character sets in MySQL, how to convert strings between character sets, and how to configure proper character sets for client connections. Introduction to MySQL character set A MySQL character set is…
Read more

MySQL CHECK Constraint Emulation

MySQL CHECK Constraint Emulation Summary: in this tutorial, you will learn how to use emulate CHECK constraints in MySQL using triggers or views. MySQL 8.0.16 fully implemented the SQL CHECK constraint. If you use MySQL 8.0.16 or later, check it out the CHECK constraint tutorial. Emulating CHECK constraints using triggers To emulate CHECK constraints in…
Read more

MySQL DEFAULT

MySQL DEFAULT Summary: in this tutorial, you’ll learn about MySQL DEFAULT constraint and how to use it effectively. Introduction to the MySQL DEFAULT constraint MySQL DEFAULT constraint allows you to specify a default value for a column. Here’s the syntax of the DEFAULT constraint: column_name data_type DEFAULT default_value; Code language: SQL (Structured Query Language) (sql)…
Read more

MySQL CHECK Constraint

MySQL CHECK Constraint Summary: in this tutorial, you will learn how to use MySQL CHECK constraint to ensure that values stored in a column or group of columns satisfy a Boolean expression. MySQL 8.0.16 implemented the SQL check constraint. If you use MySQL with the earlier versions, you can emulate a CHECK constraint using a…
Read more

MySQL UNIQUE Constraint

MySQL UNIQUE Constraint Summary: in this tutorial, you will learn about MySQL UNIQUE constraint and how to use UNIQUE constraint to enforce the uniqueness of values in a column or a group of columns in a table. Introduction to MySQL UNIQUE constraint Sometimes, you want to ensure values in a column or a group of…
Read more

MySQL Disable Foreign Key Checks

MySQL Disable Foreign Key Checks Summary: in this tutorial, you will learn how to disable foreign key constraint checks in MySQL. Sometimes, it is very useful to disable foreign key checks. For example, you can load data to the parent and child tables in any order with the foreign key constraint check disabled. If you…
Read more