Junior — Middle
Can you provide an example of an SQL query executed in PostgreSQL?
sobes.tech AI
Answer from AI
Example of a simple SQL query in PostgreSQL to select all users from the users table:
SELECT id, name, email FROM users;
If you need to add a condition, for example, to select users older than 18:
SELECT id, name, email FROM users WHERE age > 18;
Also, an example of inserting a new record:
INSERT INTO users (name, email, age) VALUES ('Ivan Ivanov', 'ivan@example.com', 25);