본문 바로가기
생활코딩/Dadabase - MySQL

DATABASE2 MySQL - 13.DELETE

by 남산고라니 2021. 10. 13.
반응형
mysql> ################
mysql> ########################################################################################
mysql> #################   DATA DELETE  ##################################
mysql> #################################################################
mysql> SELECT * FROM topics;
ERROR 1146 (42S02): Table 'opentutorials.topics' doesn't exist
mysql> SELECT * FROM topic;
+----+------------+-------------------+---------------------+--------+---------------------------+
| id | title      | description       | created             | author | profile                   |
+----+------------+-------------------+---------------------+--------+---------------------------+
|  1 | MySQL      | MySQL is ...      | 2021-10-13 19:58:34 | egoing | developer                 |
|  2 | Oracale    | ORCALE is ...     | 2021-10-13 20:13:20 | egoing | developer                 |
|  3 | SQL Server | SQL Server is ... | 2021-10-13 20:13:28 | duru   | database administrator    |
|  4 | PostgreSQL | PostgreSQL is ... | 2021-10-13 20:13:35 | taeho  | data scientist, developer |
|  5 | MongoDB    | MongoDB is ...    | 2021-10-13 20:13:40 | egoing | developer                 |
+----+------------+-------------------+---------------------+--------+---------------------------+
5 rows in set (0.00 sec)

mysql> DELETE FROM topic WHERE id = 5;
Query OK, 1 row affected (0.01 sec)

mysql> SELECT * FROM topic;
+----+------------+-------------------+---------------------+--------+---------------------------+
| id | title      | description       | created             | author | profile                   |
+----+------------+-------------------+---------------------+--------+---------------------------+
|  1 | MySQL      | MySQL is ...      | 2021-10-13 19:58:34 | egoing | developer                 |
|  2 | Oracale    | ORCALE is ...     | 2021-10-13 20:13:20 | egoing | developer                 |
|  3 | SQL Server | SQL Server is ... | 2021-10-13 20:13:28 | duru   | database administrator    |
|  4 | PostgreSQL | PostgreSQL is ... | 2021-10-13 20:13:35 | taeho  | data scientist, developer |
+----+------------+-------------------+---------------------+--------+---------------------------+
4 rows in set (0.00 sec)

mysql>
반응형

'생활코딩 > Dadabase - MySQL' 카테고리의 다른 글

IFNULL - NULL 값 변환  (0) 2021.10.21
DATABASE2 MySQL - 11.SELECT - egoing  (0) 2021.10.13
MySQL 테이블의 생성 - egoing  (0) 2021.10.13
DATABASE2 MySQL - 11.SELECT - egoing  (0) 2021.10.13

댓글