postgres / init.sql
bpandey23's picture
Create init.sql
131d1e4 verified
raw
history blame
434 Bytes
-- Create a new database
CREATE DATABASE mydb;
-- Connect to the new database
\c mydb;
-- Create a new table
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
email VARCHAR(50) UNIQUE NOT NULL
);
-- Insert some sample data
INSERT INTO users (name, email) VALUES
('John Doe', '[email protected]'),
('Jane Smith', '[email protected]'),
('Bob Johnson', '[email protected]');