ਨਵੀਂ ਟੈਬ ਵਿੱਚ ਲਿੰਕ ਖੋਲੋ
    • ਕਾਰਜ ਰਿਪੋਰਟ
    • ਈਮੇਲ
    • ਮੁੜ ਜਨਰੇਟ ਕਰੋ
    • ਭਾਸ਼ਣ
    • ਸਿਰਲੇਖ ਜਨਰੇਟਰ
    • ਸਮਾਰਟ ਜਵਾਬ
    • ਕਵਿਤਾ
    • ਲੇਖ
    • ਮਜਾਕ
    • Instagram ਪੋਸਟ
    • X ਪੋਸਟ
    • Facebook ਪੋਸਟ
    • ਕਹਾਣੀ
    • ਪਛਾਣ ਪੱਤਰ
    • ਰਿਜ਼ਿਊਮ
    • ਨੌਕਰੀ ਦਾ ਵਰਣਨ
    • ਸਿਫ਼ਾਰਿਸ਼ ਪੱਤਰ
    • ਅਸਤੀਫ਼ਾ ਪੱਤਰ
    • ਸੱਦਾ ਪੱਤਰ
    • Greeting Message
    • ਹੋਰ ਟੈਮਪਲੇਟਾਂ ਨੂੰ ਅਜ਼ਮਾਓ
  1. Creating a table in SQL involves defining the table's structure, including column names, data types, and constraints. The CREATE TABLE statement is used for this purpose.

    Example

    CREATE TABLE Persons (
    PersonID int,
    LastName varchar(255),
    FirstName varchar(255),
    Address varchar(255),
    City varchar(255)
    );
    ਪ੍ਰਤੀਲਿਪੀ ਬਣਾਈ ਗਈ!

    In this example, a table named Persons is created with five columns: PersonID, LastName, FirstName, Address, and City.

    Syntax

    CREATE TABLE table_name (
    column1 datatype,
    column2 datatype,
    column3 datatype,

    );
    ਪ੍ਰਤੀਲਿਪੀ ਬਣਾਈ ਗਈ!

    Creating a Table with Constraints

    You can also add constraints like PRIMARY KEY, NOT NULL, and CHECK while creating a table.

    Example

    CREATE TABLE Customer (
    CustomerID INT PRIMARY KEY,
    CustomerName VARCHAR(50),
    LastName VARCHAR(50),
    Country VARCHAR(50),
    Age INT CHECK (Age >= 0 AND Age <= 99),
    Phone INT
    );
    ਪ੍ਰਤੀਲਿਪੀ ਬਣਾਈ ਗਈ!

    In this example, the CustomerID column is set as the primary key, and the Age column has a check constraint to ensure values between 0 and 99.

    Creating a Table from Another Table

    ਪਸੰਦ ਕਰੋ
    ਨਾਪਸੰਦ ਕਰੋ
    ਤੁਹਾਡਾ ਧੰਨਵਾਦ!ਤੁਹਾਡੀ ਆਵਾਜ਼ ਮਹੱਤਵ ਰੱਖਦੀ ਹੈ ਅਤੇ Bing ਨੂੰ ਸੁਧਾਰਨ ਵਿੱਚ ਮਦਦ ਕਰਦੀ ਹੈ।
  2. SQL CREATE TABLE - GeeksforGeeks

    11 ਨਵੰ 2025 · Let’s walk through a practical example where we create a Customer table that stores customer data. We will define various columns such as CustomerID, CustomerName, Country, Age, …

  3. SQL CREATE TABLE Statement

    Learn how to use the CREATE TABLE statement to create a new table in the database with columns, data types, and constraints. See examples, syntax, and quiz to test your k…

    • In relational databases, a table is a structured set of data organized into rows and columns: 1. Rows represent records. 2. Columns represent attributes of data. To create a new table, you use the CREATE …
    sqltutorial.org ਉੱਤੇ ਹੋਰ ਦੇਖੋ
  4. How to Create a Table in SQL? Your Step-by-Step Guide for Beginners

    24 ਸਤੰ 2023 · I'm here to guide you through the process of creating a table in SQL. If you're new to the world of databases, don't worry! I'll break down this complex topic

  5. SQL CREATE TABLE (With Examples) - Programiz

    Learn how to use the SQL CREATE TABLE statement to create tables with different columns, data types, constraints and primary keys. See examples of creating …

  6. Create tables (Database Engine) - SQL Server | Microsoft Learn

    18 ਨਵੰ 2025 · Create a new table, name it, and add it to an existing database using the Database Engine.

  7. ਲੋਕ ਇਹ ਵੀ ਪੁੱਛਦੇ ਹਨ
  8. SQL Create Table Statement - Tutorial Gateway

    Unlike others, SQL Server does not have a CREATE TABLE AS SELECT command to duplicate an entire table or part of an existing table. However, it provides a …

  9. Create table – SQL Tutorial

    Learn how to use SQL CREATE TABLE statement to create a new table in a database. See the basic syntax, a simple example, and the data types for each column.

  10. SQL CREATE TABLE Statement - Tutorial Republic

    Learn how to create a table inside a database using SQL with syntax, examples and data types. Find out how to use constraints, auto-increment and unique attributes in MySQL and SQL Server.

  11. Create Table SQL: Syntax, Examples and Tips - The …

    11 ਅਗ 2025 · In this blog, we’ll explore the CREATE TABLE SQL command, what it is, when to use it, and how it works. You’ll learn to define columns, add keys, …