Creating Tables in SQL

 Creating Tables in SQL


Tables are the basic building blocks of relational databases. We can create tables using the CREATE TABLE statement. Here's an example:

sql


CREATE TABLE employees (

    id INT PRIMARY KEY,

    name VARCHAR(50),

    age INT,

    department VARCHAR(50)

);

In this example, we're creating a table called "employees" with four columns: id, name, age, and department. The id column is designated as the primary key for the table.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...