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

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

Comment

postgresql create table as select

CREATE TABLE films_recent AS
  SELECT * FROM films WHERE date_prod >= '2002-01-01';
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

PREVIOUS NEXT
Code Example
Sql :: sql order by with where 
Sql :: start and stop mysql 
Sql :: client does not support authentication protocol requested by server sqlyog 
Sql :: select mysql limit to 2 decimal places 
Sql :: change from not null postgresql 
Sql :: on update current_timestamp jpa 
Sql :: mysql remove database 
Sql :: how to change server name in sql server 
Sql :: sql roll up rows into columns 
Sql :: mysql where in maintain order group_concat 
Sql :: mysql:5.6 syntax create table 
Sql :: how to get max from each department in sql 
Sql :: connecting to postgresql on windows amd ubuntu 20.04 
Sql :: export mysql table to file 
Sql :: how to comment in sql 
Sql :: cast in sql 
Sql :: download sql server 2014 
Sql :: sql server select record with max id 
Sql :: sql left join with where clause 
Sql :: while in sql server 
Sql :: sqlalchemy case insensitive like 
Sql :: group by max date 
Sql :: carbon mysql d m y to y-m-d 
Sql :: mysql default -temp password 
Sql :: select year from dual oracle 
Sql :: logical operators in sql 
Sql :: tsql generate rows 
Sql :: mysql copy table rows from one database to another 
Sql :: macos oracle docker oracle11g 
Sql :: automatically update database last seen datetime in sql 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =