Join query, PL-SQL Programming

Assignment Help:

Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product

Query:

SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRANCH, C.COMPANY FROM EMPLOYEE1 E JOIN STAFF S ON E.EMP_ID=S.EMP_ID JOIN CONTRACT C ON C.EMP_ID=S.EMP_ID WHERE ROWNUM<6;

Select distinct rows using joins on 3 tables without the use of a Cartesian product.

Query:

SELECT DISTINCT E.LAST_NAME,E.FIRST_NAME,S.BUILDING,S.BRANCH,C.COMPANY FROM EMPLOYEE1 E JOIN STAFF S ON E.EMP_ID=S.EMP_ID JOIN CONTRACT C ON C.EMP_ID=S.EMP_ID;

 


Related Discussions:- Join query

Using raise_application_error - user-defined exceptions, Using raise_applic...

Using raise_application_error The Package DBMS_STANDARD that is supplied with Oracle gives language facilities that help your application to interact with Oracle. For illustra

Mixed notation, Mixed Notation The fourth procedure call shows that yo...

Mixed Notation The fourth procedure call shows that you can mix the positional and named notation. In this situation, the first parameter uses the positional notation, & the s

Variables and constants in pl/sql, V ariables and Constants in PL/SQL ...

V ariables and Constants in PL/SQL The PL/SQL permits you to declare constants and variables, and then use them in SQL and procedural statements anywhere in the expression. Th

Keyword, what is the use of declare keyword

what is the use of declare keyword

Write a stored procedure, a. Create a table odetails_new. It has all the a...

a. Create a table odetails_new. It has all the attributes of odetails and an additional column called cost, whose values are the product of the quantity and price of the part bein

Loop statements, LOOP Statements The LOOP statements execute a series o...

LOOP Statements The LOOP statements execute a series of statements at multiple times. The loops enclose the series of statements that is to be repeated. The PL/SQL provides typ

Controlling autonomous transactions, Controlling Autonomous Transactions ...

Controlling Autonomous Transactions The first SQL statement in an autonomous routine starts a transaction. Whenever one transaction ends, the next SQL statement starts the oth

Renaming columns - sql, Renaming Columns - SQL SQL has no direct count...

Renaming Columns - SQL SQL has no direct counterpart of RENAME. To derive the table on the right in Figure 4.4 from the table on the left, Tutorial D has IS_CALLED RENAME ( St

Union and or - sql, UNION and OR - SQL SQL supports UNION explicitly b...

UNION and OR - SQL SQL supports UNION explicitly but differently from the way it supports JOIN explicitly. As we have seen, JOIN is used exclusively within the FROM clause, su

Table comparison - sql, Table Comparison - SQL The following definitio...

Table Comparison - SQL The following definitions for relation comparisons: Let r1 and r2 be relations having the same heading. Then: r1 ⊆ r2 is true if every tuple of r1

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd