Mode:
Duration:
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
35
36
CREATE TABLE customers (
customer_id SERIAL PRIMARY KEY,
customer_name VARCHAR(100),
email VARCHAR(100)
);
CREATE TABLE bank_accounts (
account_id SERIAL PRIMARY KEY,
customer_id INTEGER REFERENCES customers(customer_id),
balance DECIMAL(12,2)
);
INSERT INTO customers (customer_name, email) VALUES
('John Doe', 'john@example.com'),
('Emma Wilson', 'emma@example.com');
INSERT INTO bank_accounts (
customer_id,
balance
) VALUES
(1, 10000),
(2, 7500);
SELECT
c.customer_name,
b.account_id,
b.balance
FROM customers c
JOIN bank_accounts b
ON c.customer_id = b.customer_id;
SELECT
AVG(balance) AS average_balance,
MAX(balance) AS highest_balance,
MIN(balance) AS lowest_balance
FROM bank_accounts;Coding works best on desktop or with an external keyboard.