SlideShare a Scribd company logo
SQL> create sequence pooja;
Sequence created.
SQL> minvalue with1
SP2-0734: unknowncommandbeginning"minvaluew..." - restof line ignored.
SQL> minvalue 1
SP2-0042: unknowncommand"minvalue1" - restof line ignored.
SQL> create sequence sqnamestartwith1
2 incrementby1;
Sequence created.
SQL> create table stud(s_idnumber(2),s_name varchar2(21));
create table stud(s_idnumber(2),s_name varchar2(21))
*
ERROR at line 1:
ORA-00955: name is alreadyusedbyan existingobject
SQL> create table stud1(s_idnumber(2),s_name varchar2(21));
Table created.
SQL> insertintostud1("1","pooja");
insertintostud1("1","pooja")
*
ERROR at line 1:
ORA-00926: missingVALUESkeyword
SQL> insertintostud1 values("1","pooja");
insertintostud1values("1","pooja")
*
ERROR at line 1:
ORA-00984: columnnot allowedhere
SQL> insertintostud1 values('1'.'pooja');
insertintostud1values('1'.'pooja')
*
ERROR at line 1:
ORA-00917: missingcomma
SQL> insertintostud1 values('1','pooja');
1 rowcreated.
SQL> insertintostud1 values('2','riya');
1 rowcreated.
SQL> insertintostud1 values('2','riya');
1 rowcreated.
SQL> insertintostud1 values(sqname.nextval,'rekha');
1 rowcreated.
SQL> selectc*formstud1;
SP2-0734: unknowncommandbeginning"selectc*f..." - restof line ignored.
SQL> select*formstud1;
select*formstud1
*
ERROR at line 1:
ORA-00923: FROM keywordnotfoundwhere expected
SQL> select*fromstud1;
S_ID S_NAME
---------- ---------------------
1 pooja
2 riya
2 riya
1 rekha
SQL> insertintostud1 values(sqname.nextval,'radhika');
1 rowcreated.
SQL> select*fromstud1;
S_ID S_NAME
---------- ---------------------
1 pooja
2 riya
2 riya
1 rekha
2 radhika
SQL> create table student1(s_idnumber(4),s_name varchar2(21),addressvarchar2(
21),s_contactN number(7));
create table student1(s_idnumber(4),s_name varchar2(21),addressvarchar2(21),s
_contactN number(7))
*
ERROR at line 1:
ORA-00955: name is alreadyusedbyan existingobject
SQL> create table studentmca(s_idnumber(4),s_name varchar2(21),addressvarchar
2(21),s_contactN number(7));
Table created.
SQL> desc studentmca;
Name Null? Type
----------------------------------------- -------- ----------------------------
S_ID NUMBER(4)
S_NAME VARCHAR2(21)
ADDRESS VARCHAR2(21)
S_CONTACTN NUMBER(7)
SQL> create table studentmca(s_idnumber(4),p1number(4),p2number(4),p3number
(4));
create table studentmca(s_idnumber(4),p1number(4),p2number(4),p3number(4))
*
ERROR at line 1:
ORA-00955: name is alreadyusedbyan existingobject
SQL> create table resultmca(s_idnumber(4),p1number(4),p2number(4),p3number(
4));
Table created.
SQL> desc resultmca;
Name Null? Type
----------------------------------------- -------- ----------------------------
S_ID NUMBER(4)
P1 NUMBER(4)
P2 NUMBER(4)
P3 NUMBER(4)
SQL> desc studentmca;
Name Null? Type
----------------------------------------- -------- ----------------------------
S_ID NUMBER(4)
S_NAME VARCHAR2(21)
ADDRESS VARCHAR2(21)
S_CONTACTN NUMBER(7)
SQL> inserttable studentmcavalues('1','pooja','kurji','7654303');
inserttable studentmcavalues('1','pooja','kurji','7654303')
*
ERROR at line 1:
ORA-00925: missingINTOkeyword
SQL> insertintostudentmcavalues('1','pooja','kurji','7654303');
1 rowcreated.
SQL> insertintostudentmcavalues('2','pushpaq','patna','7624303');
1 rowcreated.
SQL> insertintostudentmcavalues('3','ravi','patna','6624303');
1 rowcreated.
SQL> insertintostudentmcavalues('4','raja','patna','6634303');
1 rowcreated.
SQL> insertintostudentmcavalues('5','raj','delhi','6637303');
1 rowcreated.
SQL> desc resultmca;
Name Null? Type
----------------------------------------- -------- ----------------------------
S_ID NUMBER(4)
P1 NUMBER(4)
P2 NUMBER(4)
P3 NUMBER(4)
SQL> insertintoresultmcavalues('1','45','65','76');
1 rowcreated.
SQL> insertintoresultmcavalues('2','47','64','76');
1 rowcreated.
SQL> insertintoresultmcavalues('3','47','65','78');
1 rowcreated.
SQL> insertintoresultmcavalues('4','46','68','78');
1 rowcreated.
SQL> insertintoresultmcavalues('5','46','69','78');
1 rowcreated.
SQL> select*from resultmca;
S_ID P1 P2 P3
---------- -------------------- ----------
1 45 65 76
2 47 64 76
3 47 65 78
4 46 68 78
5 46 69 78
SQL> select* from'p1' where s_idinwhere p1>60;
select* from'p1' where s_idinwhere p1>60
*
ERROR at line 1:
ORA-00903: invalidtable name
SQL> select* from studentmcawhere s_idin(selectidfromresultmcawhere p1>=6
0);
select* fromstudentmcawhere s_idin(selectidfromresultmcawhere p1>=60)
*
ERROR at line 1:
ORA-00904: "ID": invalididentifier
SQL> select* from studentmcawhere s_idin(selects_idfromresultmcawhere p1>
=60);
no rowsselected
SQL> select* from studentmcawhere s_idin(selects_idfromresultmcawhere p3>
=60);
S_ID S_NAME ADDRESS S_CONTACTN
---------- --------------------- --------------------- ----------
1 pooja kurji 7654303
2 pushpaq patna 7624303
3 ravi patna 6624303
4 raja patna 6634303
5 raj delhi 6637303
SQL>

More Related Content

What's hot (20)

PDF
Database Management System
Hitesh Mohapatra
 
PDF
UKOUG 2019 - SQL features
Connor McDonald
 
TXT
Quick reference for cql
Rajkumar Asohan, PMP
 
DOCX
Sql ejercicio 1
Jillian Motoharu
 
PDF
PHP Static Code Review
Damien Seguy
 
ODP
Explain
Ligaya Turmelle
 
PDF
Notes for SQLite3 Usage
William Lee
 
TXT
4sem dbms(1)
Karthik Sagar
 
PDF
My SQL Idiosyncrasies That Bite OTN
Ronald Bradford
 
PDF
Connor McDonald 11g for developers
InSync Conference
 
PPTX
Sql
ftz 420
 
PDF
ZFINDALLZPROGAM
Jay Dalwadi
 
PDF
Sangam 19 - PLSQL still the coolest
Connor McDonald
 
PDF
Pdxpugday2010 pg90
Selena Deckelmann
 
PDF
Ruby closures, how are they possible?
Carlos Alonso Pérez
 
PDF
ANSI vs Oracle language
Connor McDonald
 
PPT
Les09
arnold 7490
 
PPT
Les11
arnold 7490
 
PDF
Latin America Tour 2019 - 10 great sql features
Connor McDonald
 
PDF
Slaying the Dragon: Implementing a Programming Language in Ruby
Jason Yeo Jie Shun
 
Database Management System
Hitesh Mohapatra
 
UKOUG 2019 - SQL features
Connor McDonald
 
Quick reference for cql
Rajkumar Asohan, PMP
 
Sql ejercicio 1
Jillian Motoharu
 
PHP Static Code Review
Damien Seguy
 
Notes for SQLite3 Usage
William Lee
 
4sem dbms(1)
Karthik Sagar
 
My SQL Idiosyncrasies That Bite OTN
Ronald Bradford
 
Connor McDonald 11g for developers
InSync Conference
 
Sql
ftz 420
 
ZFINDALLZPROGAM
Jay Dalwadi
 
Sangam 19 - PLSQL still the coolest
Connor McDonald
 
Pdxpugday2010 pg90
Selena Deckelmann
 
Ruby closures, how are they possible?
Carlos Alonso Pérez
 
ANSI vs Oracle language
Connor McDonald
 
Latin America Tour 2019 - 10 great sql features
Connor McDonald
 
Slaying the Dragon: Implementing a Programming Language in Ruby
Jason Yeo Jie Shun
 

Similar to Sql seuence and sub queries (20)

PDF
Sql commands
Christalin Nelson
 
PDF
Relational Database Managment System Lab - Group A
Murugan146644
 
PDF
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
Racharla Rohit Varma
 
DOC
Introduction sql
sagarasuri
 
RTF
Best sql plsql_material for B.TECH
AmIt Prasad
 
DOC
Sql plsql
prudhviraj_cse
 
PDF
lab.123456789123456789123456789123456789
Ghh
 
PDF
"Comprehensive Guide to Database Management Systems: Optimizing Data Architec...
BHAVYAGOLCHHARA21110
 
PDF
SQL Quick Reference Card
Techcanvass
 
PPT
Database queries
laiba29012
 
DOCX
Dbms record
Teja Bheemanapally
 
PDF
Oracle Material.pdf
rajeshkathavarayan
 
PPTX
MS SQL Database basic
wali1195189
 
PPTX
Java class 8
Edureka!
 
PDF
Oracle12c For Developers
Alex Nuijten
 
PDF
Oracle12 for Developers - Oracle OpenWorld Preview AMIS
Getting value from IoT, Integration and Data Analytics
 
PDF
Plsql examples
srinivas sunkara
 
PDF
Structured Query Language - All commands Notes
sarithaapgcr
 
PPTX
UNIT-3.pptx
MaheshBabuKasukurthi
 
Sql commands
Christalin Nelson
 
Relational Database Managment System Lab - Group A
Murugan146644
 
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
Racharla Rohit Varma
 
Introduction sql
sagarasuri
 
Best sql plsql_material for B.TECH
AmIt Prasad
 
Sql plsql
prudhviraj_cse
 
lab.123456789123456789123456789123456789
Ghh
 
"Comprehensive Guide to Database Management Systems: Optimizing Data Architec...
BHAVYAGOLCHHARA21110
 
SQL Quick Reference Card
Techcanvass
 
Database queries
laiba29012
 
Dbms record
Teja Bheemanapally
 
Oracle Material.pdf
rajeshkathavarayan
 
MS SQL Database basic
wali1195189
 
Java class 8
Edureka!
 
Oracle12c For Developers
Alex Nuijten
 
Oracle12 for Developers - Oracle OpenWorld Preview AMIS
Getting value from IoT, Integration and Data Analytics
 
Plsql examples
srinivas sunkara
 
Structured Query Language - All commands Notes
sarithaapgcr
 
Ad

More from pooja kumari (10)

PPTX
Voice recognition
pooja kumari
 
PPTX
Cyber
pooja kumari
 
PDF
Queue
pooja kumari
 
DOCX
Introduction to linked lists
pooja kumari
 
PPTX
Thread.ppt
pooja kumari
 
PPTX
Thread.ppt
pooja kumari
 
PPTX
Exception handling in java
pooja kumari
 
PPTX
Exception handling in java
pooja kumari
 
PPTX
Applet
pooja kumari
 
PPT
Exception handling
pooja kumari
 
Voice recognition
pooja kumari
 
Introduction to linked lists
pooja kumari
 
Thread.ppt
pooja kumari
 
Thread.ppt
pooja kumari
 
Exception handling in java
pooja kumari
 
Exception handling in java
pooja kumari
 
Applet
pooja kumari
 
Exception handling
pooja kumari
 
Ad

Recently uploaded (20)

PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
Practical Applications of AI in Local Government
OnBoard
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Practical Applications of AI in Local Government
OnBoard
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 

Sql seuence and sub queries

  • 1. SQL> create sequence pooja; Sequence created. SQL> minvalue with1 SP2-0734: unknowncommandbeginning"minvaluew..." - restof line ignored. SQL> minvalue 1 SP2-0042: unknowncommand"minvalue1" - restof line ignored. SQL> create sequence sqnamestartwith1 2 incrementby1; Sequence created. SQL> create table stud(s_idnumber(2),s_name varchar2(21)); create table stud(s_idnumber(2),s_name varchar2(21)) * ERROR at line 1: ORA-00955: name is alreadyusedbyan existingobject SQL> create table stud1(s_idnumber(2),s_name varchar2(21)); Table created. SQL> insertintostud1("1","pooja"); insertintostud1("1","pooja") *
  • 2. ERROR at line 1: ORA-00926: missingVALUESkeyword SQL> insertintostud1 values("1","pooja"); insertintostud1values("1","pooja") * ERROR at line 1: ORA-00984: columnnot allowedhere SQL> insertintostud1 values('1'.'pooja'); insertintostud1values('1'.'pooja') * ERROR at line 1: ORA-00917: missingcomma SQL> insertintostud1 values('1','pooja'); 1 rowcreated. SQL> insertintostud1 values('2','riya'); 1 rowcreated. SQL> insertintostud1 values('2','riya'); 1 rowcreated.
  • 3. SQL> insertintostud1 values(sqname.nextval,'rekha'); 1 rowcreated. SQL> selectc*formstud1; SP2-0734: unknowncommandbeginning"selectc*f..." - restof line ignored. SQL> select*formstud1; select*formstud1 * ERROR at line 1: ORA-00923: FROM keywordnotfoundwhere expected SQL> select*fromstud1; S_ID S_NAME ---------- --------------------- 1 pooja 2 riya 2 riya 1 rekha SQL> insertintostud1 values(sqname.nextval,'radhika'); 1 rowcreated. SQL> select*fromstud1;
  • 4. S_ID S_NAME ---------- --------------------- 1 pooja 2 riya 2 riya 1 rekha 2 radhika SQL> create table student1(s_idnumber(4),s_name varchar2(21),addressvarchar2( 21),s_contactN number(7)); create table student1(s_idnumber(4),s_name varchar2(21),addressvarchar2(21),s _contactN number(7)) * ERROR at line 1: ORA-00955: name is alreadyusedbyan existingobject SQL> create table studentmca(s_idnumber(4),s_name varchar2(21),addressvarchar 2(21),s_contactN number(7)); Table created. SQL> desc studentmca; Name Null? Type ----------------------------------------- -------- ---------------------------- S_ID NUMBER(4) S_NAME VARCHAR2(21) ADDRESS VARCHAR2(21)
  • 5. S_CONTACTN NUMBER(7) SQL> create table studentmca(s_idnumber(4),p1number(4),p2number(4),p3number (4)); create table studentmca(s_idnumber(4),p1number(4),p2number(4),p3number(4)) * ERROR at line 1: ORA-00955: name is alreadyusedbyan existingobject SQL> create table resultmca(s_idnumber(4),p1number(4),p2number(4),p3number( 4)); Table created. SQL> desc resultmca; Name Null? Type ----------------------------------------- -------- ---------------------------- S_ID NUMBER(4) P1 NUMBER(4) P2 NUMBER(4) P3 NUMBER(4) SQL> desc studentmca; Name Null? Type ----------------------------------------- -------- ---------------------------- S_ID NUMBER(4)
  • 6. S_NAME VARCHAR2(21) ADDRESS VARCHAR2(21) S_CONTACTN NUMBER(7) SQL> inserttable studentmcavalues('1','pooja','kurji','7654303'); inserttable studentmcavalues('1','pooja','kurji','7654303') * ERROR at line 1: ORA-00925: missingINTOkeyword SQL> insertintostudentmcavalues('1','pooja','kurji','7654303'); 1 rowcreated. SQL> insertintostudentmcavalues('2','pushpaq','patna','7624303'); 1 rowcreated. SQL> insertintostudentmcavalues('3','ravi','patna','6624303'); 1 rowcreated. SQL> insertintostudentmcavalues('4','raja','patna','6634303'); 1 rowcreated. SQL> insertintostudentmcavalues('5','raj','delhi','6637303');
  • 7. 1 rowcreated. SQL> desc resultmca; Name Null? Type ----------------------------------------- -------- ---------------------------- S_ID NUMBER(4) P1 NUMBER(4) P2 NUMBER(4) P3 NUMBER(4) SQL> insertintoresultmcavalues('1','45','65','76'); 1 rowcreated. SQL> insertintoresultmcavalues('2','47','64','76'); 1 rowcreated. SQL> insertintoresultmcavalues('3','47','65','78'); 1 rowcreated. SQL> insertintoresultmcavalues('4','46','68','78'); 1 rowcreated. SQL> insertintoresultmcavalues('5','46','69','78');
  • 8. 1 rowcreated. SQL> select*from resultmca; S_ID P1 P2 P3 ---------- -------------------- ---------- 1 45 65 76 2 47 64 76 3 47 65 78 4 46 68 78 5 46 69 78 SQL> select* from'p1' where s_idinwhere p1>60; select* from'p1' where s_idinwhere p1>60 * ERROR at line 1: ORA-00903: invalidtable name SQL> select* from studentmcawhere s_idin(selectidfromresultmcawhere p1>=6 0); select* fromstudentmcawhere s_idin(selectidfromresultmcawhere p1>=60) * ERROR at line 1: ORA-00904: "ID": invalididentifier SQL> select* from studentmcawhere s_idin(selects_idfromresultmcawhere p1> =60);
  • 9. no rowsselected SQL> select* from studentmcawhere s_idin(selects_idfromresultmcawhere p3> =60); S_ID S_NAME ADDRESS S_CONTACTN ---------- --------------------- --------------------- ---------- 1 pooja kurji 7654303 2 pushpaq patna 7624303 3 ravi patna 6624303 4 raja patna 6634303 5 raj delhi 6637303 SQL>