SQL Tutorial



TABLES IN SQL


📑 Tables in SQL

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.

📘 Basic Syntax to Create Table


CREATE TABLE students (
  id INT PRIMARY KEY,
  name VARCHAR(50),
  age INT,
  grade VARCHAR(10)
);
    

📊 Visual Representation

id name age grade
1 Ravi 20 A
2 Neha 21 B

🧠 Column Data Types

Every column in a table must have a data type. Some commonly used types are:

  • INT – for numbers
  • VARCHAR(n) – for strings of characters
  • DATE – for dates

⚠️ Note: A table must be created before you can insert or manipulate any data in it.

🎯 Try It Yourself!

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)


🌟 Enjoyed Learning with Us?

Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!

Leave a Google Review