Addition of information in the new column field in the database table



  • Database mysql I created a table:

    CREATE TABLE users (
    user_id int AUTO_INCREMENT NOT NULL PRIMARY KEY,
    first_name varchar(20),
    last_name varchar(30),
    email varchar(50)
    );
    

    Then decided to update the table by adding a new column:

    ALTER TABLE users
    ADD telephone varchar(15);
    

    Before a new column was added telephoneseveral users were added. Question of which team adds information in the empty pole line telephonefor already available users?



  • You need to update the data, team. Update

    UPDATE table_name
    SET column1 = value1, column2 = value2, ...
    WHERE condition;
    

    For example

    UPDATE users
    SET telephone = '000000'
    WHERE user_id = '0';
    

    Updates the sezer footage. id = 0Makes the column telephone Number 000000


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2