Basic table relationship question

Just getting started working with primary and foriegn key relationships.  I have a main table called fruitPicking and one of the columns is fruitID (a foriegn key linked to a primary key in a table called fruit).  Anyhow for a single row
in the fruitPicking table I need to store more than just one fruitID for a specific day, for example apples and oranges may have been picked that day so for the row in the fruitPicking table I would want to include the foriegn key for both an
apple and orange for the same date (date being another field in the fruitPicking table).  Is it correct to just use two rows in the fruitPicking table with the same date, one row with the foriegn key for apple and the next with the foriegn
key for orange? Thanks.

Hi Svt44cobra66,
We can create a unique constraint by using SQL Server Management Studio or Transact-SQL to ensure no duplicate values are entered in specific columns that do not participate in a primary key. When creating a unique constraint, a corresponding unique index will
be created automatically. Here is a document about how to create unique constraints:
http://technet.microsoft.com/en-us/library/ms190024.aspx.
Reference:
What is the difference between primary, unique and foreign key constraints, and indexes?
Regards,
Heidi Duan
Heidi Duan
TechNet Community Support

Similar Messages

  • Table relationship Purpose

    Hi
    What is the purpose of tables relationship?
    Best...
    Mehran
    Mehran

    Following RSingh's comments.
    Relationships between two tables underpins relational theory and all relational databases are based on this theory.
    Please see the
    link.
    If you are serious about understanding the subject or relational theory the two main authorities are Codd and C J Date. Their books are quite academic and difficult to read as an introduction. However the book; -
    Training Kit (Exam 70-461): Querying Microsoft SQL Server 2012 (Microsoft Press Training Kit) [Paperback]
    does provide a good introduction to relational theory in the early chapters.
    To give you a more practical example answer to your question. You could have a order table containing a customer ID which allows you to
    relate a particular customer which has raised particular orders.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

  • Basic JDBC transactional question

    Hello all,
    I have (what I believe) is a basic transactional JDBC question.
    Here's what I want to do:
    begin transaction
    select a row from a table where (some condition).
    that row may or may not exist.
    if the row exists: update the row
    else if the row does not exist, insert a new row
    end transaction
    I want this entire thing to be atomic .. I don't want the select to complete, then have something else come in there before the update/insert takes place.
    I'm using MySQL .. I seem to remember hearing about some proprietary MySQL command which would do a SELECT + UPDATE atomically .. which would be fine, but I can't find it.
    Wrapping this with a row-level lock would be fine too .. I'm just not sure how to do that in JDBC.
    Thanks!
    -d

    By thte way, and not that it helps the orignal poster, who's using MySQL, but Oracle has a proprietary MERGE statement that does "insert or update" in one go. For example:
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*0.1)
         WHERE (S.salary <= 8000);

  • How to find the table relationship between BSEG-BELNR with CE11000 table.

    Hi,
    Please help me to find out the table relationship between BSEG with CE11000 table.
    I have BSEG-BELNR value.
    Thanks in Advance
    Shankar

    Hello,
    BAsically the relationship can be foundon the basis of cost centre it will be good if you paste the structure ce11000.
    I have worked on it and as far i as i can recall it contain value fields right...like vv205,vv305 etc?
    Provide me more details.
    Are you preparing some reconcillation report for costing based COPA or Account based COPA..?
    Hopefully will help you out..
    Regards,
    Nabheet

  • Details on SAP Warehouse management? Basics, tables and transactions?

    Hi
    Soon i will be working on a SAP WM module as a abaper. I have worked on SD and MM modules but not worked on WM module.
    Can anybody send me the links or guide me where i can find some basic information about SAP warehouse management?
    I am looking for the following.
    1). the complete process cycle in WM
    2). basic tables used in WM
    3). Basic transactions used in WM
    thanks in advance.

    check
    https://forums.sdn.sap.com/click.jspa?searchID=12324135&messageID=4538695
    https://forums.sdn.sap.com/click.jspa?searchID=12324135&messageID=2829284
    Re: WM Flow
    Regards
    Kiran Sure

  • How to use column with linkToItem in the Basic Table view style mode

    Hi
    I have already changed a normal column that I made to a column with linkToItem as follows.
    <viewfields>
    <FieldRef Name="MyColumn" linkToItem="TRUE">
    and it worked.
    But this column works only at the default view style mode in my case.
    Does anyone know how to use linkedToItem column in the Basic Table mode?
    hope someone help me.
    thanks

    Hi,
    According to your description, my understanding is that you want to use linkToItem in the Basic Table view style.
    Per my test, in the Default style view, we need to use linkToItem=”TRUE”. However, in Basic Table style view, we need to use LinkToItem=”TRUE” instead.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Table relationship in PDF Format

    hi all
    can anyone send me all SAP Table relationships in PDF Format.
    thanks in Advance.

    Check the below URL:
    http://www.erpgenie.com/sap/abap/tables.htm
    Thanks

  • Required CRM Tables & Relationship Diagram

    Hi All,
    I need CRM Tables & Relationship Diagram. Anybody there to help me to get this. Its urgent.
    Thanks in advance.
    my mail ID: [email protected]
    Thanx & Regards,
    Santosh

    Hi Sai, Can anybody send me CRM tables mapping to [email protected] Thanks in advance.
    Andy Nguyen

  • DMV to list table relationships in a Power Pivot model ?

    I have used different queries based on DMVs which let you extract data from a Power Pivot model in order to create a design documentation: list of tables, columns, calculated columns formulas, measures ...etc. 
    Yet, I have not found the way to extract a list of all tables relationships in the model. Sure enough, I can copy/paste it from the PowerPivot window.
    But would someone have a query that extracts table relationships ?
    Regards,
    Bertrand 

    I do not believe that there is any $system based DMV which returns relationship information.
    You can get this information from an SSAS Tabular instance using a DISCOVER_CSDL_METADATA call, but that returns an XML document with the all the metadata and I don't know of any easy way to call that against a PowerPivot model (unless it's deployed to sharepoint)
    The following is an example query that I ran against a tabular SSAS instance.
    <Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
    <RequestType>DISCOVER_CSDL_METADATA</RequestType>
        <Restrictions>
    <RestrictionList>
    <CATALOG_NAME>Adventure Works Tabular</CATALOG_NAME>
    <PERSPECTIVE_NAME>Model</PERSPECTIVE_NAME>
    <VERSION>1.2</VERSION>
    </RestrictionList>
    </Restrictions>
        <Properties>
    <PropertyList>
    <Catalog>Adventure Works Tabular</Catalog>
    <FORMAT>Tabular</FORMAT>
        </PropertyList>
    </Properties>
    </Discover>
    http://darren.gosbell.com - please mark correct answers

  • It's possible ON UPDATE CASCADE in table relationships?

    Hi, how are you?
    Sorry my weak English, I'm brazilian.
    I like create an "ON UPDATE CASCADE" in my table relationship but find only "ON DELETE CASCADE" in Oracle 9i Database Online Documentation.
    I would like your help.
    Thank you.
    Eduardo A. Reche Lopes
    Team T.I.
    www.coodetec.com.br

    Tom Kyte wrote a package for this:
    UPDATE CASCADE PACKAGE
    Generates needed package and triggers to support update cascade in Oracle without removing or infringing on DECLARITIVE RI.
    This package supports:
    - Tables with multi-part primary keys (primary key(a,c,b))
    - Update cascade to many child tables from one parent
    - Self-referencing integrity such as that found in the SCOTT.EMP table (mgr->empno)
    - Is completely application transparent. The application does not know it is happening
    - Versions 7.0 and above of the database.
    - Tuned and optimized to fully avoid full table scans on all tables (complete with utility to show you un-indexed foreign keys in a schema, Cascading an update to un-indexed foreign keys can be bad).

  • Fact and dimension table relationship?

    hi
    in se38 i executed this program sap_infocube_designs
    i got all cubes and percentage , this is directly fact and dimension table relationship based on this i need to take action is it line item dimension or high cardinality (dimen>20% fact line, dimen>10<20 fact is high cardinality.
    regards
    suneel.

    hi,
    line item has to be choosen in such a way to control the dim table size for the char that have almost large unique records.
    Line item dim table will not be shown by this program.
    Ramesh

  • Info for table relationship for webcenter interaction database

    Hi,
    Does any one know where I can get information about the table relationship for webcenter database ? I appreciate your help.
    Thanks
    Yxu

    Schema Spy is an amazing tool. I haven't used it for the WebCenter apps yet, but this will map everything out for you, providing the relationships you seek.
    http://schemaspy.sourceforge.net/

  • Require DML and DDL for basic tables

    Hello,
    I want to pursue my oracle certification within 2-3 months. Therefore, I am eager to create basic tables those would provide me holistic idea and basic practices before my real test. Could you provide me basic tables for example, employee table, department table, sales table etc.with DML and DDL details? I do create plethora of DB objects when I build systems for clients; however, additionally, I intend to practice concepts whatever I will acquire after going through oracle books before certification.
    Thanks!

    Here is the sample script i took it from HR & SH Schemas.
    host echo Building Oracle demonstration tables. Please wait.
    set termout off
    DROP TABLE EMP;
    DROP TABLE DEPT;
    DROP TABLE BONUS;
    DROP TABLE SALGRADE;
    DROP TABLE DUMMY;
    DROP TABLE ITEM;
    DROP TABLE PRICE;
    DROP TABLE PRODUCT;
    DROP TABLE ORD;
    DROP TABLE CUSTOMER;
    DROP VIEW SALES;
    DROP SEQUENCE ORDID;
    DROP SEQUENCE CUSTID;
    DROP SEQUENCE PRODID;
    CREATE TABLE DEPT (
    DEPTNO NUMBER(2) NOT NULL,
    DNAME VARCHAR2(14),
    LOC VARCHAR2(13),
    CONSTRAINT DEPT_PRIMARY_KEY PRIMARY KEY (DEPTNO));
    INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YORK');
    INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
    INSERT INTO DEPT VALUES (30,'SALES','CHICAGO');
    INSERT INTO DEPT VALUES (40,'OPERATIONS','BOSTON');
    CREATE TABLE EMP (
    EMPNO NUMBER(4) NOT NULL,
    ENAME VARCHAR2(10),
    JOB VARCHAR2(9),
    MGR NUMBER(4) CONSTRAINT EMP_SELF_KEY REFERENCES EMP (EMPNO),
    HIREDATE DATE,
    SAL NUMBER(7,2),
    COMM NUMBER(7,2),
    DEPTNO NUMBER(2) NOT NULL,
    CONSTRAINT EMP_FOREIGN_KEY FOREIGN KEY (DEPTNO) REFERENCES DEPT (DEPTNO),
    CONSTRAINT EMP_PRIMARY_KEY PRIMARY KEY (EMPNO));
    INSERT INTO EMP VALUES (7839,'KING','PRESIDENT',NULL,'17-NOV-81',5000,NULL,10);
    INSERT INTO EMP VALUES (7698,'BLAKE','MANAGER',7839,'1-MAY-81',2850,NULL,30);
    INSERT INTO EMP VALUES (7782,'CLARK','MANAGER',7839,'9-JUN-81',2450,NULL,10);
    INSERT INTO EMP VALUES (7566,'JONES','MANAGER',7839,'2-APR-81',2975,NULL,20);
    INSERT INTO EMP VALUES (7654,'MARTIN','SALESMAN',7698,'28-SEP-81',1250,1400,30);
    INSERT INTO EMP VALUES (7499,'ALLEN','SALESMAN',7698,'20-FEB-81',1600,300,30);
    INSERT INTO EMP VALUES (7844,'TURNER','SALESMAN',7698,'8-SEP-81',1500,0,30);
    INSERT INTO EMP VALUES (7900,'JAMES','CLERK',7698,'3-DEC-81',950,NULL,30);
    INSERT INTO EMP VALUES (7521,'WARD','SALESMAN',7698,'22-FEB-81',1250,500,30);
    INSERT INTO EMP VALUES (7902,'FORD','ANALYST',7566,'3-DEC-81',3000,NULL,20);
    INSERT INTO EMP VALUES (7369,'SMITH','CLERK',7902,'17-DEC-80',800,NULL,20);
    INSERT INTO EMP VALUES (7788,'SCOTT','ANALYST',7566,'09-DEC-82',3000,NULL,20);
    INSERT INTO EMP VALUES (7876,'ADAMS','CLERK',7788,'12-JAN-83',1100,NULL,20);
    INSERT INTO EMP VALUES (7934,'MILLER','CLERK',7782,'23-JAN-82',1300,NULL,10);
    CREATE TABLE BONUS (
    ENAME VARCHAR2(10),
    JOB CHAR(9),
    SAL NUMBER,
    COMM NUMBER);
    CREATE TABLE SALGRADE (
    GRADE NUMBER,
    LOSAL NUMBER,
    HISAL NUMBER);
    INSERT INTO SALGRADE VALUES (1,700,1200);
    INSERT INTO SALGRADE VALUES (2,1201,1400);
    INSERT INTO SALGRADE VALUES (3,1401,2000);
    INSERT INTO SALGRADE VALUES (4,2001,3000);
    INSERT INTO SALGRADE VALUES (5,3001,9999);
    CREATE TABLE DUMMY (
    DUMMY NUMBER );
    INSERT INTO DUMMY VALUES (0);
    CREATE TABLE CUSTOMER (
    CUSTID NUMBER (6) NOT NULL,
    NAME VARCHAR2(45),
    ADDRESS VARCHAR2(40),
    CITY VARCHAR2(30),
    STATE VARCHAR2(2),
    ZIP VARCHAR2(9),
    AREA NUMBER (3),
    PHONE VARCHAR2(9),
    REPID NUMBER (4) NOT NULL,
    CREDITLIMIT NUMBER (9,2),
    COMMENTS LONG,
    CONSTRAINT CUSTOMER_PRIMARY_KEY PRIMARY KEY (CUSTID),
    CONSTRAINT CUSTID_ZERO CHECK (CUSTID > 0));
    CREATE TABLE ORD (
    ORDID NUMBER (4) NOT NULL,
    ORDERDATE DATE,
    COMMPLAN VARCHAR2(1),
    CUSTID NUMBER (6) NOT NULL,
    SHIPDATE DATE,
    TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK (TOTAL >= 0),
    CONSTRAINT ORD_FOREIGN_KEY FOREIGN KEY (CUSTID) REFERENCES CUSTOMER (CUSTID),
    CONSTRAINT ORD_PRIMARY_KEY PRIMARY KEY (ORDID));
    CREATE TABLE ITEM (
    ORDID NUMBER (4) NOT NULL,
    ITEMID NUMBER (4) NOT NULL,
    PRODID NUMBER (6),
    ACTUALPRICE NUMBER (8,2),
    QTY NUMBER (8),
    ITEMTOT NUMBER (8,2),
    CONSTRAINT ITEM_FOREIGN_KEY FOREIGN KEY (ORDID) REFERENCES ORD (ORDID),
    CONSTRAINT ITEM_PRIMARY_KEY PRIMARY KEY (ORDID,ITEMID));
    CREATE TABLE PRODUCT (
    PRODID NUMBER (6) CONSTRAINT PRODUCT_PRIMARY_KEY PRIMARY KEY,
    DESCRIP VARCHAR2(30));
    CREATE TABLE PRICE (
    PRODID NUMBER (6) NOT NULL,
    STDPRICE NUMBER (8,2),
    MINPRICE NUMBER (8,2),
    STARTDATE DATE,
    ENDDATE DATE);
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('96711', 'CA', '7844', '598-6609',
    'JOCKSPORTS',
    '100', '5000', 'BELMONT', '415', '345 VIEWRIDGE',
    'Very friendly people to work with -- sales rep likes to be called Mike.');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('94061', 'CA', '7521', '368-1223',
    'TKB SPORT SHOP',
    '101', '10000', 'REDWOOD CITY', '415', '490 BOLI RD.',
    'Rep called 5/8 about change in order - contact shipping.');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('95133', 'CA', '7654', '644-3341',
    'VOLLYRITE',
    '102', '7000', 'BURLINGAME', '415', '9722 HAMILTON',
    'Company doing heavy promotion beginning 10/89. Prepare for large orders during
    winter.');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('97544', 'CA', '7521', '677-9312',
    'JUST TENNIS',
    '103', '3000', 'BURLINGAME', '415', 'HILLVIEW MALL',
    'Contact rep about new line of tennis rackets.');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('93301', 'CA', '7499', '996-2323',
    'EVERY MOUNTAIN',
    '104', '10000', 'CUPERTINO', '408', '574 SURRY RD.',
    'Customer with high market share (23%) due to aggressive advertising.');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('91003', 'CA', '7844', '376-9966',
    'K + T SPORTS',
    '105', '5000', 'SANTA CLARA', '408', '3476 EL PASEO',
    'Tends to order large amounts of merchandise at once. Accounting is considering
    raising their credit limit. Usually pays on time.');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('94301', 'CA', '7521', '364-9777',
    'SHAPE UP',
    '106', '6000', 'PALO ALTO', '415', '908 SEQUOIA',
    'Support intensive. Orders small amounts (< 800) of merchandise at a time.');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('93301', 'CA', '7499', '967-4398',
    'WOMENS SPORTS',
    '107', '10000', 'SUNNYVALE', '408', 'VALCO VILLAGE',
    'First sporting goods store geared exclusively towards women. Unusual promotion
    al style and very willing to take chances towards new products!');
    INSERT INTO CUSTOMER (ZIP, STATE, REPID, PHONE, NAME, CUSTID, CREDITLIMIT,
    CITY, AREA, ADDRESS, COMMENTS)
    VALUES ('55649', 'MN', '7844', '566-9123',
    'NORTH WOODS HEALTH AND FITNESS SUPPLY CENTER',
    '108', '8000', 'HIBBING', '612', '98 LONE PINE WAY', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('101.4', '08-JAN-87', '610', '07-JAN-87', '101', 'A');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('45', '11-JAN-87', '611', '11-JAN-87', '102', 'B');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('5860', '20-JAN-87', '612', '15-JAN-87', '104', 'C');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('2.4', '30-MAY-86', '601', '01-MAY-86', '106', 'A');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('56', '20-JUN-86', '602', '05-JUN-86', '102', 'B');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('698', '30-JUN-86', '604', '15-JUN-86', '106', 'A');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('8324', '30-JUL-86', '605', '14-JUL-86', '106', 'A');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('3.4', '30-JUL-86', '606', '14-JUL-86', '100', 'A');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('97.5', '15-AUG-86', '609', '01-AUG-86', '100', 'B');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('5.6', '18-JUL-86', '607', '18-JUL-86', '104', 'C');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('35.2', '25-JUL-86', '608', '25-JUL-86', '104', 'C');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('224', '05-JUN-86', '603', '05-JUN-86', '102', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('4450', '12-MAR-87', '620', '12-MAR-87', '100', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('6400', '01-FEB-87', '613', '01-FEB-87', '108', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('23940', '05-FEB-87', '614', '01-FEB-87', '102', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('764', '10-FEB-87', '616', '03-FEB-87', '103', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('1260', '04-FEB-87', '619', '22-FEB-87', '104', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('46370', '03-MAR-87', '617', '05-FEB-87', '105', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('710', '06-FEB-87', '615', '01-FEB-87', '107', '');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('3510.5', '06-MAR-87', '618', '15-FEB-87', '102', 'A');
    INSERT INTO ORD (TOTAL, SHIPDATE, ORDID, ORDERDATE, CUSTID, COMMPLAN)
    VALUES ('730', '01-JAN-87', '621', '15-MAR-87', '100', 'A');
    INSERT INTO ITEM (QTY, PRODID, ORDID, ITEMTOT, ITEMID, ACTUALPRICE)
    VALUES ('1', '100890', '610', '58', '3', '58');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '1', '100861', '611', '45', '1', '45');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '100', '100860', '612', '3000', '1', '30');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '1', '200376', '601', '2.4', '1', '2.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '20', '100870', '602', '56', '1', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '3', '100890', '604', '174', '1', '58');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '2', '100861', '604', '84', '2', '42');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '10', '100860', '604', '440', '3', '44');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '4', '100860', '603', '224', '2', '56');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '1', '100860', '610', '35', '1', '35');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '3', '100870', '610', '8.4', '2', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '200', '200376', '613', '440', '4', '2.2');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '444', '100860', '614', '15540', '1', '35');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '1000', '100870', '614', '2800', '2', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '20', '100861', '612', '810', '2', '40.5');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('150', '101863', '612', '1500', '3', '10');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('10', '100860', '620', '350', '1', '35');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('1000', '200376', '620', '2400', '2', '2.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('500', '102130', '620', '1700', '3', '3.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ( '100', '100871', '613', '560', '1', '5.6');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('200', '101860', '613', '4800', '2', '24');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('150', '200380', '613', '600', '3', '4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '102130', '619', '340', '3', '3.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('50', '100860', '617', '1750', '1', '35');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '100861', '617', '4500', '2', '45');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('1000', '100871', '614', '5600', '3', '5.6');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('10', '100861', '616', '450', '1', '45');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('50', '100870', '616', '140', '2', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('2', '100890', '616', '116', '3', '58');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('10', '102130', '616', '34', '4', '3.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('10', '200376' , '616', '24', '5', '2.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '200380', '619', '400', '1', '4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '200376', '619', '240', '2', '2.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('4', '100861', '615', '180', '1', '45');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('1', '100871', '607', '5.6', '1', '5.6');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '100870', '615', '280', '2', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('500', '100870', '617', '1400', '3', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('500', '100871', '617', '2800', '4', '5.6');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('500', '100890', '617', '29000', '5', '58');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '101860', '617', '2400', '6', '24');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('200', '101863', '617', '2500', '7', '12.5');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '102130', '617', '340', '8', '3.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('200', '200376', '617', '480', '9', '2.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('300', '200380', '617', '1200', '10', '4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('5', '100870', '609', '12.5', '2', '2.5');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('1', '100890', '609', '50', '3', '50');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('23', '100860', '618', '805', '1', '35');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('50', '100861', '618', '2255.5', '2', '45.11');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('10', '100870', '618', '450', '3', '45');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('10', '100861', '621', '450', '1', '45');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '100870', '621', '280', '2', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('50', '100871', '615', '250', '3', '5');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('1', '101860', '608', '24', '1', '24');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('2', '100871', '608', '11.2', '2', '5.6');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('1', '100861', '609', '35', '1', '35');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('1', '102130', '606', '3.4', '1', '3.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '100861', '605', '4500', '1', '45');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('500', '100870', '605', '1400', '2', '2.8');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('5', '100890', '605', '290', '3', '58');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('50', '101860', '605', '1200', '4', '24');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '101863', '605', '900', '5', '9');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('10', '102130', '605', '34', '6', '3.4');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('100', '100871', '612', '550', '4', '5.5');
    INSERT INTO ITEM ( QTY , PRODID , ORDID , ITEMTOT , ITEMID , ACTUALPRICE)
    VALUES ('50', '100871', '619', '280', '4', '5.6');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('4.8', '01-JAN-85', '100871', '3.2', '01-DEC-85');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('58', '01-JAN-85', '100890', '46.4', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('54', '01-JUN-84', '100890', '40.5', '31-MAY-84');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('35', '01-JUN-86', '100860', '28', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('32', '01-JAN-86', '100860', '25.6', '31-MAY-86');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('30', '01-JAN-85', '100860', '24', '31-DEC-85');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('45', '01-JUN-86', '100861', '36', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('42', '01-JAN-86', '100861', '33.6', '31-MAY-86');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('39', '01-JAN-85', '100861', '31.2', '31-DEC-85');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('2.8', '01-JAN-86', '100870', '2.4', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('2.4', '01-JAN-85', '100870', '1.9', '01-DEC-85');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('5.6', '01-JAN-86', '100871', '4.8', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('24', '15-FEB-85', '101860', '18', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('12.5', '15-FEB-85', '101863', '9.4', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('3.4', '18-AUG-85', '102130', '2.8', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('2.4', '15-NOV-86', '200376', '1.75', '');
    INSERT INTO PRICE (STDPRICE, STARTDATE, PRODID, MINPRICE, ENDDATE)
    VALUES ('4', '15-NOV-86', '200380', '3.2', '');
    CREATE INDEX PRICE_INDEX ON PRICE(PRODID, STARTDATE);
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('100860', 'ACE TENNIS RACKET I');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('100861', 'ACE TENNIS RACKET II');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('100870', 'ACE TENNIS BALLS-3 PACK');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('100871', 'ACE TENNIS BALLS-6 PACK');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('100890', 'ACE TENNIS NET');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('101860', 'SP TENNIS RACKET');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('101863', 'SP JUNIOR RACKET');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('102130', 'RH: "GUIDE TO TENNIS"');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('200376', 'SB ENERGY BAR-6 PACK');
    INSERT INTO PRODUCT (PRODID, DESCRIP)
    VALUES ('200380', 'SB VITA SNACK-6 PACK');
    CREATE SEQUENCE ORDID
    INCREMENT BY 1
    START WITH 622
    NOCACHE;
    CREATE SEQUENCE PRODID
    INCREMENT BY 1
    START WITH 200381
    NOCACHE;
    CREATE SEQUENCE CUSTID
    INCREMENT BY 1
    START WITH 109
    NOCACHE;
    CREATE VIEW SALES AS
    SELECT REPID, ORD.CUSTID, CUSTOMER.NAME CUSTNAME, PRODUCT.PRODID,
    DESCRIP PRODNAME, SUM(ITEMTOT) AMOUNT
    FROM ORD, ITEM, CUSTOMER, PRODUCT
    WHERE ORD.ORDID = ITEM.ORDID
    AND ORD.CUSTID = CUSTOMER.CUSTID
    AND ITEM.PRODID = PRODUCT.PRODID
    GROUP BY REPID, ORD.CUSTID, NAME, PRODUCT.PRODID, DESCRIP;

  • The detail algorithm of OLTP table compress and basic table compress?

    I'm doing a research on the detail algorithm of OLTP table compress and basic table compress, anyone who knows, please tell me. 3Q, and also the difference between them

    http://www.oracle.com/us/products/database/db-advanced-compression-option-1525064.pdf
    Edited by: Sanjaya Balasuriya on Dec 5, 2012 2:49 PM
    Edited by: Sanjaya Balasuriya on Dec 5, 2012 2:49 PM

  • Reg: CRM Table Relationship diagram

    Hi All,
    Please send me the following docs,
    (1.) CRM - Table Relationship Diagram
    (2.) BDT Cookbook
    (3.) BDOC Extension guide
    Also send me any other docs related to CRM, which u guys feel useful !!
    My Email ID : <removed by SDN Forum Moderator>
    Thanks in advance !!
    regards
    Prembabu R

    Hi,
    I got few useful link while searching in forum, Please find the link below
    CRM Tables & Relationship Diagram docs
    Thanks
    Prembabu

Maybe you are looking for

  • How to read from txt file that has words in between?

    Hi all, I am using Labview 8.2. I would like to read from a text file.  I have data (after each time it is has averaged over 100 waveforms) repeatedly stored on to the file.  The idea is to further improve SNR in post processing by again averaging th

  • Using in workflow process the element of Account dimension with subordinate

    Good day All In the dimension Account has been created element, which contains several shared elements. This element has been added as a Parent member when creating a Planning Unit Hierarchy. When we run the workflow process the child shared elements

  • How to show picture in switch view ( Creative ZEN Vision:

    Hi I have Creative ZEN Vision:M, I try to use music folder of "Switch view" to show picture, right now only one folder is showing picture, the other folders are not able to display pictures, am I need to doing some kind of setup? Thanks.

  • Sales Order Delivery Priority is not CIFed from ECC to APO

    I Have CIFed all master and transactional data like characteristics, products, Resources, PDS, Sales Orders, Stocks, Production and Planned Orders without any issue appart from the following: Delivery Priority of Sales Order: for all the Sales orders

  • After uppdate I can't use my certificate at my bank

    After update to FF4 I can't sign my bills at my bank site. FF hang up when I try to write pin of my electronic signature and after long time show a "technical problem" To restart FF doesn't help. To restart computer doesn't help. I must start Interne