Posted on 7th September 2024|133 views
How to create a table if that doesn't exist in PostgreSQL?
Posted on 7th September 2024| views
CREATE DATABASE employee_details;
CREATE TABLE employee_data(
id INT not null,
name VARCHAR(20) unique not null,
dob DATETIME not null,
email VARCHAR(40) unique,
created_on TIMESTAMP not null,
last_login TIMESTAMP
Primary key(id)
);
Output:
Column_name | Column_type | Size |
(KEY) id | Int | Not null |
name | varchar | 20 |
dob | datetime | Not null |
varchar | 40 | |
created_on | Timestamp | Not null |
Last_login | Timestamp | Not null |