iTranslated by AI
Learning SQL without Environment Setup using SQL Fiddle
Background and Purpose
In this article, I will introduce a method for learning SQL that does not require setting up a local environment, allowing you to start immediately for study purposes.
Many people want to learn SQL but are discouraged by the initial hurdle of "How do I set up a database?" While SQL itself is not particularly difficult, this barrier often prevents people from starting. This method is a must-see for those in that situation.
Tools Used
The tool we will use is SQL Fiddle, which is easily accessible via the web. When you access it, the following screen will appear.

In the left window, you can paste the DDL (Data Definition Language) statements to create tables and insert data, then click the "Build Schema" button to create the tables. Afterward, you can enter SELECT statements in the right window to practice extracting data and learn various SQL commands practically.
You can choose from various SQL dialects such as PostgreSQL, Oracle, SQLite, and MySQL, which also allows you to learn SQL using dialect-specific functions.

Tutorial
Access SQL Fiddle
Open SQL Fiddle by accessing the link below:
Paste the DDL statements
Once SQL Fiddle is open, paste the DDL statements into the left window and click the "Build Schema" button. For this tutorial, I have prepared the following DDL.

DDL statements provided by the author
Below, we create two tables, users and userdetails, and insert test data.
CREATE TABLE users(
id INT,
name VARCHAR(10),
age INT
);
INSERT INTO users VALUES (1,'Taro1',11);
INSERT INTO users VALUES (2,'Taro2',12);
INSERT INTO users VALUES (3,'Taro3',13);
INSERT INTO users VALUES (4,'Taro4',14);
INSERT INTO users VALUES (5,'Taro5',15);
INSERT INTO users VALUES (6,'Taro6',16);
INSERT INTO users VALUES (7,'Taro7',17);
INSERT INTO users VALUES (8,'Taro8',18);
INSERT INTO users VALUES (9,'Taro9',19);
INSERT INTO users VALUES (10,'Taro10',20);
CREATE TABLE userdetails (
id INT,
occupation VARCHAR(1000),
address VARCHAR(1000),
zip_code VARCHAR(7)
);
INSERT INTO userdetails VALUES (1,'Employee11','1-1-1 Sumida, Tokyo','222-001');
INSERT INTO userdetails VALUES (2,'Employee12','1-1-2 Sumida, Tokyo','222-002');
INSERT INTO userdetails VALUES (3,'Employee13','1-1-3 Sumida, Tokyo','222-003');
INSERT INTO userdetails VALUES (4,'Employee14','1-1-4 Sumida, Tokyo','222-004');
INSERT INTO userdetails VALUES (5,'Employee15','1-1-5 Sumida, Tokyo','222-005');
INSERT INTO userdetails VALUES (6,'Employee16','1-1-6 Sumida, Tokyo','222-006');
INSERT INTO userdetails VALUES (7,'Employee17','1-1-7 Sumida, Tokyo','222-007');
INSERT INTO userdetails VALUES (8,'Employee18','1-1-8 Sumida, Tokyo','222-008');
INSERT INTO userdetails VALUES (9,'Employee19','1-1-9 Sumida, Tokyo','222-009');
INSERT INTO userdetails VALUES (10,'Employee20','1-1-10 Sumida, Tokyo','222-010');
INSERT INTO userdetails VALUES (11,'Employee21','1-1-11 Sumida, Tokyo','222-011');
INSERT INTO userdetails VALUES (12,'Employee22','1-1-12 Sumida, Tokyo','222-012');
INSERT INTO userdetails VALUES (13,'Employee23','1-1-13 Sumida, Tokyo','222-013');
INSERT INTO userdetails VALUES (14,'Employee24','1-1-14 Sumida, Tokyo','222-014');
INSERT INTO userdetails VALUES (15,'Employee25','1-1-15 Sumida, Tokyo','222-015');
INSERT INTO userdetails VALUES (16,'Employee26','1-1-16 Sumida, Tokyo','222-016');
INSERT INTO userdetails VALUES (17,'Employee27','1-1-17 Sumida, Tokyo','222-017');
INSERT INTO userdetails VALUES (18,'Employee28','1-1-18 Sumida, Tokyo','222-018');
INSERT INTO userdetails VALUES (19,'Employee29','1-1-19 Sumida, Tokyo','222-019');
INSERT INTO userdetails VALUES (20,'Employee30','1-1-20 Sumida, Tokyo','222-020');
DDL paste location

Enter SELECT statements into the right window
Once you click the "Build Schema" button, the right window becomes editable, allowing you to run SELECT, UPDATE, or DELETE SQL statements.
For this tutorial, I have prepared the following SQL.
Sample 1: Select from the users table
select * from users;
Paste the SQL above and click the "Run SQL" button.

Practice SQL
So far, I have explained how to use SQL Fiddle.
I have prepared several SELECT SQL statements for the DDL used here. I recommend using these as a reference to practice various SQL statements while consulting a textbook; this will help you improve quickly.
Sample 1: Select from the users table
select * from users;
Sample 2: Select from the userdetails table
select * from userdetails;
Sample 3: Join the users table and userdetails table
select
u.id,
u.name,
u.age,
ud.occupation,
ud.address,
ud.zip_code
from users as u
left join userdetails as ud on u.id=ud.id;
Sample 4: Extract people who are 15 years old
select * from users
where age = 15;
Sample 5: Get the address of users who are 20 years old
select
u.id,
u.name,
u.age,
ud.occupation,
ud.address,
ud.zip_code
from users as u
left join userdetails as ud on u.id=ud.id
where age = 20;
Conclusion
In this article, I introduced a way to get started with learning SQL. As you get used to it and gain more knowledge, it would be a good idea to build your own SQL Server or MySQL environment for further study.
I hope this serves as a helpful starting point.
Discussion