From 5a8dbc6347b3541e84fe669b22c17ad3b715e258 Mon Sep 17 00:00:00 2001
From: Mitja Felicijan <mitja.felicijan@gmail.com>
Date: Wed, 21 Jan 2026 20:22:09 +0100
Subject: Engage!

---
 samples/test.sql | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 samples/test.sql

(limited to 'samples/test.sql')

diff --git a/samples/test.sql b/samples/test.sql
new file mode 100644
index 0000000..40311ef
--- /dev/null
+++ b/samples/test.sql
@@ -0,0 +1,45 @@
+-- Create a new table called 'users'
+CREATE TABLE users (
+    id SERIAL PRIMARY KEY,
+    username VARCHAR(50) NOT NULL UNIQUE,
+    email VARCHAR(100) NOT NULL UNIQUE,
+    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+    active BOOLEAN DEFAULT TRUE
+);
+
+-- Insert some sample data
+INSERT INTO users (username, email) VALUES
+    ('john_doe', 'john@example.com'),
+    ('jane_smith', 'jane@example.com'),
+    ('bob_jones', 'bob@test.com');
+
+-- Select data with a condition
+SELECT * FROM users
+WHERE active = TRUE AND created_at > '2023-01-01';
+
+-- Update a record
+UPDATE users
+SET active = FALSE
+WHERE username = 'bob_jones';
+
+-- Join with another table
+SELECT u.username, p.title
+FROM users u
+JOIN posts p ON u.id = p.user_id
+WHERE u.active = TRUE
+ORDER BY p.created_at DESC;
+
+-- Create an index
+CREATE INDEX idx_users_email ON users(email);
+
+-- Create a view
+CREATE OR REPLACE VIEW active_users AS
+SELECT id, username, email
+FROM users
+WHERE active = TRUE;
+
+-- Delete a record
+DELETE FROM users WHERE id = 100;
+
+-- Drop the table
+-- DROP TABLE users;
-- 
cgit v1.2.3

