Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to set an already made tables auto increment in mysql

# To Set the value of auto increment in an already existing table use:
ALTER TABLE tables_name AUTO_INCREMENT=500; # Or whatever number you desire
Comment

create table mysql example auto_increment

Copied
CREATE TABLE animals (
     id MEDIUMINT NOT NULL AUTO_INCREMENT,
     name CHAR(30) NOT NULL,
     PRIMARY KEY (id)
);

INSERT INTO animals (name) VALUES
    ('dog'),('cat'),('penguin'),
    ('lax'),('whale'),('ostrich');

SELECT * FROM animals;
Comment

how to change the auto increment in existing table mysql

ALTER TABLE tbl_access ADD COLUMN `access_id` int(10) NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST
Comment

PREVIOUS NEXT
Code Example
Sql :: find table from column name in sql 
Sql :: rermove categories woocommerce sql 
Sql :: VERIFY INDEXES IN SQL ORACLE 
Sql :: select records for day before yesterday mysql 
Sql :: mysql command line connect 
Sql :: postgres get month name from date 
Sql :: how to group by month using sql server 
Sql :: oracle turn off constraint 
Sql :: t-sql remove all non-alphanumeric characters from a string 
Sql :: mysql import gz 
Sql :: update column name and datatype in sql 
Sql :: alter sequence postgres 
Sql :: postgresql reset auto increment 
Sql :: mysql take number in string 
Sql :: how to get all table names in sql query 
Sql :: ver usuarios mysql 
Sql :: search column name sql 
Sql :: add constraint fk 
Sql :: sql like variable 
Sql :: oracle failed login attempts 
Sql :: psql restore from tar 
Sql :: cross schema query oracle 2 users 
Sql :: add new column to the table mysql 
Sql :: setVal pgsql 
Sql :: set boolean flasksql 
Sql :: convert int to varchar sql 
Sql :: how to insert string variable into sqlite database 
Sql :: display total number of tables in mysql 
Sql :: oracle user quota on tablespace 
Sql :: start mysql server using docker 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =