KEMBAR78
Dbms | PDF | Databases | Data
0% found this document useful (0 votes)
12 views4 pages

Dbms

The document details a series of SQL commands executed in SQL*Plus, including creating a table named 'sharma', inserting records, updating values, and altering the table structure. It highlights various errors encountered during the process, such as invalid commands and object existence issues. The final state of the 'sharma' table includes three records with names, roll numbers, branches, and ages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

Dbms

The document details a series of SQL commands executed in SQL*Plus, including creating a table named 'sharma', inserting records, updating values, and altering the table structure. It highlights various errors encountered during the process, such as invalid commands and object existence issues. The final state of the 'sharma' table includes three records with names, roll numbers, branches, and ages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

SQL*Plus: Release 11.2.0.2.

0 Production on Wed Jan 31 10:47:33 2024

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

SQL> connect system


Enter password:
ERROR:
ORA-28002: the password will expire within 5 days

Connected.
SQL> create table
2 create table students
3 (name varchar(20),roll_no int not null,branch varchar(15)):
4
SQL> desc students
ERROR:
ORA-04043: object students does not exist

SQL> create table AIDS(name varchar(20),roll_no int not null,branch varchar(15)):


2
SQL> desc AIDS
ERROR:
ORA-04043: object AIDS does not exist

SQL> create table STUDENTS_AIDS(name varchar(20),roll_no int not null,branch


varchar(15)):
2
SQL> desc STUDENTS_AIDS
ERROR:
ORA-04043: object STUDENTS_AIDS does not exist

SQL> create table Welfare(name varchar(20),roll_no int not null,branch


varchar(15)):
2
SQL> desc Welfare
ERROR:
ORA-04043: object Welfare does not exist

SQL> create table sharma(name varchar(20),roll_no int not null,branch varchar(15)):


2
SQL> create table sharma(name varchar(20),roll_no int not null,branch varchar(15));

Table created.

SQL> desc sharma


Name Null? Type
----------------------------------------- -------- ----------------------------
NAME VARCHAR2(20)
ROLL_NO NOT NULL NUMBER(38)
BRANCH VARCHAR2(15)

SQL> insert into sharma values('yash',1,'Aids');


1 row created.

SQL> select *from sharma;

NAME ROLL_NO BRANCH


-------------------- ---------- ---------------
yash 1 Aids

SQL> select name from sharma


2
SQL> select name from sharma;

NAME
--------------------
yash

SQL> slect roll_no from sharma;


SP2-0734: unknown command beginning "slect roll..." - rest of line ignored.
SQL> select roll_no from sharma;

ROLL_NO
----------
1

SQL> insert into sharma values('ravi',2,'Aids');

1 row created.

SQL> select *from sharma;

NAME ROLL_NO BRANCH


-------------------- ---------- ---------------
yash 1 Aids
ravi 2 Aids

SQL> insert into sharma values('nikhil',3,'aids');

1 row created.

SQL> insert into sharma values('patil',4,'aids');\


2 insert into sharma values('patil',4,'aids');
insert into sharma values('patil',4,'aids');\
*
ERROR at line 1:
ORA-00911: invalid character

SQL> insert into sharma values('patil',4,'aids');

1 row created.

SQL> update sharma


2 set branch='it' where name='yash';

1 row updated.

SQL> select *from sharma;

NAME ROLL_NO BRANCH


-------------------- ---------- ---------------
yash 1 it
ravi 2 Aids
nikhil 3 aids
patil 4 aids

SQL> update sharma


2 set roll_no='3' where branch='aids';

2 rows updated.

SQL> select *from sharma;

NAME ROLL_NO BRANCH


-------------------- ---------- ---------------
yash 1 it
ravi 2 Aids
nikhil 3 aids
patil 3 aids

SQL> insert into sharma values('Muskan',5,'aids');

1 row created.

SQL> delete from sharma where roll_no='3';

2 rows deleted.

SQL> select *from sharma;

NAME ROLL_NO BRANCH


-------------------- ---------- ---------------
yash 1 it
ravi 2 Aids
Muskan 5 aids

SQL> alter table sharma add age int;

Table altered.

SQL> select *from sharma;

NAME ROLL_NO BRANCH AGE


-------------------- ---------- --------------- ----------
yash 1 it
ravi 2 Aids
Muskan 5 aids

SQL> update sharma


2 set age='20' where name='yash'
3
SQL> update sharma
2 set age='20' where name='yash';

1 row updated.

SQL> update sharma


2 set age='20'where branch='Aids';
1 row updated.

SQL> update sharma


2 set age='5000' where branch='aids';

1 row updated.

SQL> select *from sharma;

NAME ROLL_NO BRANCH AGE


-------------------- ---------- --------------- ----------
yash 1 it 20
ravi 2 Aids 20
Muskan 5 aids 5000

SQL>

You might also like