In MySQL, tables are where your data is actually stored. A table is a collection of rows and columns, similar to a spreadsheet. Each row is a record, and each column is a field or attribute.
students
ID | Name | Age | Course |
---|---|---|---|
1 | Amit | 20 | BCA |
2 | Sara | 22 | MBA |
You can create a table in MySQL using the CREATE TABLE
command:
CREATE TABLE students ( id INT AUTO_INCREMENT, name VARCHAR(50), age INT, course VARCHAR(50), PRIMARY KEY (id) );
id INT AUTO_INCREMENT
→ Creates an auto-incrementing ID columnname VARCHAR(50)
→ Stores names up to 50 charactersPRIMARY KEY (id)
→ Makes id
a unique identifier for each rowemail
, dob
, etc.INT
, VARCHAR
, DATE
, etc.Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!