-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql-schema.txt
More file actions
34 lines (30 loc) · 1.65 KB
/
sql-schema.txt
File metadata and controls
34 lines (30 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- Create a schema for the application
CREATE SCHEMA doctorgpt;
-- Create a table to store user data
CREATE TABLE doctorgpt.users (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
height INT,
weight DECIMAL(5, 2),
birthdate DATE
);
-- Create a table to store chat messages
CREATE TABLE doctorgpt.chat_messages (
id SERIAL PRIMARY KEY,
user_id INT REFERENCES doctorgpt.users(id) ON DELETE CASCADE,
sender VARCHAR(255) NOT NULL,
message TEXT NOT NULL,
timestamp TIMESTAMP DEFAULT NOW()
);
-- Create a chatbot user
INSERT INTO doctorgpt.users (name, email, password, birthdate) VALUES ('test', 'test@t.be', 't', '1990-08-20');
INSERT INTO doctorgpt.users (name, email, password, birthdate) VALUES ('Zieke', 'zieke@test.be', 'griep', '2000-02-08');
-- Create chat messages
INSERT INTO doctorgpt.chat_messages ( user_id, sender, message) VALUES ('2', 'bot', 'Hello! How can I help you today?');
INSERT INTO doctorgpt.chat_messages ( user_id, sender, message) VALUES ('2', 'user', 'I have a question about my account.');
INSERT INTO doctorgpt.chat_messages ( user_id, sender, message) VALUES ('2', 'bot', 'Sure, I will do my best to assist you.');
INSERT INTO doctorgpt.chat_messages ( user_id, sender, message) VALUES ('2', 'user', 'How do I change my account password?');
INSERT INTO doctorgpt.chat_messages ( user_id, sender, message) VALUES ('2', 'bot', 'To change your password, you can go to your account settings and follow the "Change Password" option.');
INSERT INTO doctorgpt.chat_messages ( user_id, sender, message) VALUES ('2', 'user', 'Thank you for your help!');