MySQL Assignment 3
Hi,
The following questions are based on inserting values into a table.
- Create a table ‘products’ with the attributes as ‘product_id’ , ‘product_name’, ‘quantity’, ‘price’.
- Insert values such as ‘product_id’ , ‘product_name’, ‘quantity’, ‘price’ into the ‘products’ table.
- Write an SQL statement to insert null values under ‘price’ column if exists.
- Write an SQL statement to insert more than two rows in products table using separate statement
- Insert three products details in a ‘products’ table by using single statement.
- Insert the values into a ‘products’ table where the column of ‘product_id’ should not contain any null values.
- Write an SQL statement to insert values of ‘product_id’ which must be auto incremented.
- Insert a ‘default’ value under quantity column using default keyword.
- Display the table with all the above contents after inserting.
- Create another table as ‘products2’ and insert all the rows in ‘products’ table into ‘products2’ table.