JOIN another Question

Hi guys

This is a matter of JOINING the paper example oracle practice. In the sales table, prod_id is the foreign key referencing prod_id in the products table. List each product id and the number of times wherever it was sold. Evaluate the following query.

SQL > SELECT p.prod_id, count (s.prod_id)

PRODUCT p _ sale s

ON p.prod_id = s.prod_id

GROUP BY p.prod_id;

Including two JOIN options from below, can be used in the test to white in the query above to get the desired output? (Choose two)

A. JOIN

B. FULL OUTER JOIN

C. LEFT OUTER JOIN

D. RIGHT OUTER JOIN

/ / DESCsales
NameNull valueType

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

PROD_IDNUMBER (3) NOT NULL
CUST_IDNUMBER 4 NOT NULL
TIME_IDDATE
QTY_SOLDNUMBER (10.2)

SELECT * FROM sales;

prod_id
cust_id
TIME_ID

qty_sold
6016101JANUARY 3, 1531011101JANUARY 1, 1511012101null21014101JANUARY 3, 153

201

1201JANUARY 1, 15120122012 JANUARY 15null3011301JANUARY 1, 151

301

23012 JANUARY 1523013301JANUARY 3, 15330143014 JANUARY 15430153015 JANUARY 155

401

1401JANUARY 1, 15170 s1501JANUARY 1, 15170 s2501nullnull70 s3501JANUARY 3, 15370 s45014 JANUARY 154

/ / DESCproducts
NameNull valueType

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

PROD_IDNUMBER (3) NOT NULL
PROD_NAMEVARCHAR2 (30)
PROD_LIST_PRICENUMBER (8.2)

SELECT * from products;

prod_id

PROD_NAME prod_list_price 101Biscuit10201Cream50301Powder20401null15501Towelnull601nullnull

Although the answers give the same result, in my view, the answers should be A and b. The correct answer is B and C. Use logic to say that C is also the right answer? Any advice?

Because you might have products that have not been sold. You need a left outer join at least, and outer join complete which includes also

Tags: Database

Similar Questions

  • Yes, another question regarding the freezing of Safari - EtreCheck report included

    Yes, another question regarding the freezing of Safari.

    From a little over a month (I think), Safari started freezing regularly whenever I want to open new tabs or switch between tabs. I found myself to leave the program several times per day / hour. I can't identify any specific common cause (other than my MacBook being old) or any new software or updates that might have initiated the question. At first I thought he might have many tabs, I tried to open, but recently it happens even with only a few tabs open.

    I worked through the steps I found in this forum and others: empty the cache, start in safe mode, etc nothing works.

    Based on the previous suggestions, I have downloaded and run EntreReport which I included below. The note and maybe just a distraction, but EntreReport has crashed three times tonight, before he was able to produce the sub report. I ran the report after restarting my system with no other programs running.

    Suggestions are welcome at this stage because I want to start using Chrome or Firefox because I like the transfer procedure between my devices.

    Thank you in advance.

    Ben

    -----------

    EtreCheck version: 2.9.11 (264)

    Report generated 2016-04-28 22:48:58

    Download EtreCheck from https://etrecheck.com

    Time 05:45

    Performance: Below average

    Click the [Support] links to help with non-Apple products.

    Click [details] for more information on this line.

    Click on the link [check files] help with unknown files.

    Problem: Apps are broken

    Description:

    Safari freeze when opening new tabs / switching between the tabs.

    Hardware Information:

    MacBook Pro (15-inch, mid 2009)

    [Data sheet] - [User Guide] - [warranty & Service]

    MacBook Pro - model: MacBookPro5, 3

    1 2.66 GHz Intel Core 2 Duo CPU: 2 strands

    4 GB of RAM expandable - [Instructions]

    BANK 0/DIMM0

    OK 2 GB DDR3 1067 MHz

    BANK 1/DIMM0

    OK 2 GB DDR3 1067 MHz

    Bluetooth: Old - transfer/Airdrop2 not supported

    Wireless: en1: 802.11 a/b/g/n

    Battery: Health = battery check - Cycle count = 389

    Video information:

    NVIDIA GeForce 9400M - VRAM: 256 MB

    Color LCD 1440 x 900

    NVIDIA GeForce 9600M GT - VRAM: 256 MB

    Software:

    OS X El Capitan 10.11.4 (15E65) - since startup time: less than an hour

    Disc information:

    FUJITSU MJA2320BH FFS G1 disk0: (320,07 GB) (rotation)

    EFI (disk0s1) < not mounted >: 210 MB

    Macintosh HD (disk0s2) /: 319,21 go-go (54,93 free)

    Recovery HD (disk0s3) < not mounted > [recovery]: 650 MB

    HL-DT-ST DVD - RW GS23N)

    USB information:

    Built-in ISight from Apple Inc..

    Card reader Apple

    Apple Inc. BRCM2046 hub.

    Apple Inc. Bluetooth USB host controller.

    Apple Inc. Apple keyboard / Trackpad

    Computer, Inc. Apple IR receiver.

    Guardian:

    Mac App Store and identified developers

    Unknown files:

    ~/Library/LaunchAgents/com. GoodShop.updater.plist

    ~/Library/application support/GoodShop/updater

    A unknown file found. [Check files]

    Kernel extensions:

    / Library/Application Support/Symantec/virus

    [no charge] com.symantec.kext.SymAPComm (11.1.2f17 - 2015-05-23) [Support]

    / Library/Extensions

    [no charge] expressvpn.tap (20150118 - 2016-04-12) [Support]

    [loading] expressvpn.tun (20150118 - 2016-04-12) [Support]

    / System/Library/Extensions

    [no charge] com.DYMO.usbprinterclassdriver.kext (1.1 - SDK 10.9-2016-04-12) [Support]

    com.Silex.driver.sxuptp [no charge] (1.5.1 - 2016-04-12) [Support]

    com.symantec.kext.internetSecurity [no charge] (1.3.2 - 2016-04-12) [Support]

    com.Symantec.kext.IPS [no charge] (3.2 - 2016-04-12) [Support]

    Startup items:

    CMA: path: / Library/StartupItems/cma

    RosettaStoneLtdDaemon: Path: / Library/StartupItems/RosettaStoneLtdDaemon

    Startup items are obsolete in OS X Yosemite

    Launch system officers:

    [loaded] 8 tasks Apple

    [loading] 165 tasks Apple

    [operation] 65 tasks Apple

    Launch system demons:

    [loaded] 45 tasks Apple

    [loading] 161 tasks Apple

    [operation] 83 tasks Apple

    Launch officers:

    [no charge] com.adobe.AAM.Updater - 1.0.plist (2016-04-28) [Support]

    [failure] com.adobe.ARMDCHelper.cc24aef4a1b90ed56a... plist (2015-10-31) [Support]

    [operation] com.epson.Epson_Low_Ink_Reminder.launcher.plist (2015-01-19) [Support]

    [loading] com.epson.esua.launcher.plist (2015-06-29) [Support]

    [operation] com.epson.eventmanager.agent.plist (2014-09-21) [Support]

    [loading] com.google.keystone.agent.plist (2016-03-01) [Support]

    [operation] com.mcafee.menulet.plist (2016-03-23) [Support]

    [operation] com.mcafee.reporter.plist (2016-03-23) [Support]

    [loading] com.oracle.java.Java - Updater.plist (2013-11-14) [Support]

    [operation] com.symantec.uiagent.application.plist (2010-11-16) [Support]

    [operation] com.trusteer.rapport.rapportd.plist (2016-03-19) [Support]

    Launch demons:

    [loading] com.adobe.ARMDC.Communicator.plist (2015-10-31) [Support]

    [loading] com.adobe.ARMDC.SMJobBlessHelper.plist (2015-10-31) [Support]

    [loading] com.adobe.fpsaud.plist (2016-04-15) [Support]

    com.DYMO.pnpd.plist [no charge] (2014-10-16) [Support]

    [loading] com.expressvpn.tap.plist (2016-01-27) [Support]

    [loading] com.expressvpn.tun.plist (2016-01-27) [Support]

    [loading] com.google.keystone.daemon.plist (2016-03-01) [Support]

    [loading] com.macpaw.CleanMyMac3.Agent.plist (2016-04-18) [Support]

    [operation] com.mcafee.cspd.plist (2015-05-08) [Support]

    com.mcafee.ssm.ScanFactory.plist [no charge] (2016-03-16) [Support]

    com.mcafee.ssm.ScanManager.plist [no charge] (2016-03-16) [Support]

    [operation] com.mcafee.virusscan.fmpd.plist (2016-03-22) [Support]

    [loading] com.microsoft.office.licensing.helper.plist (2010-08-25) [Support]

    [loading] com.oracle.java.Helper - Tool.plist (2013-11-14) [Support]

    [loading] com.symantec.MissedTasks.plist (2009-11-10) [Support]

    [loading] com.symantec.Sched501 - 1.plist (2014-08-27) [Support]

    [loading] com.symantec.Sched501 - 4.plist (2015-01-08) [Support]

    [loading] com.symantec.Sched501 - 5.plist (2015-01-08) [Support]

    [loading] com.symantec.avscandaemon.plist (2009-10-10) [Support]

    [operation] com.symantec.diskMountNotify.plist (2009-09-14) [Support]

    [loading] com.symantec.navapd.plist (2009-09-14) [Support]

    [loading] com.symantec.navapdaemonsl.plist (2009-11-14) [Support]

    [operation] com.symantec.sharedsettings.plist (2009-07-22) [Support]

    [operation] com.symantec.symSchedDaemon.plist (2009-11-10) [Support]

    [operation] com.symantec.symdaemon.plist (2009-03-27) [Support]

    [operation] com.trusteer.rooks.rooksd.plist (2016-03-19) [Support]

    User launch officers:

    com [running]. GoodShop.updater.plist (2013-09-24) [Support]

    [loading] com.adobe.AAM.Updater - 1.0.plist (2015-10-25) [Support]

    [failure] com.facebook.videochat. [entrenched passage] .plist (2014-08-09) [Support]

    [loading] com.macpaw.CleanMyMac3.Scheduler.plist (2016-04-25) [Support]

    Items in user login:

    iTunesHelper Application (/ Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)

    Application of Google Reader (Google Drive.app/Applications /)

    Dropbox application (/ Applications/Dropbox.app)

    ExpressVPN application (/ Applications/ExpressVPN.app)

    CleanMyMac 3 Menu Application (/ Applications/CleanMyMac 4.app/Contents/MacOS/CleanMyMac 3 Menu.app)

    Other applications:

    [ongoing] com.DYMO.pnpd

    [ongoing] com.getdropbox.dropbox.83552

    [ongoing] com.google.GoogleDrive.81632

    [ongoing] com.macpaw.CleanMyMac3.Menu.80672

    [ongoing] com.mcafee.ssm.ScanManager

    [ongoing] com.mcafee.virusscan.ssm.ScanFactory

    [loading] 420 tasks Apple

    [operation] 193 tasks Apple

    Plug-ins Internet:

    o1dbrowserplugin: 5.41.3.0 - 10.8 SDK (2015-12-16) [Support]

    Default browser: 601 - SDK 10.11 (2016-04-18)

    Flip4Mac WMV Plugin: 2.4.4.2 (2012-12-25) [Support]

    DYMO Safari Addin: Unknown - SDK 10.9 (2014-10-26) [Support]

    AdobePDFViewerNPAPI: 15.010.20060 - SDK 10.8 (2016-03-11) [Support]

    FlashPlayer - 10.6: 21.0.0.226 - SDK 10.6 (2016-04-25) [Support]

    Silverlight: 5.1.30514.0 - SDK 10.6 (2015-09-16) [Support]

    QuickTime Plugin: 7.7.3 (2016-04-12)

    Flash Player: 21.0.0.226 - SDK 10.6 (2016-04-25) [Support]

    googletalkbrowserplugin: 5.41.3.0 - 10.8 SDK (2015-12-11) [Support]

    iPhotoPhotocast: 7.0 (2010-11-15)

    AdobePDFViewer: 15.010.20060 - SDK 10.8 (2016-03-11) [Support]

    SharePointBrowserPlugin: 14.3.0 - SDK 10.6 (2013-02-09) [Support]

    SiteAdvisor: 2.0 - 10.1 SDK (2015-03-30) [Support]

    JavaAppletPlugin: Java 8 updated 77 03 (2016-04-18) check the version of build

    Safari extensions:

    AdBlock - BetaFish, Inc. - https://getadblock.com (2016-03-30)

    Add to wishlist Amazon - Amazon.com - http://www.amazon.com/wishlist?ref=cm_wl_saf_ext (2011-07-09)

    GoodShop - GOODSEARCH LLC - http://www.GoodSearch.com (2013-09-24)

    SiteAdvisor - McAfee - http://www.siteadvisor.com (2015-09-28)

    PIN button - Pinterest, Inc. - http://www.pinterest.com/ (2015-07-03)

    3rd party preference panes:

    Flash Player (2016-04-15) [Support]

    Flip4Mac WMV (2012-05-15) [Support]

    Growl (2015-09-16) [Support]

    Java (2016-04-18) [Support]

    Norton\nQuickMenu (2010-11-16) [Support]

    Trusteer Endpoint Protection (2016-04-18) [Support]

    Time Machine:

    Time Machine not configured!

    Top of page process CPU:

    5% WindowServer

    1% kernel_task

    0% fontd

    0% SymDaemon

    Top of page process of memory:

    445 MB kernel_task

    Mdworker (18) 430 MB

    164 MB Google Reader

    Dropbox 123 MB

    VShieldScanner (4) 66 MB

    Virtual memory information:

    106 MB free RAM

    4.15 GB used RAM (770 MB cache)

    6 MB used Swap

    Diagnostic information:

    April 28, 2016, 22:42:12 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-224212_[redacted].crash

    com.etresoft.EtreCheck - /Applications/EtreCheck.app/Contents/MacOS/EtreCheck

    28 April 2016, 22:21:42 self-test - spent

    April 28, 2016, 19:49:12 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-194912_[redacted].crash

    April 28, 2016, 19:47:10 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-194710_[redacted].crash

    April 28, 2016, 19:38:58 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-28-193858_[redacted].crash

    April 28, 2016, 19:04:58 ~/Library/Logs/DiagnosticReports/rapportd_2016-04-28-190458_[redacted].crash

    /Library/rapport/*/rapportd.app/Contents/MacOS/rapportd

    April 28, 2016, 06:06:59 /Library/Logs/DiagnosticReports/Safari_2016-04-28-060659_[redacted].hang

    /Applications/Safari.app/Contents/MacOS/Safari

    April 28, 2016, 12:48:04 AM /Library/Logs/DiagnosticReports/SubmitDiagInfo_2016-04-28-004804_[redacted].cpu _resource.diag [details]

    / System/Library/CoreServices/SubmitDiagInfo

    April 27, 2016, 22:01:10 /Library/Logs/DiagnosticReports/Safari_2016-04-27-220110_[redacted].hang

    April 27, 2016, 21:57:37 /Library/Logs/DiagnosticReports/Safari_2016-04-27-215737_[redacted].hang

    April 27, 2016, 19:05:50 ~/Library/Logs/DiagnosticReports/EtreCheck_2016-04-27-190550_[redacted].crash

    April 27, 2016, 06:57:28 ~/Library/Logs/DiagnosticReports/Airmail 2_2016-04-27-065728_ .crash [deleted]

    / Applications/Airmail 2.app/Contents/MacOS/Airmail 2

    26 April 2016, 19:48:11 /Library/Logs/DiagnosticReports/Safari_2016-04-26-194811_[redacted].hang

    Remove all apps viruses you have

    Symantec, McAfee, Norton...

    CleanMyMac3

  • In my XP box, I installed 2 video card that has an output of 2 x 2. So now, I have 4 monitors with my single xp box. I want to join another 2 monitors to him. How can I do? Is it possible to attach?

    In my XP box, I installed 2 video card that has an output of 2 x 2. So now, I have 4 monitors with my single xp box. I want to join another 2 monitors to him. How can I do? Is it possible to attach?

    I want to join 6 screens with a single CPU.

    Hi DebBiswas,

    You can attach as much monitor you need, but it depends on the material if it supports or plug another video on the computer card.

    If you use SLI / Crossfire, the system must support more than 2 cards.

  • Another Question... Pasted the first album... but does not work properly

    Hello-

    Another question - I stuck my first file (wpa without loss) from the album on my rocket and when I go to him, he travels only (so 1,2,3, etc. and then it again.)  The songs look like they have any length, if that makes sense.  The bottom bar is from 0:00 0:00.  The strange thing is the player will play all music pre-loaded there, and when I tried to copy a song the player on the computer off, he played.  It is therefore not the file of the song itself I guess.

    What I've done wrong? And how to fix it?

    Thank you very much!!  This forum is very useful for a beginner!

    WMA Lossless is not a supported audio format. Which means that it won't work. You will need to re-Ripper in plain ' ol .wma, .mp3, .ogg or .flac format.

  • Hi ya'll! I'm still learning how to navigate my way with Lightroom. (Last time I wrote, I got a few responses that work.) Thank!) Now, I have another question. When I try to copy photos to my external hard drive to a CD/DVD, no matter if the make

    Hi ya'll! I'm still learning how to navigate my way with Lightroom. (Last time I wrote, I got a few responses that work.) Thank!) Now, I have another question. When I try to copy photos to my external hard drive to a CD/DVD, no matter if do leave LR or my car, I get the message; "Disc burning is not supported by LR on this computer." I've tried everything I can think of, so, I thought I'd see if anyone can find out if there is something I can do. Or could it be that my computer just can't handle it? Help! So frustrating!  I have a Lenovo PC, I don't know if that makes a difference. Any ideas? Thanks a lot for your help!

    You burned discs with other programs using this computer? Are you sure that you have a drive that will burn the disks?

  • Another question about Dates

    Hi, I have another question regarding the use of the field date in Adobe Designer 8.  I have the updated domain in place so that the person can enter the date, lets say, 12/12/11 and it will convert to December 12, 2011, or, the user can click on the calendar that is attached to the date field and make a date selection.  My question is this.  Is there a way that can not only the calendar go to any date by selecting < or >, but can also go to an exercise < < or > >?  We have contracts that extend from 2 to 3 years and want this option to be available.

    Thanks for any help you can provide.

    Here is how I currently have my date fields in place.

    In the field section:

    View model: MMMM D, YYYY

    Edit pattern: M-D-AA

    Section of the value:

    MMMM D, YYYY

    Date must be entered as per example, 12 January 2012

    Liaison section:

    MMMM D, YYYY

    The calendar widget allows you to select other years.

    When you open the calendar, click on the name of the month, the calendar will show you every month of the current year.

    When you then click on the year, it shows you all the years of the current decade.

  • Another question of novice!

    Hi guys...

    I had this posted in another question I raised yesterday... so thought that I should probably get a question by discussion

    A year after double view and month appear on the structure folders after you import the photo

    See things like

    Folder Image count

    10 2009

    2009 480 p

    If I import files with the correct creation date year etc... Why LR would create two folders with the same name...

    See you soon

    Steve

    Hi I think I've sorted it... Folder locations are the same as in

    C:\Documents and settings\stemcg\my Documents\My pictures\

    I looked at the link at the top... when I right click on the files and selecetd add a parent folder that it changed the view of annual records being next to each other for example...

    5 2010

    2010 5000

    4 2011

    2011 4096

    It separated like this

    upper part

    1996

    2000

    ....

    2009

    2010 5000

    2011 4096

    My Documents

    My photos

    2009

    ......

    5 2010

    4 2011

    I then right click on the folder with the least number of photos in there for example

    My perso\Mon pictures\2010 I selected update folder location.

    I pointed out the Selection tool in the same folder that is my perso\Mon pictures\2010. Then, he gave me a prompt to merge the files... It merged then deleted the My Pictures folder and added photos in the folder above... it looks like now

    upper part

    1996

    2000

    ....

    2009

    2010 5005

    2011 4100

    My Documents

    My photos

    2009

    ......

    The folders listed under my photos with the count in the records of the year preceding has increased in quantity... IE 2010 went from 5 000 to 5 005 photos...

    result!

    Thanks for the pointers guys...

    (one day I'll have the shot of LR!)

  • An another Question of license Windows

    I purchased a copy of Windows 7 retail and installed on a laptop computer to upgrade this laptop Windows XP.

    Unfortunately, this laptop was stolen.

    I still have the CD with Windows 7, however, and want to use it to upgrade another computer laptop Win XP.

    Question is this.

    Doesn't the person who stole my laptop stolen also my Win 7 license rights or the fact that he (or she) has stolen software makes him an illegal user of license and my rights to the license to stay with me?

    If you have proof of purchase you can get a replacement product key.
    How to replace Microsoft software or hardware, order service packs and replace product manuals
    http://support.Microsoft.com/kb/326246

    You can also try Windows Genuine Advantage Support (scroll down to find your country)
    http://customercarecontacts.com/contact-Microsoft-support-phone-of-Microsoft-Corporation/
    US phone numbers: Windows 7: 1-866-530-6364
    Windows Vista: 1-866-530-6599
    Windows XP: 1-866-530-6599
    Microsoft Office: 1-866-530-6599
    All other products: 1-866-530-6599

    J W Stuart: http://www.pagestart.com

  • Another Question regarding the IPC in the BB platform (secure process for RuntimeStore)

    In my scenario,.

    Process one will constantly be voicemails from somewhere and put it in a table in a RuntimeStore, named _store.

    B process, there is a thread T will waitFor the ID of the table in the _store. If succeeds, then copy to another location, i.e.,.

    persisting an object and then eaten after this, the thread will remove the ID of the table in the _store.

    I wonder if it is safe for both processes simultaneously access the _store.

    Wrote in the store. B is read and write to the store.

    If someone could help?  Very well appreciated.

    I am a bear with very little brain and can never remember the right way of doing things.  I'm sure that someone will take the holes in what follows and suggest the best ways and it would be fantastic.

    I think there are two issues here:

    (a) simultaneous access

    (b) persistence

    (a) the simultaneous access to an object in the persistent store are no different from any object, they are located in PersistentStore, RuntimeStore or RAM.

    Thus, for example, let's say we have a vector in PersistentStore, we use just like a queue to a single server (then only add to the tail and remove the head), with a separate 'lock' in RuntimeStore object.  Synchronize us on the lock object before we add an element, or remove an item, our access is perfectly safe

    (b) persistence

    Yes I agree, this aspect is not clear.  I always thought I want to commit an object placed partially updated, so in this example, would make the validation in the context of add or remove the treatment.

    Of course, things become a little more complicated if you start to talk about data updated in the queue, but I do not think that these problems are related to PersistentStore as a result, I think that these are issues of a general nature and there is probably many places on the web where are discussed different mechanisms to make sure that it works well.

    A few other points:

    (1) I understand that the treatment of validation is "atomic" on the BlackBerry and the "wound", so if you make an object you will persist all changes to this object. Usually, I maintain a collection that is associated with an Application for validation, points specific in the treatment of requests to ensure that the data associated with an application conform to the battery be fired immediately after a commit.

    (2) you can see updates of persistent objects, even if they are not posted.  These changes will be lost if they are not posted. So if you have a line like the one above, and two Clients add entries in the queue without committing, the server see the two entries in the queue until the battery is removed.  When the server restarts, the two went.

    Does that answer the question?

  • Application of self-join interview question?

    Hi guys!

    I asked this question in an interview for the job as a developer of database.

    I received a select based on symbol table and asked to drow the printout and then explain works step by step this statement.

    Here are the instructions create & insert

    /**********************************************/

    create table tbl (number x, y varchar2 (50));

    INSERT INTO tbl (x, y) VALUES ('A', 0);

    INSERT INTO tbl (x, y) VALUES (1, 'B');

    COMMIT;

    /***********************************************/

    Below the query (select statement)

    SELECT tbl1.x

    OF tbl tbl1 tbl2 tbl

    WHERE tbl1.x = 0 OR tbl2.x = 1;

    Please explain me the output and work step by step this statement...

    Thank you...

    Hello usman_noshahi,

    If you omit the where the query clause will result as below

    SELECT tbl1.x, tbl2.x

    OF tbl tbl1 tbl2 tbl

    /

    X          X

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

    0          0

    0          1

    1          0

    1          1

    Request granted will result as below based on where condition on each line on top 4 rows...  Or Condition will be returs real if one condition is met with the data set.

    SQL > SELECT tbl1.x, tbl2.x

    2 tbl tbl1 tbl2 tbl

    3. WHERE tbl1.x = 0 tbl2.x = 1 GOLD

    4.

    X          X

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

    0          0

    0          1

    1          1

    SQL >

    You can get the information in a different way as below...

    SQL > explain plan set statement_id = "ORACLEFORUMS" for

    2. SELECT tbl1.x

    3 tbl tbl1 tbl2 tbl

    4 WHERE tbl1.x = 0 OR tbl2.x = 1;

    He explained.

    SQL > select LPad (' ', 2 *(Level-1)). Level | '.' || NVL (position 0). ' ' ||

    Operation 2. ' ' || Options of | ' ' || Object_name | ' ' || Object_type

    3   || ' ' || Decode (id, 0, Statement_Id |) "Cost = ' | Position) | cost

    4   || ' ' || Object_Node "Query Plan.

    plan_table 5

    6 start with id = 0 and statement_id = 'ORACLEFORUMS. '

    7. connect by prior id = parent_id

    8 and statement_id = 'ORAFAQ.

    9   /

    Query plan

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

    1.7 STATEMENT SELECT ORACLEFORUMS cost = 77

    2.1 NESTED LOOPS 7

    3.1 ACCESS FULL TBL TABLE 3 TABLE

    3.2 TABLE ACCESS FULL TBL TABLE 2

    SQL > SELECT *.

    TABLE 2 (DBMS_XPLAN. DISPLAY ('PLAN_TABLE', 'ORACLEFORUMS', 'BASIC'));

    PLAN_TABLE_OUTPUT

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

    Hash value of plan: 1718268327

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

    | ID | Operation | Name |

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

    |   0 | SELECT STATEMENT |      |

    |   1.  NESTED LOOPS |      |

    |   2.   TABLE ACCESS FULL | TBL |

    |   5:   TABLE ACCESS FULL | TBL |

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

    10 selected lines.

    SQL >

    SQL > select LPAD (' ', 2 *(LEVEL-1)). operation 'OPERATION', 'options ',.

    2 DECODE (TO_CHAR (id), '0',' COST = ' |) NVL (to_char (position), n / 'a').

    3 object_name) 'OBJECTNAME', id | » -'|| NVL (parent_id, 0) | » -'||

    4 NVL (position 0), 'ORDER', SUBSTR (optimizer, 1, 6) 'OPT '.

    plan_table 5

    6. start with id = 0

    7 and statement_id = 'ORACLEFORUMS. '

    8 connect by prior id = parent_id

    9 and statement_id = 'ORACLEFORUMS. '

    10.

    OPTIO OBJECTNAME OPT OPERATION ORDER

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

    COST OF THE SELECT = 7 0-0-7 ALL_RO

    NESTED LOOPS                                                                  1-0-1

    TABLE ACCESS FULL TBL 2-1-1

    TABLE 3-1-2 TBL FULL ACCESS

    SQL >

    ID ID-PARENT as follows...

    00

    10

    21

    31

    Here level 1 has 2 childs (2,3)

    Thus the sequential order of enforcement will be 2,3,1.

    For more reference I recommend you read below, of course it's Oracle V8 but it gives more information.

    Good reading!

    Optimization of joins

  • JOIN the question... Join two tables without omitting lines

    I came across a problem that should be an easy fix (I hope), but I'm having a hard time to come up with a solution.

    Basically I have two tables, one with the actual amounts with the budget. I have to write a sql statement select that joins these tables together and includes all of their lines. I was able to join the tables by using JOIN, LEFT JOIN and RIGHT JOIN, but it always fails the lines I need.

    Below, I have examples of my tables (AMOUNT_TABLE and BUDGET_TABLE). For simplicity, I built the examples to show the same values in the first four columns, with the 5th and 6th columns (SUB_ACCOUNT, AMOUNT, BUDGET) as the only values that are different. My actual tables are not quite that simple, but I don't think it was relavent to this issue.

    AMOUNT_TABLE

    FISCAL_YEAR PERIOD ACCT_UNIT ACCOUNT SUB_ACCOUNT AMOUNT

    2013

    111111555555000010020131111115555551000100201311111155555520001002013111111555555300010020131111115555554000100

    BUDGET_TABLE

    FISCAL_YEAR PERIOD ACCT_UNIT ACCOUNT SUB_ACCOUNT BUDGET

    2013

    1111115555553000200201311111155555540002002013111111555555500020020131111115555556000200

    Here's what I hope. Note that SUB_ACCOUNTs 0000, 1000, and 2000 show without budget amounts since there is not a corresponding line in the BUDGET_TABLE. And same for SUB_ACCOUNTs 5000 and 6000, they show budgets with no amount because there is not a corresponding line in the AMOUNT_TABLE.

    (exit)

    FISCAL_YEAR PERIOD ACCT_UNIT ACCOUNT SUB_ACCOUNT AMOUNT BUDGET
    201311111155555500001000
    201311111155555510001000
    201311111155555520001000
    20131111115555553000100200
    20131111115555554000100200
    201311111155555550000200
    201311111155555560000200

    If all goes well, my question is clear. Any help on this would be greatly appreciated. Thanks in advance.

    Use the join ANSI - FULL OUTER JOIN syntax:

    with amount_table like)

    Select fiscal_year 2013, 1 period, 11111 acct_unit, 555555, 0000 sub_account, amount 100 of all the double union

    Select 2013,1,11111,555555,1000,100 from all the double union

    Select 2013,1,11111,555555,2000,100 from all the double union

    Select 2013,1,11111,555555,3000,100 from all the double union

    Select double 2013,1,11111,555555,4000,100

    ),

    budget_table like)

    Select 1 time, 11111 acct_unit, account 555555, sub_account 3000, 2013 fiscal_year, budget of 200 Union double all the

    Select 2013,1,11111,555555,4000,200 from all the double union

    Select 2013,1,11111,555555,5000,200 from all the double union

    Select double 2013,1,11111,555555,6000,200

    )

    Select nvl (a.fiscal_year, b.fiscal_year) fiscal_year,

    period of NVL (a.period, b.period),

    NVL (a.acct_unit, b.acct_unit) acct_unit.

    account of NVL (a.Account, b.Account),

    NVL (a.sub_account, b.sub_account) sub_account.

    Amount NVL(a.amount,0),

    NVL(b.budget,0) budget

    of amount_table one

    full join

    budget_table b

    on)

    a.Fiscal_Year = b.fiscal_year

    and

    a.period = b.period

    and

    a.acct_unit = b.acct_unit

    and

    a.Account = b.account

    and

    a.sub_account = b.sub_account

    )

    /

    FISCAL_YEAR PERIOD ACCT_UNIT ACCOUNT SUB_ACCOUNT AMOUNT BUDGET
    ----------- ---------- ---------- ---------- ----------- ---------- ----------
    2013 1 11111 555555 0 100 0
    2013 1 11111 555555 1000 100 0
    2013 1 11111 555555 2000 100 0
    2013 1 11111 555555 3000 100 200
    2013 1 11111 555555 4000 100 200
    2013 1 11111 555555 6000 0 200
    2013 1 11111 555555 5000 0 200

    7 selected lines.

    SQL >

    SY.

  • Another question about hard drive setup

    Thank you all for the info on PC and installation material.  I have download the first CS4 trial version and it is awesome!  I have one last question? I read the rules for storage and editing platform.

    I noticed in the project settings, as there

    captured video

    Audio captured

    video excerpts

    Audio previews

    And in the preferences

    media database cache

    media cache files

    Correct me if this is incorrect

    Drive a my OS and files in project

    My second drive pagefile and media cache database and media file cache.

    Third disc captured video & audio and video previews and audio previews

    This system uses a combination of DV, AVCHD material.  I would add another hard drive?  I may be using raid 0 for the audio captured video edge.

    No problem. Especially for raid0 configuration, you can easily use the on-board raid functions. No sense getting a controller separated for this card.

  • Another question about dbms_metadata.get_ddl

    Hello

    Recorded in as 'sys as sysdba' I tried to get the DDL for the EMP table in the SCOTT schema. Here is the output I got:
      1* select scott.dbms_metadata.get_ddl('TABLE', 'EMP') from dual
    SQL> /
    select scott.dbms_metadata.get_ddl('TABLE', 'EMP') from dual
           *
    ERROR at line 1:
    ORA-00904: "SCOTT"."DBMS_METADATA"."GET_DDL": invalid identifier
    Remove the reference to SCOTT, we get another error (no surprise):
    ORA-31603: object "EMP" of type TABLE not found in schema "SYS"
    Question: How the ADMINISTRATOR bring the DDL for a table without having to sign in as a user that owns the schema?

    Thank you

    John.

    He must inform the owner of this object when running DBMS_METADATA of SYS.

    If we describe DBMS_METADATA

    FUNCTION GET_DDL RETURNS CLOB
     Argument Name                  Type                    In/Out Default?
     ------------------------------ ----------------------- ------ --------
     OBJECT_TYPE                    VARCHAR2                IN
     NAME                           VARCHAR2                IN
     SCHEMA                         VARCHAR2                IN     DEFAULT
     VERSION                        VARCHAR2                IN     DEFAULT
     MODEL                          VARCHAR2                IN     DEFAULT
     TRANSFORM                      VARCHAR2                IN     DEFAULT
    

    So there must be another SCHEMA parameter when running DBMS_METADATA of SYS.

  • Another question on the appeal of a Web Form to a form of Client-Server

    Thanks to this forum, I was able to get my Client-Server (6i) form to call a Web Form and pass it a parameter. Unfortunately, this code displays the user name and password in the Internet Explorer address bar. Although not critical, I would like to delete the user name and password to be visible. I am able to do this in the Web form code below because it calls JavaScript that will hide the address bar - but the WEB. Function SHOW_DOCUMENT is not available in the form of Client-Server.

    So my question is whether it is possible to convert the code 'Customer Forms Server' below which is called my Web form using similar JavaScript functionality that is present in the 'Web Forms Code' example below? I want the server code to use the javascript functionality because I want to hide the address bar (which currently shows the users Username and Password).


    Code client server Forms (able to use when you call this a form of Client Server Web form):
    CL: = "cmd /c start iexplore.exe" http://9.35.32.205:7777/forms/frmservlet? " pageTitle = trial email Reporting & config = TTMSMENU & form=./forms_test/TrialMailReporting & otherparams = p_prospect = X 110679 & userid =' | the user | » /'|| GET_APPLICATION_PROPERTY (PASSWORD). » @' || : overall. DB_Instance |' » ' ;
    host (cl);

    Web Forms Code (able to use when you call this Web to another Web form form):
    WEB. SHOW_DOCUMENT ("JavaScript: void (window.open ("http://'|| ") ip_port | "/ forms/frmservlet? pageTitle = dropper E/M & config = TTMSMENU & form=./forms_test/TrialMailReporting & userid =' | the user | » /'|| GET_APPLICATION_PROPERTY (PASSWORD). » @' || : overall. (("DB_Instance |'", "", "resizable = Yes, location = no, Toolbar = no, MenuBar = no, Status = no,")); self. Close () ',' _blank');


    Any help would be greatly appreciated!

    Published by: Buechler on April 8, 2009 15:57

    Looks like Forms 6i PL/SQL version does not correctly convert to hex.
    That's what you can do:
    Create a db stored function

    CREATE OR REPLACE FUNCTION to_hex (p_string VARCHAR2)
       RETURN VARCHAR2
    IS
       v_hex   VARCHAR2 (1000);
    BEGIN
       FOR i IN 1 .. LENGTH (p_string)
       LOOP
          v_hex := v_hex|| '%' || LTRIM (TO_CHAR (ASCII (SUBSTR (p_string, i, 1)), 'XX'));
       END LOOP;
       RETURN v_hex;
    END;
    
    cl := 'cmd /c start iexplore.exe "http://9.35.32.205:7777/forms/frmservlet?pageTitle=Trial Mail Reporting&config=TTMSMENU&form=./forms_test/TrialMailReporting&otherparams=p_prospect=X110679&userid='||to_hex(v_conn)||'"';
    
  • How I simply connect to the forum without having to ask another question?

    I have a thread in the forum that I would like to respond to-me do it please

    Through the profile, you get a link that did a search of the forum.

    This is a page of results (with 10 results per page) which is different from the one that will give you the link to my Contributions (20 results per page) and more information.

    If you are connected and then top of page [/questions] you have a sort and filter item that opens a menu drop-down.

    You will find "My Contributions" from the options in the second column (view).

Maybe you are looking for