BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

DBMS: SQL Create Table

Last Updated: July 3, 2022 by Chaitanya Singh | Filed Under: DBMS

CREATE TABLE statement is used to create a table in database. This statement creates a table with the specified column and datatypes.

Syntax:

CREATE TABLE table_name (
    column1 datatype,
    column2 datatype,
    column3 datatype,
   ....
   columnN datatype
);

Example: The following SQL query creates a table STUDENT in the database with four attributes (columns): STU_ID to store student id, STU_NAME to store student name, AGE to store student’s age and ADDRESS to store student’s address. You can also specify the primary key while creating a table, this is optional.

CREATE TABLE STUDENT (    
   STU_ID INT NOT NULL,    
   STU_NAME VARCHAR (30) NOT NULL,    
   AGE INT NOT NULL,    
   ADDRESS VARCHAR2 (50),    
   PRIMARY KEY (STU_ID)    
);    

After inserting few rows in this newly created table, it will look like this:

STU_IDSTU_NAMEAGEADDRESS
1001Chaitanya35Noida
1002Ajeet34Delhi
1003Steve28Chennai
1004Ram40Agra
1005Rick36Patna
❮ SQL OperatorSQL DROP ❯

Top Related Articles:

  1. Instance and schema in DBMS
  2. Domain constraints in DBMS
  3. DBMS: Advantages of SQL
  4. Deadlock in DBMS
  5. DBMS: SQL Drop Table

About the Author

I have 15 years of experience in the IT industry, working with renowned multinational corporations. Additionally, I have dedicated over a decade to teaching, allowing me to refine my skills in delivering information in a simple and easily understandable manner.

– Chaitanya

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

DBMS Tutorial

Basics

  • DBMS Tutorial
  • DBMS Introduction
  • Database Applications
  • DBMS vs File System
  • DBMS vs RDBMS
  • DBMS Architecture
  • Three-level DBMS architecture
  • View in DBMS
  • Abstraction
  • Instance & Schema
  • DBMS languages

Data Models

  • Data Models
  • ER Diagram
  • ER Design issues
  • Convert ER to table
  • DBMS Generalization
  • DBMS Specialization
  • DBMS Aggregration
  • Relational Model
  • Hierarchical Model
  • Constraints
  • Cardinality

Relational Database

  • RDBMS concepts
  • Relational Algebra
  • Relational Calculus
  • Keys Index
  • Primary Key
  • Super Key
  • Candidate Key
  • Foreign Key
  • Composite Key
  • Alternate Key

Normalization

  • Normalization
  • Functional dependency

Transaction Management

  • Transaction Management
  • ACID properties
  • Transaction States
  • DBMS Schedules
  • Serializability
  • Conflict Serializability
  • View Serializability
  • Recoverability Of Schedule
  • Failure Classification
  • Log based Recovery
  • DBMS Checkpoint
  • Deadlock

Concurrency Control

  • Concurrency Control
  • Lock based protocol
  • Timestamp based protocol
  • Validation based protocol

File Organization

  • File Organization
  • Sequential File Organization
  • Heap File Organization
  • Hash File Organization
  • DBMS ISAM
  • B+ File Organization
  • Cluster File Organization

SQL Introduction

  • SQL Introduction
  • SQL Characteristics
  • Advantages of SQL
  • SQL Commands
  • SQL Operators
  • SQL CREATE
  • SQL DROP
  • SQL SELECT
  • SQL INSERT

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap