Day 3 :
Learn to Create Database
and Table in SQL
"30 Days, 30 Lessons: Unlock
the Power of SQL!"
Here is the SQL code to create a company database and an employee
table with five relevant columns in PostgreSQL:
1. Create the Database:
CREATE DATABASE company;
2. Create the Employee Table:
CREATE TABLE employee (
employee_id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
position VARCHAR(50),
department VARCHAR(50),
hire_date DATE,
salary NUMERIC(10, 2)
);