0% found this document useful (0 votes)
24 views1 page

Back Up Table

The document contains SQL commands to create a BIKE_DETAILS table, copy data to a new B_DETAILS table, add and update columns, and rename columns.

Uploaded by

s. velan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Back Up Table

The document contains SQL commands to create a BIKE_DETAILS table, copy data to a new B_DETAILS table, add and update columns, and rename columns.

Uploaded by

s. velan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--TASK2

CREATE TABLE BIKE_DETAILS(B_ID NUMBER,B_NAME VARCHAR2(25),B_SALES NUMBER,B_BRAND


VARCHAR2(25),B_TYPE VARCHAR2(20),B_AMT NUMBER);
DESC BIKE_DETAILS;
SELECT * FROM BIKE_DETAILS;
CREATE TABLE B_DETAILS AS SELECT * FROM BIKE_DETAILS;
SELECT * FROM B_DETAILS;
ALTER TABLE B_DETAILS ADD CC VARCHAR2(10);
UPDATE B_DETAILS SET CC='&CC' WHERE B_ID=&B_ID;
UPDATE B_DETAILS SET CC='&CC' WHERE B_ID IS NULL;
DROP TABLE BIKE_DETAILS;
RENAME B_DETAILS TO BIKE_DETAILS;
--TASK3
ALTER TABLE BIKE_DETAILS ADD BNAME VARCHAR2(30);
UPDATE BIKE_DETAILS SET BNAME=B_NAME;
ALTER TABLE BIKE_DETAILS DROP COLUMN B_NAME;
ALTER TABLE BIKE_DETAILS RENAME COLUMN BNAME TO B_NAME;

You might also like