WebDevelopersNotes logo

home-icon Home / MySQL / mysql beginner tutorial – Deleting entries from tables

mysql beginner tutorial – Deleting entries from tables

mysql beginner tutorial - Deleting entries from tables

The SQL delete statement requires the table name and optional conditions.

DELETE from table_name [WHERE conditions];

NOTE: If you don’t specify any conditions ALL THE DATA IN THE TABLE WILL BE DELETED!!!

One of the Multimedia specialists ‘Hasan Rajabi’ (employee id 10) leaves the company. We’ll delete his entry.

DELETE from employee_data    
WHERE emp_id = 10;

Query OK, 1 row affected (0.00 sec)

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

In Japan, the term Sudoku is copyrighted. It was coined by Maki Kaji, president of Nikoli, a company that publishes puzzle books. The Japanese, however, still refer to the puzzle by it's original name - Number Place. Sudoku means digit-single in Japanese. By the way, Sudoku did not originate it Japan. The popular puzzle was invented by an American architect, Howard Garns and first published as Number Place in the May 1979 issue of Dell Pencil Puzzles and Word Games. In Japan, it was first published by the monthly Nikoli magazine. Sudoku gained worldwide popularity because of the efforts of Wayne Gould who not only convinced The Times UK to publish it but also developed a program that would churn out countless puzzles of specified difficulty. Gould was also responsible for taking Sudoku to the United States where it was published in several daily newspapers across the country. [more...]