Professional Documents
Culture Documents
SESSION: 2022-2023
Submitted By:
Viney Chhillar
2021511307
Submitted To:
Associate Professor
SESSION: 2022-2023
Submitted By:
Shreya
2021525002
Submitted To:
Associate Professor
Objective :
To understand the different issues involved in the design and implementation of a
database system
To understand and use data manipulation language to query, update, and manage a
database
Theory :
3. DELETE-FROM: This is used to delete all the records of a relation but it will retain the
structure of that relation.
a) DELETE-FROM: This is used to delete all the records of relation.
Syntax: SQL>DELETE FROM relation_name;
Example: SQL>DELETE FROM std;
b) DELETE -FROM-WHERE: This is used to delete a selected record from a relation.Syntax:
SQL>DELETE FROM relation_name WHERE condition;
Example: SQL>DELETE FROM student WHERE sno = 2;
5. TRUNCATE: This command will remove the data permanently. But structure will not be
removed.
Difference between Truncate & Delete:-
By using truncate command data will be removed permanently & will not get back where as by
using delete command data will be removed temporally & get back by using roll back command.
By using delete command data will be removed based on the condition where as by using
truncate command there is no condition.
Truncate is a DDL command & delete is a DML command.
DEPTNO DNAME
10 ACCOUNTING
20 RESEARCH
30 SALES
3. SELECT - FROM -WHERE: This query is used to display a selected set of fields for aselected
set of records of a relation.
Create Table Student (sno NUMBER (3), sname CHAR (10), class CHAR (5));
ALTER TABLE Student ADD (Address CHAR(10));
Desc Student;
INSERT INTO Student (sno,sname,class,address) VALUES ('1', 'Gaurav', 'BTECH', 'NOIDA');
INSERT INTO Student (sno,sname,class,address) VALUES ('2', 'Ramesh', 'BSC', 'Jalandhar');
INSERT INTO Student (sno,sname,class,address) VALUES ('3', 'Parveen', 'MCA', 'SriNagar');
INSERT INTO Student (sno,sname,class,address) VALUES ('4', 'Rohan', 'BCA', 'GrNoida');
INSERT INTO Student (sno,sname,class,address) VALUES ('5', 'Shahid', 'MTECH', 'Aligarh');
Select * From Student;
Select * From Student where Address = 'NOIDA';
Experiment No:2
Objective :
To understand the different issues involved in the design and implementation of a
database system
To understand and use data manipulation language to query, update, and manage a
database
Theory :
6. DELETE-FROM: This is used to delete all the records of a relation but it will retain the
structure of that relation.
c) DELETE-FROM: This is used to delete all the records of relation.
Syntax: SQL>DELETE FROM relation_name;
Example: SQL>DELETE FROM std;
d) DELETE -FROM-WHERE: This is used to delete a selected record from a relation.Syntax:
SQL>DELETE FROM relation_name WHERE condition;
Example: SQL>DELETE FROM student WHERE sno = 2;
6. TRUNCATE: This command will remove the data permanently. But structure will not be
removed.
Difference between Truncate & Delete:-
By using truncate command data will be removed permanently & will not get back where as by
using delete command data will be removed temporally & get back by using roll back command.
By using delete command data will be removed based on the condition where as by using
truncate command there is no condition.
Truncate is a DDL command & delete is a DML command.
DEPTNO DNAME
10 ACCOUNTING
20 RESEARCH
30 SALES
6. SELECT - FROM -WHERE: This query is used to display a selected set of fields
for aselected set of records of a relation.
Create Table Student (sno NUMBER (3), sname CHAR (10), class
CHAR (5));ALTER TABLE Student ADD (Address CHAR(10));
Desc Student;
INSERT INTO Student (sno,sname,class,address) VALUES ('1', 'Gaurav', 'BTECH',
'NOIDA');INSERT INTO Student (sno,sname,class,address) VALUES ('2',
'Ramesh', 'BSC', 'Jalandhar'); INSERT INTO Student (sno,sname,class,address)
VALUES ('3', 'Parveen', 'MCA', 'SriNagar'); INSERT INTO Student
(sno,sname,class,address) VALUES ('4', 'Rohan', 'BCA', 'GrNoida'); INSERT INTO
Student (sno,sname,class,address) VALUES ('5', 'Shahid', 'MTECH', 'Aligarh');
Select * From Student;
Select * From Student where Address = 'NOIDA';