It is very easy to create a table in MySQL.  You need to use the Create table statement to create a table in MySQL. Please check below example There are three main elements in creating a table: 1. Table name: Name you want to give to your table. You can select any name. 2. column: Column name in your table. 3. datatype: Type of data you are going to store in that column. But we can add more elements to a table. let's do a live example with a brief explanation: Let's explain these above statements: Table name: students columns: roll_no, student_name, student_address datatype: int, varchar Not Null: NOT NULL is used to prevent a user to create a record with a NULL value. If a user will try to create a record with NULL value then MySQL will display an error message. AUTO_INCREMENT: Field Attribute AUTO_INCREMENT tells MySQL to go ahead and add the next available number to the id field. PRIMARY KEY: Keyword PRIMARY KEY is used to define a column as a primary key.
5 Comments  1