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

Program:-3: A Program in SQL Using Logical Operators

This document describes SQL queries on a school database table using logical operators. It creates a school table with name, rollno, and phoneno columns. It inserts records for 3 students and verifies the data. Select queries are written to retrieve records using logical operators like AND, OR, and NOT equal to filter the results.

Uploaded by

Jyoti Yadav
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)
90 views

Program:-3: A Program in SQL Using Logical Operators

This document describes SQL queries on a school database table using logical operators. It creates a school table with name, rollno, and phoneno columns. It inserts records for 3 students and verifies the data. Select queries are written to retrieve records using logical operators like AND, OR, and NOT equal to filter the results.

Uploaded by

Jyoti Yadav
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/ 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


.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy