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

15BCE0028 DEVESH KHARE 7/11/16

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jul 11 18:30:26 2016

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

Enter user-name: EXAM028@VITORA


Enter password:

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

SQL> CREATE TABLE student028(name varchar(20), regno varchar(10),course


varchar(
10) cgpa number(3,2));
CREATE TABLE student028(name varchar(20), regno varchar(10),course varchar(10)
c
gpa number(3,2))
*

ERROR at line 1:
ORA-00907: missing right parenthesis

SQL> CREATE TABLE student028(name varchar(20), regno varchar(10),course


varchar(
10),cgpa number(3,2));

15BCE0028 DEVESH KHARE 7/11/16

Table created.

SQL> description student28


SP2-0734: unknown command beginning "descriptio..." - rest of line ignored.
SQL> desc student28
ERROR:
ORA-04043: object student28 does not exist

SQL> desc student028


Name

Null?

Type

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

NAME

VARCHAR2(20)

REGNO

VARCHAR2(10)

COURSE

VARCHAR2(10)

CGPA

NUMBER(3,2)

SQL> CREATE TABLE employee028(ename varchar(20),eage varchar(10),esalary


number(
3,2))
2 ;

Table created.

SQL> desc employee028

15BCE0028 DEVESH KHARE 7/11/16


Name

Null?

Type

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

ENAME

VARCHAR2(20)

EAGE

VARCHAR2(10)

ESALARY

NUMBER(3,2)

SQL> INSERT INTO student028


2 values ('devesh','15bce028','btechcse','11')
3 ;
values ('devesh','15bce028','btechcse','11')
*
ERROR at line 2:
ORA-01438: value larger than specified precision allowed for this column

SQL> INSERT INTO student028


2 values ('devesh','15bce028','btechcse','11')
3 ;
values ('devesh','15bce028','btechcse','11')
*
ERROR at line 2:
ORA-01438: value larger than specified precision allowed for this column

SQL> INSERT INTO student028

15BCE0028 DEVESH KHARE 7/11/16


2 values ('devesh','15bce028','btechcse','10')
3 ;
values ('devesh','15bce028','btechcse','10')
*
ERROR at line 2:
ORA-01438: value larger than specified precision allowed for this column

SQL> INSERT INTO student028


2 values ('devesh','15bce028','btechcse',10)
3 ;
values ('devesh','15bce028','btechcse',10)
*
ERROR at line 2:
ORA-01438: value larger than specified precision allowed for this column

SQL> INSERT INTO student028


2 values ('devesh','15bce028','btechcse',10.0)
3 ;
values ('devesh','15bce028','btechcse',10.0)
*
ERROR at line 2:
ORA-01438: value larger than specified precision allowed for this column

15BCE0028 DEVESH KHARE 7/11/16


SQL> INSERT INTO student028
2 values ('devesh','15bce028','btechcse',9.0)
3 ;

1 row created.

SQL> SELECT * FROM student028;

NAME

REGNO

COURSE

CGPA

-------------------- ---------- ---------- ---------devesh

15bce028 btechcse

SQL> select*from student028;

NAME

REGNO

COURSE

CGPA

-------------------- ---------- ---------- ---------devesh

15bce028 btechcse

SQL> INSERT INTO student028


2 (regno,cgpa,name,course)
3 values
4 ('15bec029',9.5,'abc','btechece');

1 row created.

SQL> select * from student028;

15BCE0028 DEVESH KHARE 7/11/16

NAME

REGNO

COURSE

CGPA

-------------------- ---------- ---------- ---------devesh


abc

15bce028 btechcse
15bec029 btechece

9
9.5

SQL> insert into student028('&name','&regno','&course','&cgpa')


2 ;
Enter value for name: xyz
Enter value for regno: 15bme089
Enter value for course: btechmech
Enter value for cgpa: 7.3
old 1: insert into student028('&name','&regno','&course','&cgpa')
new 1: insert into student028('xyz','15bme089','btechmech','7.3')
insert into student028('xyz','15bme089','btechmech','7.3')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword

SQL> insert into student028 values('&name','&regno','&course','&cgpa');


Enter value for name: xyz
Enter value for regno: 15bme089
Enter value for course: btechmech
Enter value for cgpa: 7.3
old 1: insert into student028 values('&name','&regno','&course','&cgpa')

15BCE0028 DEVESH KHARE 7/11/16


new 1: insert into student028 values('xyz','15bme089','btechmech','7.3')

1 row created.

SQL> insert into student028 valyes('&name','&regno','&course','&cgpa');


Enter value for name: asbjjqs
Enter value for regno: efehbjkf
Enter value for course: ernf
Enter value for cgpa: 6
old 1: insert into student028 valyes('&name','&regno','&course','&cgpa')
new 1: insert into student028 valyes('asbjjqs','efehbjkf','ernf','6')
insert into student028 valyes('asbjjqs','efehbjkf','ernf','6')
*
ERROR at line 1:
ORA-00928: missing SELECT keyword

SQL> /
Enter value for name: qqw
Enter value for regno: qwwq
Enter value for course: www
Enter value for cgpa: 6.7
old 1: insert into student028 valyes('&name','&regno','&course','&cgpa')
new 1: insert into student028 valyes('qqw','qwwq','www','6.7')
insert into student028 valyes('qqw','qwwq','www','6.7')
*

15BCE0028 DEVESH KHARE 7/11/16


ERROR at line 1:
ORA-00928: missing SELECT keyword

SQL> select * from student028;

NAME

REGNO

COURSE

CGPA

-------------------- ---------- ---------- ---------devesh

15bce028 btechcse

abc

15bec029 btechece

9.5

xyz

15bme089 btechmech

7.3

SQL> desc student028;


Name

Null?

Type

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

NAME

VARCHAR2(20)

REGNO

VARCHAR2(10)

COURSE

VARCHAR2(10)

CGPA

NUMBER(3,2)

SQL> select *from emloyee028;


select *from emloyee028
*
ERROR at line 1:
ORA-00942: table or view does not exist

15BCE0028 DEVESH KHARE 7/11/16

SQL> select *from employee028;

no rows selected

SQL>

15BCE0028 DEVESH KHARE 7/11/16

15BCE0028 DEVESH KHARE 7/11/16

You might also like