File size: 434 Bytes
131d1e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- 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]');