본문 바로가기

SQL/Oracle SQL

Oracle SQL - 2 (테이블 생성 CRUD - C)

* 테이블의 행과 열 (row, column)

Row(행), Column(열) 읽는 법

** 테이블 생성 순서

1. topic 테이블 생성

CREATE TABLE topic(
id NUMBER NOT NULL,
title VARCHAR2(50) NOT NULL,
description VARCHAR2(4000),
created DATE NOT NULL
);


2. topic 테이블에 어떤 종류의 데이터를 삽입할지 표기

INSERT INTO topic
(id,title,description,created)
VALUES
(1, 'ORACLE', 'ORACLE is ...', SYSDATE);

INSERT INTO topic
(id,title,description,created)
VALUES
(2, 'MySQL', 'MySQL is ...', SYSDATE);

INSERT INTO topic
(id,title,description,created)
VALUES
(3, 'MsSQL', 'MsSQL is ...', SYSDATE);

INSERT INTO topic
(id,title,description,created)
VALUES
(4, 'PostgreSQL', 'PostgreSQL is ...', SYSDATE);

INSERT INTO topic
(id,title,description,created)
VALUES
(5, 'MongoDB', 'MongoDB is ...', SYSDATE);

 

INSERT INTO topic
(id,title,description,created)
VALUES
(6, 'MariaDB', ' MariaDB is ...', SYSDATE);

 

INSERT INTO topic
(id,title,description,created)
VALUES
(7, 'SQLite', ' SQLite is ...', SYSDATE);


후 commit;

 

*** 모든 작업이 끝난 뒤에는 commit을 입력하여 작업을 완료

 

 

엑셀로 생성할 테이블(topic) 정리