Aim:

To explore the comparison operation and logical operator from SQL.

Algorithm:

Step 1: Start the program.

Step 2: Create the Table.

Step 3: Insert the values using DML commands.

Step 4: View the full table.

Step 5: Execute relational and logical operation.

Step 6: Get the output.

Step 7: Stop the program.

Program

create table students(st_name varchar(25),st_reg_no varchar(10),st_mark number(3),st_percent number(3),st_city varchar(25));

insert into students values('sethu','17uca036',85,85,'cbe');
insert into students values('moulies','17uca021',95,95,'erd');
insert into students values('gopal','17uca023',75,75,'salem');
insert into students values('gopi','17uca008',65,65,'salem');
insert into students values('mouli','17uca020',45,45,'mettur');

select * from students;




select * from students where St_percent>=75;


select * from students where st_percent<75;


select * from students where St_percent!=75;


select * from students where St_percent<>75;


select * from students where St_percent>=75 and St_city='CBE';

select * from students where St_percent>=75 or St_city='CBE';


select * from students where not St_city='CBE';



Post a Comment

Previous Post Next Post