0% found this document useful (0 votes)
54 views3 pages

Vinay Joins

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)
54 views3 pages

Vinay Joins

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/ 3

SQL*Plus: Release 11.2.0.2.

0 Production on Wed Apr 14 20:38:26 2021

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

SQL> connect
Enter user-name: system
Enter password:
Connected.
SQL> create table student2(roll_no number(3),name varchar(25),address varchar(10)
age number(2));
create table student2(roll_no number(3),name varchar(25),address varchar(10) age
number(2))
*
ERROR at line 1:
ORA-00907: missing right parenthesis

SQL> create table student2(roll_no number(3),name varchar(25),address varchar(10),


age number(2));

Table created.

SQL> create table course(course_id number(2),roll_no number(2));

Table created.

SQL> insert into student2(1,'vinay','vijayawada',20);


insert into student2(1,'vinay','vijayawada',20)
*
ERROR at line 1:
ORA-00928: missing SELECT keyword

SQL> insert into student2 values(1,'vinay','vijayawada',20);

1 row created.

SQL> insert into student2 values(2,'vinod','vijayawada',20);

1 row created.

SQL> insert into student2 values(3,'vindd','delhi',23);

1 row created.

SQL> select * from student2;

ROLL_NO NAME ADDRESS AGE


---------- ------------------------- ---------- ----------
1 vinay vijayawada 20
2 vinod vijayawada 20
3 vindd delhi 23

SQL> insert into course(1,1);


insert into course(1,1)
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
SQL> insert into course values(1,1);

1 row created.

SQL> insert into course values(2,2);

1 row created.

SQL> insert into course values(3,3);

1 row created.

SQL> select * from course;

COURSE_ID ROLL_NO
---------- ----------
1 1
2 2
3 3

SQL> select student2.roll_no,student2.name ,course.course_id,course.roll_no from


student2 inner join course on student2.roll_no=course.roll_no;

ROLL_NO NAME COURSE_ID ROLL_NO


---------- ------------------------- ---------- ----------
1 vinay 1 1
2 vinod 2 2
3 vindd 3 3

SQL> select student2.roll_no,student2.name,student.address,course.course_id from


student2 left join course on student2.roll_no=course.roll_no;
select student2.roll_no,student2.name,student.address,course.course_id from
student2 left join course on student2.roll_no=course.roll_no
*
ERROR at line 1:
ORA-00904: "STUDENT"."ADDRESS": invalid identifier

SQL> select student2.roll_no,student2.name,student2.address,course.course_id from


student2 left join course on student2.roll_no=course.roll_no;

ROLL_NO NAME ADDRESS COURSE_ID


---------- ------------------------- ---------- ----------
1 vinay vijayawada 1
2 vinod vijayawada 2
3 vindd delhi 3

SQL> select student2.name,student2.address,course.course_id from student2 right


join course on sstudent2.roll_no=course.roll_no;
select student2.name,student2.address,course.course_id from student2 right join
course on sstudent2.roll_no=course.roll_no

*
ERROR at line 1:
ORA-00904: "SSTUDENT2"."ROLL_NO": invalid identifier
SQL> select student2.name,student2.address,course.course_id from student2 right
join course on student2.roll_no=course.roll_no;

NAME ADDRESS COURSE_ID


------------------------- ---------- ----------
vinay vijayawada 1
vinod vijayawada 2
vindd delhi 3

SQL> select student2.name,student2.age,course.course_id from course full join


student2 on course.roll_no=student2.roll_no;

NAME AGE COURSE_ID


------------------------- ---------- ----------
vinay 20 1
vinod 20 2
vindd 23 3

SQL>

You might also like