2

What i know is -> Modify means it going to modify the record if it exists. If record is not there it going to add that record. Update means it is only modify the record.

Sanjit Prasad
  • 398
  • 2
  • 12
  • 1
    And what is your exact question? – Nico Haase May 18 '18 at 15:25
  • I've had to google this, just for refreshing my memory, but there is no command like `MODIFY` in MySQL that modifies column data – Nico Haase May 18 '18 at 15:26
  • actually i want to know when to use modify over update in sql. – Sanjit Prasad May 18 '18 at 15:28
  • 1
    Modify does not exist in MySQL in the context which you are using the term. Neither does merge.you may be looking for insert...on duplicate key – P.Salmon May 18 '18 at 15:33
  • 3
    [Modify](https://dev.mysql.com/doc/refman/8.0/en/alter-table.html) (Data Definition Language) changes structure of an object [update](https://dev.mysql.com/doc/refman/8.0/en/update.html) (Data Manipulation Language) changes data. So if you're changing data UPDATE, or INSERT on Duplicate key update. – xQbert May 18 '18 at 15:36

1 Answers1

3

If you are looking to Modify column data (as stated in your comment), that would be an UPDATE command.

MODIFY in RDBMS is a DDL (data definition language) for defining Entities (tables) and their properties (columns).

I would encourage you to take a look at this question:

What is DDL vs DML

Tolu
  • 175
  • 4
  • 10