Student

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

SQL*Plus: Release 11.2.0.1.

0 Production on Thu May 3 23:05:04 2012

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Enter user-name: scott Enter password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> creat table student(name varchar(15),roll number(5),dept varchar(10),mark n umber(3)); SP2-0734: unknown command beginning "creat tabl..." - rest of line ignored. SQL> create table student(name varchar(15),roll number(5),dept varchar(10),mark number(3));

Table created.

SQL> insert into student values('&name',&roll,'&dept',&mark); Enter value for name: Arun_kumar Enter value for roll: 101 Enter value for dept: Mba Enter value for mark: 88

old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Arun_kumar',101,'Mba',88)

1 row created.

SQL> / Enter value for name: Arivu Enter value for roll: 102 Enter value for dept: Mba Enter value for mark: 85 old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Arivu',102,'Mba',85)

1 row created.

SQL> / Enter value for name: Uma_Devi Enter value for roll: 103 Enter value for dept: Enter value for mark: old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Uma_Devi',103,'',) insert into student values('Uma_Devi',103,'',) * ERROR at line 1:

ORA-00936: missing expression

SQL> / Enter value for name: Dinesh_kumar Enter value for roll: 103 Enter value for dept: Mba Enter value for mark: 72 old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Dinesh_kumar',103,'Mba',72)

1 row created.

SQL> / Enter value for name: Grase Enter value for roll: 104 Enter value for dept: Mba Enter value for mark: 78 old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Grase',104,'Mba',78)

1 row created.

SQL> / Enter value for name: Uma_devi

Enter value for roll: 105 Enter value for dept: Mba Enter value for mark: 68 old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Uma_devi',105,'Mba',68)

1 row created.

SQL> / Enter value for name: Vignesh Enter value for roll: 106 Enter value for dept: Mba Enter value for mark: 95 old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Vignesh',106,'Mba',95)

1 row created.

SQL> / Enter value for name: Vinoth Enter value for roll: 107 Enter value for dept: 65 Enter value for mark: old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Vinoth',107,'65',)

insert into student values('Vinoth',107,'65',) * ERROR at line 1: ORA-00936: missing expression

SQL> / Enter value for name: Vinoth Enter value for roll: 107 Enter value for dept: Mba Enter value for mark: 65 old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Vinoth',107,'Mba',65)

1 row created.

SQL> / Enter value for name: Vijaya Enter value for roll: 108 Enter value for dept: Mba Enter value for mark: 73 old 1: insert into student values('&name',&roll,'&dept',&mark) new 1: insert into student values('Vijaya',108,'Mba',73)

1 row created.

SQL> select *from student;

NAME

ROLL DEPT

MARK

--------------- ---------- ---------- ---------Arun_kumar Arivu Dinesh_kumar Grase Uma_devi Vignesh Vinoth Vijaya 101 Mba 102 Mba 103 Mba 104 Mba 105 Mba 106 Mba 107 Mba 108 Mba 78 68 95 65 73 85 72 88

8 rows selected.

SQL> select name,mark from student where mark>=75;

NAME

MARK

--------------- ---------Arun_kumar Arivu Grase Vignesh 85 78 95 88

SQL> select name,mark from student where mark<75 and mark>65;

NAME

MARK

--------------- ---------Dinesh_kumar Uma_devi Vijaya 73 72 68

SQL> alter table student add(grade char(3));

Table altered.

SQL> select *from student;

NAME

ROLL DEPT

MARK GRA

--------------- ---------- ---------- ---------- --Arun_kumar Arivu Dinesh_kumar Grase Uma_devi Vignesh Vinoth Vijaya 101 Mba 102 Mba 103 Mba 104 Mba 105 Mba 106 Mba 107 Mba 108 Mba 78 68 95 65 73 85 72 88

8 rows selected.

SQL> update student set grade='S' where mare>=85; update student set grade='S' where mare>=85 * ERROR at line 1: ORA-00904: "MARE": invalid identifier

SQL> update student set grade='S' where mark>=85;

3 rows updated.

SQL> update student set grade='A' where mark<85 and mark>=70;

3 rows updated.

SQL> update student set grade='B' where mark<70;

2 rows updated.

SQL> select *from student;

NAME

ROLL DEPT

MARK GRA

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

Arun_kumar Arivu Dinesh_kumar Grase Uma_devi Vignesh Vinoth Vijaya

101 Mba 102 Mba 103 Mba 104 Mba 105 Mba 106 Mba 107 Mba 108 Mba 85 S

88 S

72 A 78 A 68 B 95 S 65 B 73 A

8 rows selected.

SQL>

You might also like