Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
655 B
2
Indexable
Never
CREATE TABLE STD_ADD (
  ROLL_NO INT PRIMARY KEY,
  NAME VARCHAR(30),
  ADDRESS VARCHAR(30),
  PLACE VARCHAR(30),
  PIN INT
);

CREATE TABLE STD_MARKS (
  ROLL_NO INT FOREIGN KEY REFERENCES STD_ADD(ROLL_NO),
  SUBJECT VARCHAR(50),
  EXAM_DATE DATE,
  MARKS INT
);


INSERT INTO STD_ADD VALUES
(1,'RAM','KATHMANDU','BANESHWAR',1010),
(2,'SITA','KATHMANDU','BHIMSENGOLA',2010);

INSERT INTO STD_MARKS VALUES
(1,'MATH','2080-10-18',85),
(1,'SCIENCE','2080-10-17',90),
(2,'MATH','2080-10-18',90),
(2,'SCIENCE','2080-10-17',98);

-- Get data from STD_ADD
SELECT * FROM STD_ADD;

-- Get data from STD_MARKS
SELECT * FROM STD_MARKS;
Leave a Comment