You are on page 1of 13

SQL> select stud_name"STUDENT NAME",ssc_per+0.

15"NEW PER" from stud_info;
STUDENT NAME
NEW PER
------------ ---------ajay
80.15
samir
89.15
ankita
84.54
Rajesh
78.15
Sanna
80.05
Kartik
87.75
Micheal
72.15
Jaya
81.65
Beena
83.64
Danish
78.16
10 rows selected.
SQL> select stud_name,ssc_per+0.15"NEW PER" from stud_info where branch_code="CM
";
select stud_name,ssc_per+0.15"NEW PER" from stud_info where branch_code="CM"
*
ERROR at line 1:
ORA-00904: "CM": invalid identifier
SQL> select stud_name,ssc_per+0.15 from stud_info where branch_code="CM";
select stud_name,ssc_per+0.15 from stud_info where branch_code="CM"
*
ERROR at line 1:
ORA-00904: "CM": invalid identifier
SQL> select stud_name,ssc_per+0.15 from stud_info where branch="CM";
select stud_name,ssc_per+0.15 from stud_info where branch="CM"
*
ERROR at line 1:
ORA-00904: "CM": invalid identifier
SQL> select stud_name,ssc_per+0.15 from stud_info where branch_code='CM';
STUD_NAME
SSC_PER+0.15
------------ -----------ajay
80.15
samir
89.15
Rajesh
78.15
Jaya
81.65
Danish
78.16
SQL> select stud_name,(ssc_per+0.15)/2 from stud_info';
ERROR:
ORA-01756: quoted string not properly terminated
SQL> select stud_name,(ssc_per+0.15)/2 from stud_info;
STUD_NAME
(SSC_PER+0.15)/2
------------ ---------------ajay
40.075
samir
44.575

ankita
Rajesh
Sanna
Kartik
Micheal
Jaya
Beena
Danish

42.27
39.075
40.025
43.875
36.075
40.825
41.82
39.08

10 rows selected.
SQL> select * from stud_info where activity='Sports';
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1115 Kartik
29-JUN-91 Solapur
Sports
3000
87.6
ET B+
3000 Micheal
05-MAY-90 Kolhapur
ET A vidya@yahoo.com

Sports

72

SQL> select * from stud_info where activity='Sports';
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1115 Kartik
29-JUN-91 Solapur
Sports
3000
87.6
ET B+
3000 Micheal
05-MAY-90 Kolhapur
ET A vidya@yahoo.com

Sports

72

/
/
/
/
/
/
SQL> select * from stud_info where activity!='Sports';
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1113 ankita

13-MAR-91 bhopal

Cultural

11-JAN-90 Nagpur

Project

DOB

ACTIVITY

2000

84.39

IF A
1000 Rajesh
CM A ab@yahoo.com
STUD_ID STUD_NAME

CITY

78

LEADER

SSC_PER

---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------2000 Sanna
23-APR-91 Nanded
Cultural
79.9
IF A+ sn@yahoo.com
1114 Jaya

07-AUG-91 Talegaon

Project

1000

81.5

1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

CM B
IF A
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1118 Danish
31-DEC-90 Latur
Project
1000
78.01
CM A+
7 rows selected.
/
/
/
/
/
/
SQL> select * from stud_info where ssc_per<80
2 ;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1000 Rajesh
11-JAN-90 Nagpur
Project
78
CM A ab@yahoo.com
2000 Sanna
IF A+ sn@yahoo.com

23-APR-91 Nanded

Cultural

79.9

3000 Micheal
05-MAY-90 Kolhapur Sports
72
ET A vidya@yahoo.com
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1118 Danish
31-DEC-90 Latur
Project
1000
78.01
CM A+
SQL> select * from stud_info where ssc_per>80;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1112 samir
15-SEP-90 nasik
89
CM A+

1113 ankita

13-MAR-91 bhopal

Cultural

2000

84.39

1115 Kartik

29-JUN-91 Solapur

Sports

3000

87.6

IF A
ET B+
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1114 Jaya
07-AUG-91 Talegaon Project
1000
81.5
CM B
1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

IF A
SQL> select * from stud_info where ssc_per<=80;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1000 Rajesh
CM A ab@yahoo.com

11-JAN-90 Nagpur

Project

2000 Sanna
IF A+ sn@yahoo.com

23-APR-91 Nanded

Cultural

78
79.9

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------3000 Micheal
05-MAY-90 Kolhapur Sports
72
ET A vidya@yahoo.com
1118 Danish

31-DEC-90 Latur

Project

1000

78.01

CM A+
SQL> select * from stud_info where ssc_per>=80;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1112 samir

15-SEP-90 nasik

89

CM A+
1113 ankita
IF A

13-MAR-91 bhopal

Cultural

2000

84.39

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1115 Kartik
29-JUN-91 Solapur
Sports
3000
87.6
ET B+
1114 Jaya

07-AUG-91 Talegaon

Project

1000

81.5

1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

CM B
IF A
6 rows selected.
SQL> select * from stud_info where ssc_per between 82 and 85;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1113 ankita
13-MAR-91 bhopal
Cultural
2000
84.39
IF A
1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

IF A
SQL> select * from stud_info where ssc_per not between 82 and 85;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1112 samir

15-SEP-90 nasik

89

CM A+
1000 Rajesh
CM A ab@yahoo.com

11-JAN-90 Nagpur

Project

78

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------2000 Sanna
23-APR-91 Nanded
Cultural
79.9
IF A+ sn@yahoo.com
1115 Kartik

29-JUN-91 Solapur

Sports

3000

87.6

ET B+
3000 Micheal
05-MAY-90 Kolhapur
ET A vidya@yahoo.com

Sports

72

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1114 Jaya
07-AUG-91 Talegaon Project
1000
81.5
CM B
1118 Danish

31-DEC-90 Latur

Project

1000

78.01

CM A+
8 rows selected.
SQL> select * from stud_info where stud_name='__mir';
no rows selected
SQL> select * from stud_info where stud_name='_ _mir';
no rows selected
SQL> select * from stud_info where stud_name='__meer';
no rows selected
SQL> select * from stud_info where stud_name like'__meer';
no rows selected
SQL> select * from stud_info where stud_name like '__meer';
no rows selected
SQL> select * from stud_info where stud_name like '__mir';
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1112 samir
15-SEP-90 nasik
89
CM A+
SQL> select * from stud_info where stud_name like 'Sa%';
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------2000 Sanna
23-APR-91 Nanded
Cultural
79.9
IF A+ sn@yahoo.com
SQL> select * from stud_info where stud_name like '%me_r';
no rows selected
SQL> select * from stud_info where stud_name like '%m_r';
STUD_ID STUD_NAME

DOB

CITY

ACTIVITY

LEADER

SSC_PER

---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1112 samir
15-SEP-90 nasik
89
CM A+
SQL> select * from stud_info where stud_name not like 'sameer';
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1112 samir

15-SEP-90 nasik

89

CM A+
1113 ankita

13-MAR-91 bhopal

Cultural

2000

84.39

IF A
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1000 Rajesh
11-JAN-90 Nagpur
Project
78
CM A ab@yahoo.com
2000 Sanna
IF A+ sn@yahoo.com
1115 Kartik

23-APR-91 Nanded

Cultural

29-JUN-91 Solapur

Sports

79.9
3000

87.6

ET B+
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------3000 Micheal
05-MAY-90 Kolhapur Sports
72
ET A vidya@yahoo.com
1114 Jaya

07-AUG-91 Talegaon

Project

1000

81.5

1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

CM B
IF A
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1118 Danish
31-DEC-90 Latur
Project
1000
78.01
CM A+
10 rows selected.

SQL> select * from stud_info where stud_name in('ajay','samir');
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1112 samir

15-SEP-90 nasik

89

CM A+
SQL> select * from stud_info where stud name not in('ajay','samir')
2 ;
select * from stud_info where stud name not in('ajay','samir')
*
ERROR at line 1:
ORA-00920: invalid relational operator
SQL> select * from stud_info where stud_name not in('ajay','samir')
2 ;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1113 ankita
13-MAR-91 bhopal
Cultural
2000
84.39
IF A
1000 Rajesh
CM A ab@yahoo.com

11-JAN-90 Nagpur

Project

2000 Sanna
IF A+ sn@yahoo.com

23-APR-91 Nanded

Cultural

78
79.9

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1115 Kartik
29-JUN-91 Solapur
Sports
3000
87.6
ET B+
3000 Micheal
05-MAY-90 Kolhapur
ET A vidya@yahoo.com
1114 Jaya

07-AUG-91 Talegaon

Sports
Project

72
1000

81.5

CM B
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1117 Beena
28-FEB-90 Kanpur
Cultural
2000
83.49
IF A

1118 Danish

31-DEC-90 Latur

Project

1000

78.01

CM A+
8 rows selected.
SQL> select * from stud_info where activity is null;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1112 samir
15-SEP-90 nasik
89
CM A+
SQL> select * from stud_info where activity is not null;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1113 ankita

13-MAR-91 bhopal

Cultural

11-JAN-90 Nagpur

Project

2000

84.39

IF A
1000 Rajesh
CM A ab@yahoo.com

78

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------2000 Sanna
23-APR-91 Nanded
Cultural
79.9
IF A+ sn@yahoo.com
1115 Kartik

29-JUN-91 Solapur

Sports

3000

87.6

ET B+
3000 Micheal
05-MAY-90 Kolhapur
ET A vidya@yahoo.com

Sports

72

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1114 Jaya
07-AUG-91 Talegaon Project
1000
81.5
CM B
1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

1118 Danish

31-DEC-90 Latur

Project

1000

78.01

IF A
CM A+

9 rows selected.
SQL> select * from stud_info where branch_code='IF' AND leader is not null;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1113 ankita
13-MAR-91 bhopal
Cultural
2000
84.39
IF A
1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

IF A
SQL> select * from stud_info where branch_code='IF' OR leader is not null;
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1111 ajay
20-JUL-90 pune
Project
1000
80
CM A+
1113 ankita

13-MAR-91 bhopal

Cultural

23-APR-91 Nanded

Cultural

2000

84.39

IF A
2000 Sanna
IF A+ sn@yahoo.com

79.9

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1115 Kartik
29-JUN-91 Solapur
Sports
3000
87.6
ET B+
1114 Jaya

07-AUG-91 Talegaon

Project

1000

81.5

1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

CM B
IF A
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1118 Danish
31-DEC-90 Latur
Project
1000
78.01
CM A+
7 rows selected.
SQL> select * from stud_info where NOT(activity='Sports');
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID

--- -- --------------1111 ajay
20-JUL-90 pune
CM A+
1113 ankita

Project

1000

80

13-MAR-91 bhopal

Cultural

2000

84.39

11-JAN-90 Nagpur

Project

IF A
1000 Rajesh
CM A ab@yahoo.com

78

STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------2000 Sanna
23-APR-91 Nanded
Cultural
79.9
IF A+ sn@yahoo.com
1114 Jaya

07-AUG-91 Talegaon

Project

1000

81.5

1117 Beena

28-FEB-90 Kanpur

Cultural

2000

83.49

CM B
IF A
STUD_ID STUD_NAME
DOB
CITY
ACTIVITY
LEADER
SSC_PER
---------- ------------ --------- ---------- ---------- ---------- ---------BRA EN EMAIL_ID
--- -- --------------1118 Danish
31-DEC-90 Latur
Project
1000
78.01
CM A+
7 rows selected.

SQL> select item_name"Name of item",quantity"No of item" from lab_data;
Name of item
No of item
-------------------- ---------CRO
5
Signal generator
5
IC testor
Digital CRO
2
Digital multimeter
3
CRO probes
10
LUX meter
5
Analog multimeter
3
8 rows selected.
SQL> select item_name from lab_data where make='Scientech';
ITEM_NAME
-------------------CRO

SQL> select item_name from lab_data where make!='Scientech';
ITEM_NAME
-------------------Signal generator
Digital CRO
Digital multimeter
CRO probes
LUX meter
Analog multimeter
6 rows selected.
SQL> select item_name,item_code from lab_data where quantity>=5;
ITEM_NAME
-------------------CRO
Signal generator
CRO probes
LUX meter

ITEM_
----I001
I002
I006
I007

SQL> select item_name,item_code from lab_data where quantity <5 and quantity>
ITEM_NAME
-------------------Digital multimeter
Analog multimeter

ITEM_
----I005
IOO8

SQL> select item_name from lab_data where make like 'S%';
ITEM_NAME
-------------------CRO
Digital CRO
SQL> select * from lab_data where quantity is null;
ITEM_ ITEM_NAME
QUANTITY MAKE
STATUS
----- -------------------- ---------- ---------- --------------I003 IC testor
SQL> select * from lab_data where quantity is not null;
ITEM_
----I001
I002
I004
I005
I006
I007
IOO8

ITEM_NAME
QUANTITY MAKE
STATUS
-------------------- ---------- ---------- --------------CRO
5 Scientech
Signal generator
5 APLAB
Digital CRO
2 Sigma
Digital multimeter
3 APLAB
CRO probes
10 Edkit
LUX meter
5 APLAB
Analog multimeter
3 APLAB

7 rows selected.
SQL> select * from lab_data where make='Sigma';

ITEM_ ITEM_NAME
QUANTITY MAKE
STATUS
----- -------------------- ---------- ---------- --------------I004 Digital CRO
2 Sigma
SQL> select * from lab_data where make!='Edkit';
ITEM_
----I001
I002
I004
I005
I007
IOO8

ITEM_NAME
QUANTITY MAKE
STATUS
-------------------- ---------- ---------- --------------CRO
5 Scientech
Signal generator
5 APLAB
Digital CRO
2 Sigma
Digital multimeter
3 APLAB
LUX meter
5 APLAB
Analog multimeter
3 APLAB

6 rows selected.