Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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 
);
Comment

create table postgresql

CREATE TABLE table_name (
	column_name TYPE column_constraint,
	table_constraint table_constraint
) INHERITS existing_table_name;
Comment

Create postgres table

CREATE TABLE holiday_calender (
	hcl_id bigserial NOT NULL,
	hcl_country integer,
	hcl_company integer,
	hcl_date timestamp NULL,
	hcl_description varchar(500) NULL,	
	hcl_active int4 NOT NULL,
	CONSTRAINT holiday_calender_pkey PRIMARY KEY (hcl_id)
);
Comment

show create table in postgresql

pg_dump -t 'schema-name.table-name' --schema-only database-name
Comment

PREVIOUS NEXT
Code Example
Sql :: sql day from datetime 
Sql :: oracle tablespace autoextend 
Sql :: mysqldump cli command 
Sql :: sql delete table 
Sql :: mysql date comparison with formatting 
Sql :: apex for oracle 11g 
Sql :: update select sql 
Sql :: how to print some string in mysql 
Sql :: function in sql 
Sql :: how to left join a sub query in postgresql 
Sql :: drop constraint in ms sql 
Sql :: while mysql 
Sql :: update a column with another column in same table mysql 
Sql :: aggregate functions 
Sql :: python list from sql 
Sql :: sqlite3.OperationalError: near "7": syntax error 
Sql :: SELECT SQL LIKE 
Sql :: mod in sql 
Sql :: sql server in python 
Sql :: sql to linq converter 
Sql :: casterar postgres 
Sql :: sql examples from framework 
Sql :: nosqlbooster query other collection 
Sql :: allow all local clients (local socket connections) to connect to the kodekloud_db1 
Sql :: hashpass 
Sql :: Windows internal database connection 
Sql :: delete recurring email keep smallest id number 
Sql :: postgresql insert string 
Sql :: oracle params value 
Sql :: Having trouble running COUNT in my INSERT INTO statement 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =