A table called k22stu is created with columns roll_no, name, and location. Data is inserted into the table for 5 students from different locations. Queries are then run to select all data, count rows, filter by location or roll number, and use transactions like commit, savepoint, and rollback.
A table called k22stu is created with columns roll_no, name, and location. Data is inserted into the table for 5 students from different locations. Queries are then run to select all data, count rows, filter by location or roll number, and use transactions like commit, savepoint, and rollback.
A table called k22stu is created with columns roll_no, name, and location. Data is inserted into the table for 5 students from different locations. Queries are then run to select all data, count rows, filter by location or roll number, and use transactions like commit, savepoint, and rollback.
create table k22stu(roll_no int, name varchar(20), location varchar(30));
insert into k22stu values(1,'A','Russia');
insert into k22stu values(2,'B','Russia'); insert into k22stu values(3,'A','Pakistan'); insert into k22stu values(4,'D','India'); insert into k22stu values(5,'E','England'); select * from k22stu; select DISTINCT(location) from k22stu; select count(*) from k22stu; select count(name) from k22stu; select count(distinct name) from k22stu; select location as address from k22stu; select * from k22stu; select * from k22stu where roll_no IN (1,2,3); select * from k22stu; commit; insert into k22stu values(6,'F','England'); savepoint A; select * from k22stu; insert into k22stu values(7,'G','England'); select * from k22stu; rollback to A; select * from k22stu;