Database Management System and SQL
Database Management System and SQL
  • Database Management System and SQL
  • Database
    • Introduction to Database
      • Definition
      • File System
      • Different types of Database
      • Uses of DBMS
      • Basic Terms in Database
      • Query Language
    • View of Data
      • Data Abstraction
      • Schema & Instance
      • Data Models
    • Database Architecture
      • DBMS Tier Architecture
      • Three Schema Architecture
      • Data Independence
    • Relational Database Management System (RDBMS)
      • Entity-Relationship (ER) Model
      • Attributes
      • Keys
      • Relationship
    • Functional Dependencies
    • Normalization
  • MySQL
    • Terminology
    • Database Statements
    • Table
      • Data Type
      • Create
      • Show
      • Describe
      • Drop
      • Alter
      • Auto Increment
      • Index
    • Insert
    • Select
      • Condition
      • Aggregate Functions
      • Join
    • View
    • Delete
    • Update
    • MySQL Constraints
      • NOT NULL
      • DEFAULT
      • CHECK
      • UNIQUE
      • PRIMARY KEY
      • FOREIGN KEY
Powered by GitBook
On this page
  • Auto Increment
  • Setting AUTO_INCREMENT starting value

Was this helpful?

  1. MySQL
  2. Table

Auto Increment

Auto Increment

CREATE TABLE IF NOT EXISTS `student` (
    `id` INT AUTO_INCREMENT,
    `name` CHAR(50),
    `email` VARCHAR(50)
);
  • By default, the starting value for AUTO_INCREMENT is 1, and it will increment by 1 for each new record.

Setting AUTO_INCREMENT starting value

ALTER TABLE `student` AUTO_INCREMENT=100;
PreviousAlterNextIndex

Last updated 8 months ago

Was this helpful?