Example HTML page

MySQL Assignment 3

Hi,

The following questions are based on inserting values into a table.

  1. Create a table ‘products’ with the attributes as ‘product_id’ , ‘product_name’, ‘quantity’, ‘price’.
  2. Insert values such as ‘product_id’ , ‘product_name’, ‘quantity’, ‘price’ into the ‘products’ table.
  3. Write an SQL statement to insert null values under ‘price’ column if exists.
  4. Write an SQL statement to insert more than two rows in products table using separate statement
  5. Insert three products details in a ‘products’ table by using single statement.
  6. Insert the values into a ‘products’ table where the column of ‘product_id’ should not contain any null values.
  7. Write an SQL statement to insert values of ‘product_id’ which must be auto incremented.
  8. Insert a ‘default’ value under quantity column using default keyword.
  9. Display the table with all the above contents after inserting.
  10. Create another table as ‘products2’ and insert all the rows in ‘products’ table into ‘products2’ table.

 

 

Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest