A table is the core component of any database. It stores data in rows and columns, where each column has a specific data type (like INT
, VARCHAR
, etc.) and each row is a record.
CREATE TABLE students (
id INT PRIMARY KEY,
name VARCHAR(50),
age INT,
grade VARCHAR(10)
);
id | name | age | grade |
---|---|---|---|
1 | Ravi | 20 | A |
2 | Neha | 21 | B |
Every column in a table must have a data type. Some commonly used types are:
INT
– for numbersVARCHAR(n)
– for strings of charactersDATE
– for dates⚠️ Note: A table must be created before you can insert or manipulate any data in it.
Can you create a table named employees with columns emp_id, emp_name, and salary?
(Write your SQL code on a text editor or in your DBMS tool)
Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!