0% found this document useful (0 votes)
38 views

SQL 1

The document provides instructions for performing various operations on a student database table including: 1) Creating the student table; 2) Inserting records into the table; 3) Selecting, displaying, and ordering records; 4) Updating record fields; and 5) Deleting records that meet certain criteria.

Uploaded by

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

SQL 1

The document provides instructions for performing various operations on a student database table including: 1) Creating the student table; 2) Inserting records into the table; 3) Selecting, displaying, and ordering records; 4) Updating record fields; and 5) Deleting records that meet certain criteria.

Uploaded by

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

Lab Assignment1

1. Create table Student (Rno, Name, DOB, Gender, Class,


College,
City, Marks)
CREATE TABLE stud(roll_no NUMBER(10), name CHAR(20), DOB
DATE, gender CHAR(6), class CHAR(10),
college CHAR(50), city CHAR(10), marks INT);
2. Insert 5 records in student table
INSERT INTO stud VALUES(5,
'Vanshika', TO_DATE('11-08-2016', 'dd-mm-yyyy'),
'female' , 'II', 'Thapar University', 'Delhi', 95);
INSERT INTO stud VALUES(6,
'Vishwas', TO_DATE('11-08-2016', 'dd-mm-yyyy'),
'male' , 'III', 'Thapar University', 'Rajasthan', 100);
3. Display the information of all the students
SELECT * FROM stud;
4. Display the detail structure of student table
DESCRIBE stud;
5. Display Rno, Name and Class information of Patiala
students.
SELECT roll_no , name, class
FROM stud
WHERE city = 'Patiala';
6. Display information on ascending order of marks
SELECT *
FROM stud
ORDER BY marks;
7. Change the marks of Rno 5 to 89.
UPDATE stud
SET marks=89
WHERE roll_no=5;
8. Change the name and city of Rno 9.
UPDATE stud
SET name='Susst' , city='Malerkotla'
WHERE roll_no =9;
9. Delete the information of Amritsar city records
DELETE
FROM stud
WHERE city='Punjab';
10. Delete the records of student where marks<30.
DELETE
FROM stud
WHERE marks<30;

You might also like