Search
 
SCRIPT & CODE EXAMPLE
 

SQL

create table sql server auto increment primary key


/* mysql server */
CREATE TABLE persons (
    id int NOT NULL AUTO_INCREMENT,
    colour varchar(191) NOT NULL,
    created datetime, 
    modifed datetime
);

/* sql server IDENTITY*/
CREATE TABLE persons (
    id int IDENTITY(1,1) PRIMARY KEY,
    colour varchar(191) NOT NULL,
    created datetime, 
    modifed datetime
);

INSERT INTO persons (colour, created, modified)
VALUES ('red','2022-08-05', '2022-08-05'),
VALUES ('green','2022-08-05', '2022-08-05'),
VALUES ('blue','2022-08-05', '2022-08-05');
Comment

create table with primary key auto increment in sql

CREATE TABLE table_name (
    id INT NOT NULL IDENTITY(1, 1),
    name NVARCHAR (100) NULL,
    school NVARCHAR (100) NULL,
    PRIMARY KEY (ID)
);
Comment

sql create tabel with primary key auto_increment code

CREATE TABLE books (
  id              INT           NOT NULL    IDENTITY    PRIMARY KEY,
  title           VARCHAR(100)  NOT NULL,
  primary_author  VARCHAR(100),
);
Comment

PREVIOUS NEXT
Code Example
Sql :: postgresql in array 
Sql :: Upgrading postgresql data from 13 to 14 failed! 
Sql :: sql delete where in 
Sql :: add column table pl sql 
Sql :: mysql with 
Sql :: find mysql password 
Sql :: SQL LIMIT With OFFSET Clause 
Sql :: mssql server port 
Sql :: sql restore backup query 
Sql :: table structure in sql 
Sql :: convert dd/mm/yyyy to yyyy-mm-dd in sql server 
Sql :: group by clause with join in sql 
Sql :: select case when oracle 
Sql :: sql find leading space 
Sql :: raiserror with nowait 
Sql :: Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details. 
Sql :: homebrew install mysql 
Sql :: mysql fetch all data 
Sql :: identity syntax in sql 
Sql :: on update current_timestamp jpa 
Sql :: psql check if value in array 
Sql :: sql vs nosql or mysql vs mongodb 
Sql :: run psql postgres docker 
Sql :: sql server datetime 
Sql :: Oracle filter date column by year 
Sql :: sqlalchemy get ids 
Sql :: how to put is null in where in clause 
Sql :: sql count() 
Sql :: sql server delete records with specific date 
Sql :: postgresql having 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =