Вы находитесь на странице: 1из 7

Program:- 3

Aim:- A program in SQL using logical operators.


Create Command

SQL> create table school(name char(10),rollno number(10),phoneno number(10));

Table created.

SQL> desc school;

Name Null? Type

----------------------------------------- -------- ----------------------------

NAME CHAR(10)

ROLLNO NUMBER(10)

PHONENO NUMBER(10)

Insert Command

SQL> insert into school values('nancy',27,1478523691);

1 row created.

SQL> insert into school values('himanshi',16,4567891230);

1 row created.

SQL> insert into school values('jyoti',21,3692581471);


1 row created.

SQL> desc school;

Name Null? Type

----------------------------------------- -------- ----------------------------

NAME CHAR(10)

ROLLNO NUMBER(10)

PHONENO NUMBER(10)

Select Command

SQL> select*from school;

NAME ROLLNO PHONENO

---------- ---------- ----------

nancy 27 1478523691

himanshi 16 4567891230

jyoti 21 3698521471

SQL> select name,rollno from school;

NAME ROLLNO

---------- ----------

nancy 27

himanshi 16

jyoti 21

SQL> select name,rollno from school where name='jyoti' and rollno=21;


NAME ROLLNO

---------- ----------

jyoti 21

SQL> select name,rollno from school where name='nancy' or rollno=27;

NAME ROLLNO

---------- ----------

nancy 27

SQL> select name,rollno from school where name!='himanshi';

NAME ROLLNO

---------- ----------

nancy 27

jyoti 21
DATABASE MANAGEMENT
SYSTEM LAB FILE

GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT

SUBMITTED TO:- SUBMITTED BY:-


Ms. Sonia tomer Jyoti
Assistant professor BBA – 4th sem.
Dept. of computer sc. & engg. (15bba021)
DATABASE MANAGEMENT
SYSTEM LAB FILE

GANGA INSTITUTE OF TECHNOLOGY AND MANAGEMENT

SUBMITTED TO:- SUBMITTED BY:-


Ms. Sonia tomer Nancy goenka
Assistant professor BBA – 4th sem.
Dept. of computer sc. & engg. (15bba027)
INDEX

S.NO DATE NAME OF PRACTICAL REMARKS


.