Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8aa4334

Browse files
authored
Update Beginner-Guide-to-SQL.md
1 parent f415fe8 commit 8aa4334

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎basics/Beginner-Guide-to-SQL.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ The most fundamental operations in SQL are known as CRUD, which stands for **Cre
1414

1515
The `SELECT` statement is used to select data from a database. The data returned is stored in a result table.
1616

17+
```sql
18+
-- Select all columns from a table
19+
SELECT * FROM table_name;
20+
21+
-- Select specific columns from a table
22+
SELECT column1, column2 FROM table_name;
23+
24+
-- Select with a condition
25+
SELECT * FROM table_name WHERE condition;
26+
```
27+
For example:
1728
```sql
1829
-- Select all columns from a table named 'employees'
1930
SELECT * FROM employees;
@@ -29,6 +40,19 @@ SELECT * FROM employees WHERE department = 'Sales';
2940
## INSERT
3041
The `INSERT INTO` statement is used to insert new records into a table.
3142

43+
```sql
44+
-- Insert into specific columns
45+
INSERT INTO table_name (column1, column2) VALUES (value1, value2);
46+
47+
-- Insert into all columns
48+
INSERT INTO table_name VALUES (value1, value2, value3, ...);
49+
50+
-- Insert multiple rows
51+
INSERT INTO table_name (column1, column2)
52+
VALUES (value1, value2), (value3, value4), (value5, value6);
53+
```
54+
For example:
55+
3256
```sql
3357
-- Insert specific data into columns of a table named 'customers'
3458
INSERT INTO customers (customer_name, email) VALUES ('John Doe', 'john@example.com');

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /