쌓고 쌓다

오라클 중심의 SQL 배움터 11장 연습문제 풀이 본문

프로그래밍/SQL

오라클 중심의 SQL 배움터 11장 연습문제 풀이

승민아 2022. 12. 6. 21:35

1.

CREATE TABLE member(
USERID VARCHAR2(10),
USERNAME VARCHAR2(10),
PASSWD VARCHAR2(10),
IDNUM VARCHAR2(13),
PHONE NUMBER(13),
ADDResS VARCHAR2(20),
REGDATE DATE,
INTEREST VARCHAR2(15)
);

 

2. 

ALTER TABLE member
MODIFY phone VARCHAR2(13);
INSERT INTO member
VALUES ('sunshinLee', '이순신', 'ssl000', '8701011120200', '02)333-2123', '서울',
        SYSDATE, '컴퓨터');

 

3. 

CREATE TABLE member_second
AS SELECT * FROM student;

 

4.

CREATE TABLE member_third
AS SELECT userid, username, passwd FROM student; -- 칼럼이 존재하지 않음.

 

5.

CREATE TABLE member_forth
AS SELECT * FROM student
WHERE 1=2;

 

6.

ALTER TABLE member
ADD email VARCHAR2(50);

 

7. 

ALTER TABLE member
ADD country VARCHAR2(15) DEFAULT 'Korea';

 

8.

ALTER TABLE member
DROP COLUMN email;

 

9.

ALTER TABLE member
MODIFY address VARCHAR2(30);

 

10.

RENAME member_second TO potential_member;

 

Comments