What are the different commands used in Redis?

1. SET: This command is used to set a key value pair in the Redis database.

Example: SET mykey “Hello world”

2. GET: This command is used to get the value of a key from the Redis database.

Example: GET mykey

3. DEL: This command is used to delete a key from the Redis database.

Example: DEL mykey

4. EXISTS: This command is used to check if a key exists in the Redis database.

Example: EXISTS mykey

5. EXPIRE: This command is used to set a timeout for a key in the Redis database.

Example: EXPIRE mykey 60

6. KEYS: This command is used to get all the keys in the Redis database.

Example: KEYS *

What are some common PostgreSQL commands?

1. CREATE DATABASE: Creates a new database.
Example: CREATE DATABASE my_database;

2. DROP DATABASE: Removes a database.
Example: DROP DATABASE my_database;

3. CREATE TABLE: Creates a new table.
Example: CREATE TABLE my_table (id INT, name VARCHAR(255));

4. ALTER TABLE: Modifies an existing table.
Example: ALTER TABLE my_table ADD COLUMN age INT;

5. SELECT: Retrieves data from a table.
Example: SELECT * FROM my_table;

6. INSERT: Adds data to a table.
Example: INSERT INTO my_table (id, name) VALUES (1, ‘John’);

7. UPDATE: Modifies existing data in a table.
Example: UPDATE my_table SET name = ‘Jane’ WHERE id = 1;

8. DELETE: Removes data from a table.
Example: DELETE FROM my_table WHERE id = 1;