- Data Manipulation Language.
- Data defination Language.
- Data Manipulation Language(DML):
Create table
Student
(SID NUMBER ,
NAME CHAR(20) NOT NULL,
ADDRESS VARCHAR(50),
CONSTRAINT MY1 PRIMARY
KEY (SID));
ALTER TABLE
STUDENT
DROP CONSTRAINT MY1;
ALTER TABLE
STUDENT
ADD CONSTRAINT MY1 PRIMARY KEY (SID);
ALTER TABLE
STUDENT
ADD CITY CHAR(10);
INSERT INTO STUDENT
(SID, NAME)
VALUES(2,
“ADEEL”);
CREATE TABLE
COURSE
(CC CHAR(6),
TITLE CHAR(20),
CREDITS NUMBER,
CONSTRAINT COURSEPK PRIMARY KEY (CC));
CREATE TABLE
REGISTER
(SID NUMBER,
COURSE CHAR(10),
DOR DATE,
CONSTRAINT REGFK1 FOREIGN KEY (SID)
REFERENCES STUDENT,
CONSTRAINT REGFK2 FOREIGN KEY (COURSE) REFERENCES COURSE);
2. Data defination Language:
SELECT * FROM TABLE_NAME WHERE ID=4;
INSERT INTO table_name
VALUES (value1, value2, value3,...)
VALUES (value1, value2, value3,...)
0 comments:
Post a Comment