..
Using the UPDATE command, we can act on existing records and modified.
Suppose, for example, have, in our DB table phone_numbers structured as follows:
| name | telephone |
| John Smith | 123.456789 |
| Antonio Bianchi | 987.654321 |
| Claudio Verdi | 321.654987 |
UPDATE phone_numbers September Phone = '213 .698547 ' WHERE name = 'John Doe'So far nothing new.
| name | by | cites | prov |
| John Smith | Via Roma 11 | Turin | TO |
| Antonio Bianchi | Via Garibaldi 2 | Gallarate | VA |
| Claudio Verdi | Piazza Cavour 4 | Como | CO |
Returning to the first we use a query like this:
UPDATE phone_numbers INNER JOIN addresses ON numeri_di_telefono.nome = indirizzi.nome September numeri_di_telefono.telefono = '213 .698547 ', indirizzi.via = 'Square of the Republic 5', indirizzi.citta = 'Milan', indirizzi.prov = 'MI' WHERE numeri_di_telefono.nome = 'John Doe'After executing the query UPDATE verified by two separate SELECT on two tables. Here are their results (highlighted in yellow):
1) Table phone_numbers
SELECT * FROM phone_numbers
| name | telephone |
| John Smith | 213.698547 |
| Antonio Bianchi | 987.654321 |
| Claudio Verdi | 321.654987 |
SELECT * FROM addresses
| name | by | cites | prov |
| John Smith | Square of the Republic 5 | Milan | MI |
| Antonio Bianchi | Via Garibaldi 2 | Gallarate | VA |
| Claudio Verdi | Piazza Cavour 4 | Como | CO |
| |
MS Access (Course)
Learn how to create and manage databases easily and quickly. Starting from 29 €. |
| |
MySQL (Course)
Management of open-source database. Starting from 39 €. |
| |
SQL and Database (Course)
Creating and managing relational databases. Starting from 39 €. |