Skip to main content

Posts

Showing posts from September, 2021

How To Delete Duplicate Rows in MySQL

  Summary : in this tutorial, you will learn various ways to delete duplicate rows in MySQL. In the previous tutorial, we have shown you how to  find duplicate values in a table . Once the duplicates rows are identified, you may want to delete them to clean up your data. Prepare sample data The following script  creates table   contacts  and  inserts  sample data into the  contacts  table for the demonstration. DROP TABLE IF EXISTS contacts; CREATE TABLE contacts ( id INT PRIMARY KEY AUTO_INCREMENT, first_name VARCHAR ( 50 ) NOT NULL , last_name VARCHAR ( 50 ) NOT NULL , email VARCHAR ( 255 ) NOT NULL ); INSERT INTO contacts (first_name,last_name,email) VALUES ( 'Carine ' , 'Schmitt' , 'carine.schmitt@verizon.net' ), ( 'Jean' , 'King' , 'jean.king@me.com' ), ( 'Peter' , 'Ferguson' , 'peter.ferguson@google.com' ), ( 'Janine ' , 'Labrune' , '

How To Find Duplicate Values in MySQL

  Summary : in this tutorial, you will learn how to find duplicate values of one or more columns in MySQL. Data duplication happens because of many reasons. Finding duplicate values is one of the important tasks that you must deal with when working with the databases. Setting up a sample table First,  create a table  named  contacts  with four columns:  id ,  first_name ,  last_name , and  email . CREATE TABLE contacts ( id INT PRIMARY KEY AUTO_INCREMENT, first_name VARCHAR ( 50 ) NOT NULL , last_name VARCHAR ( 50 ) NOT NULL , email VARCHAR ( 255 ) NOT NULL ); Code language: SQL (Structured Query Language) ( sql ) Second,  inserts  rows into the  contacts  table: INSERT INTO contacts (first_name,last_name,email) VALUES ( 'Carine ' , 'Schmitt' , 'carine.schmitt@verizon.net' ), ( 'Jean' , 'King' , 'jean.king@me.com' ), ( 'Peter' , 'Ferguson' , 'peter.ferguson@google.com' )

What does SQL in MySQL stand for?

  The SQL in MySQL stands for Structured Query Language. This language is also used in other databases such as Oracle and Microsoft SQL Server.  One can use commands such as the following to send requests from a database: SELECT title FROM publications WHERE author = ' J. K. Rowling’; Note that SQL is not case sensitive. However, it is a good practice to write the SQL keywords in CAPS and other names and variables in a small case.

What are some of the advantages of using MySQL?

  Flexibility:  MySQL runs on all operating systems Power:  MySQL focuses on performance Enterprise-Level SQL Features:  MySQL had for some time been lacking in advanced features such as subqueries, views, and stored procedures. Full-Text Indexing and Searching Query Caching:  This helps enhance the speed of MySQL greatly Replication:  One MySQL server can be duplicated on another, providing numerous advantages Configuration and Security