Design of Tables

Hello,
I have a table design doubt.
First table called products_mast contains
CONTRACTS_ID (PK) auto_increment,
AGREEMENT_NO,
SUPPLIER_CODE,
START_DATE,
END_DATE
PROD_EXTENSION_NOSecond table called products_det contains
HIRING_ID (PK) auto_increment,
CONTRACTS_ID(FK),
PRODUCT_CODE,
RATEThe above tables are linked with CONTRACTS_ID. Start Dates and End Dates are in first table and product rates in second table.
In my third table TRANSACTIONS contains,
TRANS_ID,
TRANS_REF_NO,
HIRING_ID FK (products_det),
REMARKSIssue I am facing is before the end of contract period, user extends the period and extension numbers are stored in products_mast table and when extension happens new product rates are stored in products_det table.
I would like to link hiring_id of products_det table with TRANSACTIONS table. How can I do this?
Any help is very helpful.
Thanks
Edited by: ponic on May 21, 2012 8:29 PM

There is no table design doubt.
The tables you incompletely specified do not match at all with your description
- There are no 'products' in the product_mast table, there are only 'contracts'
- Each contract can have one or more product_codes in the product_det table, yet a products table is lacking.
- There are no 'extension numbers' in the product_mast table, and even if there were, the contract_id is unique.
So, I would suggest you would go back to the drawing board, wipe this mess, start all over again and do a proper analysis.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Designing a table for high rate of concurrent inserts and selects...

    I am looking for some recommendations on designing a table the will be inserted into from both nodes of a 2 node cluster quite heavily during peak hours when we are taking alot of orders. We are an online store and we are designing a table that will be used to hold product sku's for items that are placed in a shoppers cart at the same time and then we plan to use this table as a way of subtracting the inventory in this table as a minus in a view of our true nventory quantities?
    Not sure if that was clear but basically this table will be getting hit heavily for inserts and at the same time we will be using the data in the table to select from it so we can subtract the shu's that exists in the table.
    I am looking for techniques that maybe some of our guru's have implemented in this type of design in a rac environment that will help in the conncurrency that we are expectiing.
    Should I be building my tables with the smallest block size available as to avoid hot block in the db buffer cache and also we are using a sequence to generate and ID on the table and I have set a large cache size on the sequence (5000).
    We are planning on using ASSM table spaces with auto extent and segment space management as everthing we have read indicated that this is the best type of tablespace mgmt in RAC.
    What other factors should I be considering.
    any help or suggestions are greatly appreciated.
    Thanks in advance.

    user520056 wrote:
    I am looking for some recommendations on designing a table the will be inserted into from both nodes of a 2 node cluster quite heavily during peak hours when we are taking alot of orders. We are an online store and we are designing a table that will be used to hold product sku's for items that are placed in a shoppers cart at the same time and then we plan to use this table as a way of subtracting the inventory in this table as a minus in a view of our true nventory quantities?
    Not sure if that was clear but basically this table will be getting hit heavily for inserts and at the same time we will be using the data in the table to select from it so we can subtract the shu's that exists in the table.
    I am looking for techniques that maybe some of our guru's have implemented in this type of design in a rac environment that will help in the conncurrency that we are expectiing.
    Should I be building my tables with the smallest block size available as to avoid hot block in the db buffer cache and also we are using a sequence to generate and ID on the table and I have set a large cache size on the sequence (5000).
    We are planning on using ASSM table spaces with auto extent and segment space management as everthing we have read indicated that this is the best type of tablespace mgmt in RAC.
    What other factors should I be considering.
    any help or suggestions are greatly appreciated.
    Thanks in advance.See my .sig for other questions you should answer - OS, DB (version &c.),
    CPU/RAM/Disk...
    If you're running this on a 386 with 16 MB of RAM with on HDD, then you could
    have problems - if you're running it on something different, well that changes
    the possible answers.
    Paul...
    When asking database related questions, please give other posters
    some clues, like OS (with version), version of Oracle being used and DDL.
    Other trivia such as CPU + Disk configuration might also be useful.
    The exact text and/or number of error messages is useful (!= "it didn't work!"). Thanks.
    Furthermore, as a courtesy to those who spend time analysing and attempting to help,
    please do not top post and do try to trim your replies!

  • How to design a table?

    Hi,
    I need to list some data out of a database...
    So I was wondering if it's possible to design a table to put the data clearly arranged on the screen.
    thank you.

    Hi mastix
    It is possible to design a table using midp2.0 with the class CustomItem.U can find the readyMade example named in UIDemo in apps folder of the WTK2.0 tool kit installed path
    Ravi

  • How to design 8x2 Table in webdynpro ?

    Hi,
    I have given a task of creating 8x2 (8 rows x 2 columns) table where top row should be filled with green/blue color for titlw purposes. I tried doing it without any luck. Please help me to design this table.
    Table can be any rows or any columns but not specific to 8 x 2 here. just a indication.
    Thanks
    Praveen

    Hi Praveen,
    Please create table manully without tamplate and bind with context node which you want to display. and modify the table properties "VisibleRowCount" with value '8' mean that only 8 row will be visible in the screen.
    Insert two column into table which you want to display as table column and bind them with table context node attribute.
    Hope this will helps you.
    Thanks
    Arun Jaiswal

  • OWB Design Repository Tables

    Hi All,
    Is there any document from where I can get a decent insight into the OWB design repository tables and their functions.
    Being a bit more specific, while working in OWB 10gR1 I have experienced situations where a mapping suddenly shows a null pointer exception and becomes un-editable, and un-deployable and un-executable. The only solution then is to make the mapping from scratch. If I can know which all design repository tables are involved in storing a mapping information, then perhaps I can go to the backend fix the issue and retrieve the mapping.
    Please let me know if any of you have any infomation regarding this.
    Regards
    -AP

    Thanks a lot for your information. It gives me some idea of the tables from which these read only views are created.
    I hope, in order to understand more what these underlying tables are for, I need to scratch my head :))
    Regards
    -AP

  • Associations lost after Capture Design of table definition

    Hi,
    We use Designer 6i, with versioning on.
    We have a table definition T and a view definition V that uses the table definition T. In other words, there is an association in Designer between T and V.
    When we Capture Design the table T from a database, the association between T and V is lost.
    Is there a possibility to get a warning message in the Capture Design process that the association will be lost?
    Is it possible to use a preference concerning Capture Design for this?
    TIA,
    Lennart de Vos

    Hi,
    Sorry, I didn't describe the problem properly.
    I want to Capture Design a table, and not to Capture Design a view.
    The issue in Design Editor (DE) is as follows:
    (1) Capture Design a table T_CAPDES from the database.
    (2) Create a fixed format view definition V_CAPDES in DE, based on columns of the table definition T_CAPDES.
    (3) Create in the RON a reference from the view V_CAPDES to the table T_CAPDES, in the node 'Base Tables'.
    (4) Modify the table T_CAPDES in the database, e.g. add a column, drop a column or change the datatype of a column.
    (5) When you Capture Design the table T_CAPDES, the user receives the following information in the Message Window:
    "CDS-15334 Warning: The Table T_CAPDES already exists in the Repository. NOMERGE_AND_SAC Rule selected => the captured property values will not replace the existing property values in the repository..."
    The modifications in the table T_CAPDES are not visible in DE: Capture Design has not been executed for this table.
    Probably this warning will be generated because of some Capture Design preferences.
    A workaround is, to delete the table definition T_CAPDES in Designer and to Capture Design this table again from the database. But a major disadvantage of this workaround is, that the reference from the view definition V_CAPDES will be lost.
    Bottom line: I need some more information about the Capture Design preferences in Designer?
    Thanks a lot!
    Lennart de Vos

  • Designing a Table of Content

    This is one area that I believe needs to be expanded. I have CS5.5 and there is a very small amount of options when designing a Table of Contents. I can't get it to look the way I want but I can get so close. Here is what I'm looking for and maybe you can help me find the right code.
    Title__________________________________1-1
    Next Title______________________________1-2
    Third Title______________________________1-3
    I have individual - stand-alone documents (each being a separate "chapter" of a whole document). What I've been able to accomplish so far is I've got the page numbers to align on the right hand side but I can’t get that “1-“ or “2-“ chapter number or the underline that goes from the end of the page title to the page number. I’ve seen underlines like this in many documents so it can’t be that obscure that they wouldn’t add that option in this program. I have to be missing something.
    Thanks,
    Kyle

    Lets start with the numbers. How is th echapter number making it onto the document pages? is it a section prefix entered into the Numbering & Section dialog, or something else? A section prefix included in the page number should find its way into the TOC without doing anything special at all.
    Now for the underline. Any character can be underlined. Just select it and go to Underline Options and turn it on. In this case what you are trying to do is apply that underline to all the tabs, and there are actually two ways to do this automatically, but both require you to create a character style that is nothing more than turning on the underline and setting a weight, stroke type and offset for it. You can use a solid line, dashed, dotted, etc., for this custom underline which means you can get pretty much any look you want.
    The first method is to simply apply the style to the tab in the TOC dialog -- you have the opprotunity to apply a character style to whatever you've entered into the "Between Entry and Number" field by choosing a style in the next field to the right (you need to have the additional options showing). This will push that underline tight up against the text on both ends, though, and I like a little bit of breathing space, so I use the second method.
    In my method you add some space on either side of your tab (thin space, sixth space, your choice) in the field, and do not apply a style there. Instead, create a paragraph style for the lisitngs (which you should do anyway), then add a nested style like this: None up to 1 tab (or right indent tab, if you've used that) character, your new underline style through 1 character. This leaves the spaces on either side without the underline as well as the listing text and numbers. You can, of course, add another character style at the end to change the numbers, too, if you like, for example to bold or italic. I use this method to make forms for printing with lines where people need to write something. Adjusting the tabs adjusts the length of the lines.

  • Best Practice for Designing Database Tables?

    Hi,
    I work at a company for tracking devices (GPS Devices). Our SQL Server database is designed to have a table for each device we sell, currently there is 2500 tables in our database and they all have the same columns they only differ in table name. Each device
    sends about 4K records per day.
    currently each table hold from 10K records to 300K records
    What is the best practice to design a database in this situation? 
    When accessing database from a C# application, which is better to use, direct SQL commands or views? 
    a detailed description about what is best to do in such scenario would be great. 
    Thanks in advance.
    Edit:
    Tables columns are:
    [MessageID]
          ,[MessageUnit]
          ,[MessageLong]
          ,[MessageLat]
          ,[MessageSpeed]
          ,[MessageTime]
          ,[MessageDate]
          ,[MessageHeading]
          ,[MessageSatNumber]
          ,[MessageInput]
          ,[MessageCreationDate]
          ,[MessageInput2]
          ,[MessageInput3]
          ,[MessageIO]

    Hello Louis, thank you so much for your informative post. I'll describe in detail what situations I came through my 9 months of work in the company (working as a software engineer, but I am planning to take over database maintenance since no one is maintaining
    it right now and I cannot do anything else in the code to make it faster)
    At every end of the month our clients generate report for the previous month for all their cars, some clients have 100+ cars, and some have few. This is when real issue start, they are calling their data from our server through internet while having 2000
    unit sending data to our server, they keep on getting read time out since SQL Server gives priority to insert and hold all select commands. I solved it temporary in the code using "Read Uncommitted" once I initialize a connection through C#. 
    The other issue is generating reports for a month or two takes lots of time when selecting 100+ units. Thats what I want to solve, the problem is the one who wrote the C# app used hard coded SQL Statements
    AND
    the company is refusing to upgrade from SQL Server 2003 and Windows Server 2003. 
    Now talking about reports, there are summary reports, stops reports, zone reports ..etc most of them depend usually on at least MessageTime, MessageDate, MessageSpeed, MessageIO and MessageSatNumber.
    So from your post I conclude that for now I need to set snapshots so that select statements don't get kicked out in favor for insert commands, but does SQL Server automatically select from the snapshots or do I have to tell it to do so? 
    Other than proper indexing what else I need? Tom
    Phillips suggested Table partitioning but I don't think it is needed in my case since our database size is 78GB
    When I run code analysis on the app, Visual Studio tells me I better use stored procedures, views than using hard coded Select Statements, what difference will this bring me when talking about performance?
    Thanks in advance. 

  • Designing the table grid in subscreen in a selection screen..

    Hi all,
    Actually my requirement is there is a check box in the selection screen,If its checked then we have to display a subscreen with the details
    "Emp type"      "Empname"        "Monthly"      "Yearly"
       PM                Glen                 50000         600000          
       SM                Cross               40000         480000          
       TM                Mary                40000         480000          
       GM                Hary                 60000         720000          
    should be dislayed as a table grid.
    I have designed the screen but its not possible to give the headers
    "Emp type"      "Empname"        "Monthly"      "Yearly"
    Can anyone solve this issue for me..Thanks in advance

    I know to call the window but my problem is
    I have defined subscreen as:
    SELECTION-SCREEN BEGIN OF SCREEN 300 AS WINDOW.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-030.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : c_air AS CHECKBOX MODIF ID sss USER-COMMAND ucom.
    SELECTION-SCREEN COMMENT 4(18) text-003 FOR FIELD p_air.
    PARAMETERS : p_air TYPE vbak-vbeln MODIF ID sss .
    **SELECTION-SCREEN COMMENT 34(10) text-004 FOR FIELD p_air1.
    **It is not accepting this
    PARAMETERS : p_air1 TYPE p DECIMALS 2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN END OF SCREEN 300.
    i am able to see one comment but can i display more than one comment

  • Is OWB the Best Tool for Designing Warehouse Tables?

    My current site uses OWB for ETL but mandates the use of TOAD Data Modeller for design and build of the warehouse tables.
    I always thought that OWB could do this task just as well as TOAD, but I'm not very experienced with OWB.
    Can anyone advise?

    You can design table with OWB and deploy to database, but is better create database objects [tables, views ets.] with SQL by DDL script and import this objects to OWB.
    You can define physical properties, keys, constraints, partitions, indexes, grants ets. for one table in one SQL-script.

  • How to design HTML Table in ADF

    I am new to ADF Tech,
    I would like to know, how to design the HTML Table Rows and Columns in ADF
    Ex:
    <TABLE width="100%" border="1">
    <TR>
         <TD>GUID</TD>
         <TD>123</TD>
         <TD>Name</TD>
         <TD>Mark Antony</TD>
         <TD>Version</TD>
         <TD>1.0</TD>
    </TR>
    <TR>
    <TD>Created</TD>
         <TD>Oracle</TD>
         <TD>Modified</TD>
         <TD>Oracle User</TD>
         <TD>Placements</TD>
         <TD>20</TD>
    </TR>
    </TABLE>
    Thanks in Advance

    Balaji,
    With JSF in general (and ADF Faces too), you should not think in terms of HTML output, but in terms of JSF components. ADF has an af:table component that renders things in rows-and-columns, but emits HTML that is much more complex than just a simple HTML table.
    John

  • How design transaction table for  accounting system

    Hi master;
    Sir,
    I making accounting system for garment factory chart of account table I design but
    I confused in transaction table how I design make only one table
    Such as
    Trans
    Ac_code
    Date
    V_no
    Description
    DR_amount
    CR_amoun
    Chequ_no
    Or make transaction master detail style
    Tran_master
    V_no
    Date
    Description
    Ac_code
    Chequ_no
    Tran_detail
    S_no
    V_no
    Ac_code
    Description
    DR_amount
    CR_amoun
    But how I get ledger from both style please give me idea how I set transaction table
    Or give I any sample application or sample code
    Thanking You
    Aamir

    Hi master;
    Sir,
    I making accounting system for garment factory chart
    of account table I design but
    I confused in transaction table how I design make
    only one table
    Such as
    Trans
    Ac_code
    Date
    V_no
    Description
    DR_amount
    CR_amoun
    Chequ_no
    Or make transaction master detail style
    Tran_master
    V_no
    Date
    Description
    Ac_code
    Chequ_no
    Tran_detail
    S_no
    V_no
    Ac_code
    Description
    DR_amount
    CR_amoun
    ut how I get ledger from both style please give me
    idea how I set transaction table
    Or give I any sample application or sample code
    Thanking You
    Aamir
    only one table voucher may have more then one invoice then i would go with master detail .
    If you maintain one table how will you maintain more then one invoice's voucher.
    Khurram

  • Best method to design a table which can point to two different entities

    I have the following set of tables,
    Dimension1, Dimension2, Dimension3
    Dimension1 is dependant on the both Dimensions2 and Dimension3,  however the data mapping with Dimension3 will be very sparse (say only 1% of data will be available remaining will be NULL). So in this case, per my understnading there are the following
    options available,
    Option1: Have two columns in Dimension1 table and link them to the respective dimensions (However as mentioned the column which will be mapped to Dimension3 will have very less values ~1%), and have some conditional check to make sure that one of these
    two columns shuld always contain a value.
    Option 2: Split the Dimension1 table into two tables and map them to the respective dimensions. This removes the NULL aspect however is this is a right thing to do as per the DB design good practices and normalization techniques.
    Option3: Add one column (DimensionType) in Dimension1 table which will denote the type of dimension to which the data will be mapped into ('Dimension2' or 'Dimension3') and then add another column which will contain the actual ID and will map to both the
    dimensions based on DimensionType column (logically, because physically you cannot map a single column to 2 different entities).
    Which one of the above is a good design, also if we say either of option1 or option2 then what will be the case if Dimension3 will be dependant on a new dimension in future. Do we need to add a clumn or create one another table for this? Please let me know
    the thoughts.
    Regards, Murugan S

    Thanks Visakh
    Any other thoughts? or should option1 be considered the best approach given the scenario. Also this implies that if there is going to be a new dependancy in future which does not fit into Dimension2 and Dimension3, the solution is to add a third column in
    Dimension1 - Am I correct in the understanding?
    Regards, Murugan S
    Yes any new dependency have to be represented by a new foreign key column
    Now I'm getting one doubt 
    By new dependency do you mean a new related attribute? Are all these dimensions holding related attributes for the main entity?
    If yes then you may merge them to a single dimension ie attribute table like format with a type column to indicate the type of attribute
    Then you will always need only a single reference key (column) in your fact
    Any new dependency will just be a new record addition in the table with a new type value
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to design a table for Billing purpose

    hi all
    I want to develop a software for Billing purpose
    A company wants to record all sales in computer and at the month end wants to print out billing for all clients I have design this in foxpro and in Foxpro we did that when new month will start then new table generate like Crd_0707 (Credit month year).
    now I want to develop in oracle how I should start this project I mean who can I design tables.
    thanks

    If you understand relational theory and design shik Date's books. What you need to understand before porting an application from another database to Oracle is how Oracle works.
    If you do not know relational design then you need to learn it long before you start any porting project.
    If you know relational design then read the Application Developers Guide - Fundamentals, plus the first few chapters of the SQL manual up until the syntax diagrams start. These chapters identify the single row and aggregate functions that Oracle provides and introduce optimizer hints for tuning while the later chapters provide the syntax for DDL: create table, create view, etc .... You will also want to read the PL/SQL Users Guide and Reference then look at the supplied PL/SQL Packages and Types manual.
    After reading all this you meet the minimum requirements to work with Oracle, and I really do mean minimum.
    HTH -- Mark D Powell --

  • Web Application Designer: Change Table Chart to Line Format

    Dear Experts,
      We, as novices of the web application designer, encounter a problem in using this program. After having created a Chart table, we cannot changed it to the line format.
    The things that we perform are as follows:
    1) Right click and choose lines format
    2) Give it all titles
    3) Click Next until finish
    However, the result is still the chart table. Is there anyone who kindly give me steps of how to change it.

    Hi,
    Please try the following:
    1. Highlight the chart.
    2. In the Web Item Properties for chart, go to Edit Chart.
    3. Click on the ... incon
    4. Pick Lines
    5. Pick a type of Lines graph.
    6. Follow the wizard to change the required properties.
    This should work for you.
    Regards,
    Xibi

Maybe you are looking for

  • How do I get back to main screen on itunes from ipad screen

    Have new ipad and stuck on ipad screen in itunes; don't know how to get back to main screen to get info and support icon

  • Tcode SE37 - FM EDIT_TEXT

    Hi all, i hope there is somenone that can help me. My question is: Is possibile to create an ABAP custom report that its parameters are: PARAMETERS: belnr LIKE rbkp-belnr,                          gjahr LIKE rbkp-gjahr,          text(70). When the re

  • Booting OS X from G-Tech Drive

    Hi, If understand it right you can boot the OS X from an external hard drive and also have a 'computer image' backed up on an external. How do I accomplish this (these). My 500G G-tech G-drive is now partitionned in three 10G, 75G, and 375G. It would

  • Random .attachMovie bug

    Hi i'm creating a simple game for a uni project, where the user has to catch falling objects... you know the sort of thing. I've done it by creating movie clips of objects falling in the library and loading them (using .attachMovie) randomly every 20

  • Mouse froze on the lft upper corner

    mouse froze on left upper corner of screen/ sound is gone, sound keys dont work, brightness keys is out too. eject button is variavle drive does not reead the osx 10.2.4 installation discs i dont know what happened to it, by the way i downloaded 3 gb