Answers for "how to generate the create table sql statement for an existing table in postgresql"

SQL
12

create table in postgresql

-- Example table
 CREATE TABLE accounts (
	user_id serial PRIMARY KEY,
	username VARCHAR ( 50 ) UNIQUE NOT NULL,
	password VARCHAR ( 50 ) NOT NULL,
	email VARCHAR ( 255 ) UNIQUE NOT NULL,
	created_on TIMESTAMP NOT NULL,
        last_login TIMESTAMP 
);
Posted by: Guest on December-12-2020
2

postgre sql create table

CREATE TABLE cities (
    city_id serial PRIMARY KEY,
    city_name VARCHAR (255) NOT NULL,
    population INT NOT NULL CHECK (population >= 0)
);
Posted by: Guest on June-16-2021

Code answers related to "how to generate the create table sql statement for an existing table in postgresql"

Code answers related to "SQL"

Browse Popular Code Answers by Language