์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- Project
- callback
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- eport
- async
- js
- json
- ํผํ
- Porject
- addEventListener
- ajax
- ๋น๋๊ธฐ
- database
- ์ฐธ๊ณ ๋ธ๋ก๊ทธ
- ๋๊ธฐ
- await
- JS #ํ๋ก์ ํธ
- ๊ฒ์
- prj
- slow and steady
- db
- mysql
- webpack
- setTimeout()
- promise
- execCommand
- sql
- object
- Import
- https://m.blog.naver.com/tt2t2am1118/221010125300
- Today
- Total
C-log
๐๏ธ๋์ SQL : UPDATE ๋ณธ๋ฌธ
์ฐ๋ฆฌ๊ฐ ์์ฑํด ๋์ database์ table์ ์์ ํ๊ธฐ ์ํด์ ์๋์ ๊ฐ์ ๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค. ์ฐ์ ์ฐ๋ฆฌ๊ฐ ๋ณ๊ฒฝํ ๋ฐ์ดํฐ๊ฐ ๋ฌด์์ธ์ง ์๋ ์ฝ๋๋ฅผ ํตํด ํ์ธํด๋ณด์.
MariaDB [opentutorials]> SELECT * FROM topic;
+----+------------+-------------------+---------------------+--------+---------------------------+
| id | title | description | created | author | profile |
+----+------------+-------------------+---------------------+--------+---------------------------+
| 1 | MySQL | MySQL is ... | 2023-09-10 15:36:30 | egoing | developer |
| 2 | ORACLE | ORACLE is ... | 2023-09-10 15:51:16 | egoing | developer |
| 3 | SQL Server | SQL Server is ... | 2023-09-10 15:57:25 | duru | data administrator |
| 4 | PostgreSQL | PostgreSQL is ... | 2023-09-10 15:58:31 | taeho | data scientist, developer |
| 5 | MongoDB | MongoDB is ... | 2023-09-10 15:59:20 | egoing | developer |
+----+------------+-------------------+---------------------+--------+---------------------------+
5 rows in set (0.055 sec)
์ฐ๋ฆฌ๊ฐ ์ ๋ฐ์ดํธ ํ ๋ถ๋ถ์ ORACLE์ด๋ผ๋ ๋ถ๋ถ์ title๊ณผ description์ ์์ ํด ๋ณผ ๊ฒ์ด๋ค. ๊ทธ๋ฌ๊ธฐ ์ํด์ ์๋ ์ฝ๋๋ฅผ ์์ฑํ๋ฉด ๋๋ค.
UPDATE topic SET description='Oracle is ...', title='Oracle' WHERE id = 2;
MariaDB [opentutorials]> UPDATE topic SET description='Oracle is ...', title='Oracle' WHERE id = 2;
Query OK, 1 row affected (0.002 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [opentutorials]> SELECT * FROM topic;
+----+------------+-------------------+---------------------+--------+---------------------------+
| id | title | description | created | author | profile |
+----+------------+-------------------+---------------------+--------+---------------------------+
| 1 | MySQL | MySQL is ... | 2023-09-10 15:36:30 | egoing | developer |
| 2 | Oracle | Oracle is ... | 2023-09-10 15:51:16 | egoing | developer |
| 3 | SQL Server | SQL Server is ... | 2023-09-10 15:57:25 | duru | data administrator |
| 4 | PostgreSQL | PostgreSQL is ... | 2023-09-10 15:58:31 | taeho | data scientist, developer |
| 5 | MongoDB | MongoDB is ... | 2023-09-10 15:59:20 | egoing | developer |
+----+------------+-------------------+---------------------+--------+---------------------------+
5 rows in set (0.000 sec)
UPDATE ๋ช ๋ น์ด๋ฅผ ์ดํด๋ณด๋ฉด TABLE์ด๋ฆ๊ณผ ๋ณ๊ฒฝํ ์ด์ ์ด๋ฆ๊ณผ ํด๋น ์์น์ id๋ฅผ ์ ๋ ฅํด์ฃผ๋ฉด ์คํค๋ง๊ฐ ๋ณ๊ฒฝ๋๋ ๊ฒ์ ์ ์ ์๋ค. ์ฌ๊ธฐ์ ์ฐ๋ฆฌ๊ฐ ๊น๋จน์ง ๋ง์์ผํ ๊ฒ์ ๊ผญ! ํด๋น ์์น WHERE ๋ช ๋ น์ด๋ฅผ ๋นผ๋จน์ผ๋ฉด ์๋๋ค. ํญ์ ์ ๋ ฅํ๊ธฐ ์ ์ฝ๋๋ฅผ ์ ์ ์๋์ง ํ์ธํด ๋ด์ผํ๋ค.
'DB > ๐ฌMySQL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๐๏ธ๋์ SQL : ๊ด๊ณํ ๋ฐ์ดํฐ์ ์์-ํ ์ด๋ธ ๋ถ๋ฆฌํ๊ธฐ (0) | 2023.09.12 |
---|---|
๐๏ธ๋์ SQL : DELETE (0) | 2023.09.11 |
๐๏ธ๋์ SQL : SELECT (0) | 2023.09.10 |
๐๏ธ๋์ SQL : ๋ณต์ต์ ํ์! (0) | 2023.09.10 |
๐๏ธ๋์ SQL : INSERT (0) | 2023.09.10 |