SQL Tutorial : DDL - Create
Let's learn about next topic: Create
Create:
- used to create the table and define the columns and type of the data
- CREATE TABLE DEPS
( DID NUMBER(4),DNAME VARCHAR2(30),
DNAME2 CHAR(30),
VREMARKS VARCHAR(30))
- CREATE TABLE DEPT1
(DID NUMBER(3) DEFAULT 10,
DNAME VARCHAR2(20) DEFAULT 'TRAINING')
- INSERT INTO DEPT1
VALUES(20,DEFAULT);
- INSERT INTO DEPT1
VALUES(30,'SALES');
- UPDATE DEPT1
SET DNAME=DEFAULT
WHERE DID=30
- INSERT INTO DEPT1 VALUES(&A,'&DEPT_NAME')
- WHERE &A AND '&DEPT_NAME' ARE SUBSTITUTION VARIABLES
WHICH IS USED FOR PROMPTING THE USER FOR VALUES
- CREATE TABLE COURSE
(CID NUMBER(3),
CNAME VARCHAR2(20))
- CREATE TABLE STUDENTS
(SID NUMBER(3),
SNAME VARCHAR2(20))
No comments:
Post a Comment