0% found this document useful (0 votes)
12 views3 pages

Doll

The document shows SQL commands to create a database and table to store student data. Data is inserted into the table and queries are written to select all data and data where marks are greater than 70.

Uploaded by

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

Doll

The document shows SQL commands to create a database and table to store student data. Data is inserted into the table and queries are written to select all data and data where marks are greater than 70.

Uploaded by

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

QUES 1.

CREATE DATABASE School;

QUES 2.
CREATE TABLE Student (
student_id INT PRIMARY KEY,
class INT,
section VARCHAR(10),
gender VARCHAR(10),
name VARCHAR(50),
dob DATE,
marks INT
);

QUES 3.
INSERT INTO Student (student_id, class, section, gender, name, dob, marks)
VALUES
(5, 11, 'B', 'Male', 'Rahul', '2003-09-15', 78),
(6, 12, 'A', 'Female', 'Priya', '2004-07-22', 65),
(7, 10, 'C', 'Male', 'Amit', '2002-05-10', 70),
(8, 11, 'A', 'Female', 'Sara', '2003-12-18', 58),
(9, 12, 'B', 'Male', 'Ravi', '2002-08-30', 63),
(10, 10, 'A', 'Female', 'Tina', '2004-04-05', 90),
(11, 11, 'C', 'Male', 'Vikas', '2003-10-20', 82),
(12, 12, 'B', 'Female', 'Neha', '2002-11-08', 75),
(13, 10, 'A', 'Male', 'Aryan', '2004-06-14', 68),
(14, 11, 'B', 'Female', 'Pooja', '2003-02-28', 73);

QUES 4.
SELECT * FROM Student;

QUES 5.
SELECT student_id, name, marks
FROM Student
WHERE marks > 70;
CODE
CREATE TABLE Student (
student_id INT PRIMARY KEY,
class INT,
section VARCHAR(10),
gender VARCHAR(10),
name VARCHAR(50),
dob DATE,
marks INT
);
INSERT INTO Student (student_id, class, section, gender, name, dob, marks)
VALUES
(5, 11, 'B', 'Male', 'Rahul', '2003-09-15', 78),
(6, 12, 'A', 'Female', 'Priya', '2004-07-22', 65),
(7, 10, 'C', 'Male', 'Amit', '2002-05-10', 70),
(8, 11, 'A', 'Female', 'Sara', '2003-12-18', 58),
(9, 12, 'B', 'Male', 'Ravi', '2002-08-30', 63),
(10, 10, 'A', 'Female', 'Tina', '2004-04-05', 90),
(11, 11, 'C', 'Male', 'Vikas', '2003-10-20', 82),
(12, 12, 'B', 'Female', 'Neha', '2002-11-08', 75),
(13, 10, 'A', 'Male', 'Aryan', '2004-06-14', 68),
(14, 11, 'B', 'Female', 'Pooja', '2003-02-28', 73);
SELECT * FROM Student;
SELECT student_id, name, marks
FROM Student
WHERE marks > 70;

CODE ON COMPILER
OUTPUT

You might also like