Adding only one value to the table in sql

前端 未结 6 1087
别跟我提以往
别跟我提以往 2020-12-31 05:26

I have a table named student which consists of (rollno, name, sem, branch)

If I want to INSERT only one value (i.e only name h

6条回答
  •  别那么骄傲
    2020-12-31 05:55

    To insert values into specific columns, you first have to specify which columns you want to populate. The query would look like this:

    INSERT INTO your_table_name (your_column_name)
    VALUES (the_value);
    

    To insert values into more than one column, separate the column names with a comma and insert the values in the same order you added the column names:

    INSERT INTO your_table_name (your_column_name_01, your_column_name_02)
    VALUES (the_value_01, the_value_02);
    

    If you are unsure, have a look at W3Schools.com. They usually have explanations with examples.

提交回复
热议问题