desc 테이블이름;
ex)
desc topic;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | int | NO | PRI | NULL | auto_increment |
| title | varchar(100) | NO | | NULL | |
| description | text | YES | | NULL | |
| created | datetime | NO | | NULL | |
| author | varchar(15) | YES | | NULL | |
| profile | varchar(200) | YES | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
insert into 테이블이름 (속성) values (넣을속성);
<aside> 💡 순서 중요하다!
</aside>
ex)
insert into topic (title,description,created,author,profile) values('MySQL', 'MySQL is ...',NOW(),'ryeo','developer');
결과 보기
select * from topic;
+----+-------+--------------+---------------------+--------+-----------+
| id | title | description | created | author | profile |
+----+-------+--------------+---------------------+--------+-----------+
| 1 | MySQL | MySQL is ... | 2022-04-07 19:32:02 | ryeo | developer |
+----+-------+--------------+---------------------+--------+-----------+
select title, description, author from topic;
+------------+-------------------+--------+
| title | description | author |
+------------+-------------------+--------+
| MySQL | MySQL is ... | ryeo |
| ORACLE | ORACLE is ... | ryeo |
| SQL Server | SQL Server is ... | hwan |
| PostgreSQL | PostgreSQL is ... | strong |
| MongoDB | MongoDB is ... | ryeo |
+------------+-------------------+--------+