Database Design Issuee

Dear All,
Need your expert Comments on this Issue.
We are about to design an application. One of the Entities in our Business process is a " Site " . Now for a single Site , there are 10 different department who store their own information .
e.g A Site named " Site-01" is expected to have 3 or 4 o5 different small houses.
A site has 5 Generators to suppy electricity etc.
Now Building a Room or house at a site is the responsibility of Civil Work Department while providing the Generator is the responsibilty of Power Department
I am a bit confused as how to design the table. should i design the seperate tables for Power , CIvil, RN or
Should i create a single table which has Site ID as its primary key and it may hold all information related to a Site , even though it is for different department,
eg.
A site table may look like
Site id CIvil Work Start date, Houses Build date, Generator provided dat
etc
Actually i am a bit confused as some ppl say that each department should have different tables, while some say that it should be a single table with different views.
IF it is a single table, then there must be some fields who will be empty , such as Civil work complete date will be empty unles until CIvil work gets completed, ,,
etc etc..
Please have your input so that i may get clear on this issue.
Looking forward to earliest resposes.
Thanks alot

> Do i need to created different tables for storing different department Progress date informatio
w.rt to Site
If there is a single SITE entity, a single DEPT entity, a single PROGRESS entity will be used. E.g.
PROGRESS = ( site_id, dept_id, progress_id, <attributes> )
The DEPT_ID constraint will be a foreign key to the DEPT table - to ensure the relationship of one DEPT entity can have many PROGRESS entities.
However, let's say that there are two department entities, one called PLANNING and the other ELECTRICTAL.
It is incorrect to use the name of the entity as an attribute. A single PROGRESS entity will then need to have the name of the entity as an attribute, e.g.
PROGRESS = ( site_id, entity_name_for_dept, dept_id, progress_id, <attributes> )
You cannot built referential integrity using dynamic table names that are stored as attributes (column values). SQL does not allow you to define such a constraint.
Another factor to consider is the attributes of PROGRESS entity. If the PLANNING's progress entity is different in attributes than ELETRICAL's progress entity, than there need to be two different progress entities. One should not force entities that look similar in nature to the the exact same entity. This type of mashing entities result in a table with 100+ columns, with columns 1-10 applicable to a relationship table1, columns 11-50 applicable for a relationship with table2, and so on.
The converse also applies. If an entity is used by both User1 and User2 (or Dept1 and Dept2), do not now create two different entities - one for each user/dept. This will require all the code (SQL, PL/SQL, Java, etc) that deals with these entities to know who the user or department is that is currently logged on, and base on that, dynamically select the appropriate table for that session.
In this case, SQL provides a feature called views to create different data sets (of the same table) for different users. Oracle extends this type of functionality by providing FGAC (Fine Grained Access Control) and VPBD's.

Similar Messages

  • Database design and pl/sql vs external procedures

    hi,
    My project involves predicting arrival time of a bus at a bus-stop, given statistical data of traffic patterns on the previous ‘n’(say 3) days, as well as the current location of the bus(latitude-longitude).
    Given current bus location, I derive my distance-until-destination bus-stop, which must be translated into time until arrival.
    Ive enlisted the triggers and procedures involved in making the prediction. Thse procedures especially the determination of perpendicular distances involve some complex trigonometric operations. I would like to know if my approach is correct and my database design is suited for the operations to b performed.
    Will it be more efficient to implement the procedures as external procedures or as pl/sql blocks
    This is my database design:
    LINKS ( a link is the road segment between adjacent bus-stops)
    LINK_ID                NUMBER      [PRIMARY-KEY]
    START_LATITUDE          NUMBER     
    START_LONGITUDE     NUMBER     
    START_STOP_ID          NUMBER
    END_LATITUDE          NUMBER
    END_LONGITUDE          NUMBER
    END_STOP_ID          NUMBER
    LINK_LENGTH          NUMBER
    BUS_ROUTE
    ROUTE_ID               NUMBER
    LINKS_ENROUTE          VARRAY(30) OF NUMBER
    STOPS_ENROOUTE          VARRAY(30) OF NUMBER
    TRACK(keeps track of current location of bus)
    BUS_ID           NUMBER          [PRIMARY-KEY]
    ROUTE          VARCHAR2(20)
    LATITUDE          NUMBER
    LONGITUDE          NUMBER
    TS               TIMESTAMP
    LINK_ID          NUMBER
    START_STOP     NUMBER
    END_STOP          NUMBER
    ARRIVAL_TIMES(actual arrival times of the bus, updated by track)
    BUS_ID           NUMBER     [PRIMARY-KEY]
    BUS_ROUTE          VARCHAR2(20)
    ARRIVAL          TIMESTAMP
    STOP_ID          NUMBER
    ETA (expected time of arrival)
    BUS_ID          NUMBER
    BUS_ROUTE          VARCHAR2(20)
    BUS_STOP_ID     NUMBER
    ARR_TIME          VARRAY(5) OF TIMESTAMP
    Triggers and procedures
    1)TRACK_TRIGGER
    On insert/update of track determine which link the us is currently on.
    Invoke a procedure that calculates perpendicular distance from current location to all links en-route (cursor on LINKS).
    Results are stored in a temporary table. Select the link-id of the tuple whose perpendicular distance is MINIMUM. This is the link the bus is currently on. Place link-id, start_stop_id and end_stop_id in corresponding row of TRACK.
    2)ARRIVAL_TRIGGER
    update ARRIVAL_TIMES.and store in ARRIVAL_TIMES that start-stop id with the time-stamp of the current track record.
    b)update ETA: Find the BUS-STOPS that come before the START_STOP of current track record. All these rows are deleted from the ETA tables, as the bus has already crossed these stops.
    3)Prediction Algorithm Procedure.
    Determine distance until destination for each STOP, 20 stops down from stop current location.
    Determine current avg. speed of the bus over a 2 hour window, by dividing total distance traveled by time taken.
    Calculate time-until arrival T1=current avg. speed * distance until destination
    From the records of previous ‘n’ days (say n=3) find those buses on the same route that were near the link the bus is currently on. Again determine avg speed over 2 hour window and calculate avg. speed.
    Calculate travel time T(i) = speed*distance until destination.     i.=2,3, 4…
    The final predicted arrival time is a weighted sum of all T(i).
    I hope Im not asking for too much, but the help would be greatly appreciated.
    Thankyou,
    Amina

    hello,
    actually i can manage ETA without a varray, since there will b a maxximum of 3 -4 values of expected arrival times at each stop. this can b done with separate columns.
    though i dont quite understand how lag() will help me...from what i understand lag() is to access values of previous rows. but in ETA table each element in the varray(if there is one) is going to be the expected arrival time of buses on a particular route at that particular stop, and is different from the arrival time at a previous stop(i.e.row).
    but for my other table BUS_ROUTE i have 2 varrays describing the links and stops enroute. in quite a few procedures i have to loop through these arrays and perform some calculations in every iteration is varray the best way 2 go, or nested tables?
    Thank you
    Amina
    As an aside, external procedures tend by their very
    nature to be slow - there's an overhead incurred
    each time we step outside the database. Therefore
    you really ought to avoid using a C extproc unless
    your calculations really cannot be done in PL/SQL or
    a Java Stored Procedure.
    Also, before you go down the VARRAY route you should
    consider the virues of analytic functions, notably
    [url=http://download-west.oracle.com/docs/cd/B1050
    1_01/server.920/a96540/functions56a.htm#83619]LAG()[/u
    rl]. I think you really ought to do some
    benchmarking of parformance before you start afdding
    denormalised columns like ETA. You may find the
    overhead in maintaining those columns exceeds their
    perceived benefits.
    Cheers, APC

  • Suggestion:  Create a Database Design Forum

    I recommend the creation of a new forum dealing exclusively with database design questions, such as setting Primary Keys, Unique constraints, Check constraints, Indexes, schema-creation scripts, etc. There is no forum devoted exclusively to this topic now and I feel it would be very helpful to the user community. It would certainly make searching for answers to design questions much easier.

    Billy  Verreynne  wrote:
    Prohan wrote:
    I don't agree there.
    1. How to create a relational model certainly IS relevant to Oracle, which is a RELATIONAL DBMS.Oracle also supports data warehousing (star schema designs), network/hierarchical designs, object-relational designs - or pretty much any data model that you may come up with. Calling it just a relational DBMS is incorrect.
    2. Your point that logical models are independent of specific technology is correct. What you're missing is that if a specific technology makes use of a certain foundational body of knowledge, that knowledge is a legitimate topic for a forum whose users use that specific technology.That is putting the cart in front of the horse IMO.
    I would rather see data modeling and logical database design being done in a way that is untainted with specific vendor implementations and technology used. There needs to be a clear line dividing the design from the implementation. If not, then design decisions can (and will) be made based not on the correct logical data modeling principles, but whether it can be "handled" by the technology. A design that is tainted like that, will always be less than optimal (especially as technology is continually evolving and changing).
    An OTN forum for database design will invariable be tainted with Oracle technology - and instead of learning sound data modeling fundamentals, a warped view of data modeling will be conveyed. Where doing abc will be acceptable (when it is not), because Oracle has feature xyz that can make the flawed design work (in a fashion).Excellent points. I think (or at least hope) such a forum would attract some number of pure theorists to straighten out the view. This might make for a lively forum, and might actually influence the real products, and might even get the cart on the right side of the horse.
    Hmmm, I guess I do sound hopelessly optimistic.

  • IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan

    Hi Experts,
    IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan for Daily/weekly??
    Vinai Kumar Gandla

    Hi Vikki,
    Many systems rely solely on SQL Server to update statistics automatically(AUTO UPDATE STATISTICS enabled), however, based on my research, large tables, tables with uneven data distributions, tables with ever-increasing keys and tables that have significant
    changes in distribution often require manual statistics updates as the following explanation.
    1.If a table is very big, then waiting for 20% of rows to change before SQL Server automatically updates the statistics could mean that millions of rows are modified, added or removed before it happens. Depending on the workload patterns and the data,
    this could mean the optimizer is choosing a substandard execution plans long before SQL Server reaches the threshold where it invalidates statistics for a table and starts to update them automatically. In such cases, you might consider updating statistics
    manually for those tables on a defined schedule (while leaving AUTO UPDATE STATISTICS enabled so that SQL Server continues to maintain statistics for other tables).
    2.In cases where you know data distribution in a column is "skewed", it may be necessary to update statistics manually with a full sample, or create a set of filtered statistics in order to generate query plans of good quality. Remember,
    however, that sampling with FULLSCAN can be costly for larger tables, and must be done so as not to affect production performance.
    3.It is quite common to see an ascending key, such as an IDENTITY or date/time data types, used as the leading column in an index. In such cases, the statistic for the key rarely matches the actual data, unless we update the Statistic manually after
    every insert.
    So in the case above, we could perform manual statistics updates by
    creating a maintenance plan that will run the UPDATE STATISTICS command, and update statistics on a regular schedule. For more information about the process, please refer to the article:
    https://www.simple-talk.com/sql/performance/managing-sql-server-statistics/
    Regards,
    Michelle Li

  • Logical Database design and physical database implementation

    Hi
    I am an ORACLE DBA basically and we started a proactive server dashboard portal ,which basically reports all aspects of our infrastructure (Dev,QA and Prod,performance,capacity,number of servers,No of CPU,decomissioned date,OS level,Database patch level) etc..
    This has to be done entirely by our DBA team as this is not externally funded project.Now i was asked to do " Logical Database design and physical Database
    implementation"
    Even though i know roughly what's that mean(like designing whole set of tables in star schema format) ,i have never done this before.
    In my mind i have a rough set of tables that can be used but again i think there is lot of engineering involved in this area to make sure that we do it properly.
    I am wondering you guys might be having some recommendations for me in the sense where to start?are there any documents online , are there any book on this topic?Are there any documents which explain this phenomena with examples ?
    Also exactly what is the difference between logical database design vs physical database implementation
    Thanks and Regards

    Logical database design is the process of taking a business or conceptual data model (often described in the form of an Entity-Relationship Diagram) and transforming that into a logical representation of that model using the specific semantics of the database management system. In the case of an RDBMS such as Oracle, this representation would be in the form of definitions of relational tables, primary, unique and foreign key constraints and the appropriate column data types supported by the RDBMS.
    Physical database implementation is the process of taking the logical database design and translating that into the actual DDL statements supported by the target RDBMS that will create the database objects in a target RDBMS database. This will generally include specific physical implementation details such as the specification of tablespaces, use of specialised indexing (bitmap, clustered etc), partitioning, compression and anything else that relates to how data will actually be physically stored inside the database.
    It sounds like you already have a physical implementation? If so, you can reverse engineer this implementation into a design tool such as SQL Developer Data Modeller. This will create a logical design by examining the contents of the Oracle data dictionary. Even if you don't have an existing database, Data Modeller is a good tool to use as a starting point for logical and even conceptual/business models.
    If you want to read anything about logical design, "An Introduction to Database Systems" by Date is always a good starting point. "Database Systems - A Practical Approach to Design, Implementation and Management" by Connolly & Begg is also an excellent reference.

  • Help with a database design for community housing project

    Talking database design
    Hi all, I have been wondering about the design of tables for a big block of residential units. There are 100 + rooms. there are about 25 houses in this complex but the 100 + rooms are all rented out separately.
    Its just like a college campus really but its not a college campus , its a little unique.
    The rents are applied as a percentage of income, so thats not common, so I included a tblRoomCost where the pre-calculated weekly cost is entered, and its got a date field in there for when the change of rent charged. I probably need to include an income field in tblCustomer, even just as an Admin reference.
    So is this looking pretty ok and would there be any point in scrapping the database and using text files ?
    So what do you think of these tables please ?
    tblCustomer
    pkCustomer, fldFirstName, fldLastname
    tblRoomAllocation
    pkRoomID, fkCustomer
    tblRoomCost
    pkRoomID, fldDate, fldRoomCost
    tblTransactionID
    pkTransactionID, fldDate, fldTransactionType, fkCustomer, fldAmount

    The naming scheme is one I learned and havn't thought past it though I do get into trouble and your suggestion may prove useful when codeing !
    I thought the tblRoomAllocation and tblRoomCost took care of changing. Though I see now that tbleRoomAllocation needs a Date field really. And the tblRoomCost has a fldRoomCost which isnt really that good an implementation as the rooms themselves are priced always accoedijng to the income of a resident and not because of the room. So the real world object is getting fudgy........
    It is extremely unlikly that Admin would ever allow two rooms to be rented by an individual.
    I will have a look at possibly your suggestion that an Accounts table be used.
    Also I thought about having a startDate and EndDate in the tblTransaction to represent the period being paid for. Just seems like a lot of Dates in a transaction table. One to record the transaction, the other two dates to indicate the period that was actually being paid for. ? When perhaps I should work that out in the runtime code.v ? This will be a VB.Net app.
    Do you think there is a need for Accounts table if only one room is permitted to be rented , though room changing may be common?
    And thx for your input.
    Message was edited by:
    user521381

  • New database design product - ModelRight for Oracle

    Whether you are a beginner or an expert data modeler, ModelRight for Oracle is the database design tool of choice for Oracle. Here are some of the things that make ModelRight for Oracle unique:
    •     Extensive support for Oracle – support and advanced features - OR types, object tables, object views, materialized views, index-organized tables, clusters, partitions, function-based indexes, etc...
    • full Forward, Reverse and Compare capabilities
    •     Unique User Interface and Diagrammatic elements: with our mode-less and hyperlinked user-interface, navigating and editing your model is intuitive and easy.
    •     Extensive use of Domains: you can create Domains for just about every type of object to propagate patterns, reusability & classification.
    •     Unprecedented level of programmatic control: you can control the smallest details of the FE and Alter Script generation process.
    Please check out our website at http://www.modelright.com and download the free trial version.
    Please let me know if you have any suggestions or comments.
    Thank you,
    Tim Guinther
    Founder, ModelRight, Inc.
    [email protected]
    (215) 534 5282

    Excellent product. Pretty impressive. Gorgeous diagrams and sophisticated reports. Loved the myriad of navigation ways and non-obtrusive modeless dialogs. Very easy to use!
    Keep the good work up.

  • Doubt in Database Design

    Hi,
    I have got some doubt in database design. I am designing a database for Inventory Management. Wherein i need to store the order details in one to many relationship. I have designed my tables as follows (Just sample)
    -- Tbl_OrderOne
    OrderCode (PK)
    OrderDate
    CustomerInfo
    -- Tbl_OrderMany
    OrderCode (FK)
    ItemCode
    Qty
    What doubt i have got is, since oracle has the features like creating objects and use them as data type and store the data.
    Can i use this feature in this case. Here in this case trasactions will be very high. Does it affect the performance. But presently i have designed it using foreign key reference as i showed you in the beginning. If using the Objects to store that huge number of data is feasible and increases the performance, then i can go for Object type feature.
    Thanx in Advance
    Regards
    Vinayak
    null

    Vinayak,
    One more thing. You can check out more information about NESTED TABLE at http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a76976/adobjdes.htm#446526
    Regards,
    Geoff

  • Re: Database design software ?

    The 'original' database development program is still being
    developed with a
    pedigree of over 40years
    www.dbase.com
    Regards
    Cliff
    Cliff Rielly

    "Chris Seymour" <[email protected]> wrote in message
    news:f1f96g$mq3$[email protected]..
    > Was curious to see what database design software people
    were using?
    > I have been looking around and have some ideas but I
    like to check what
    > others are using.
    If you are looking for a generic db design tool, and not for
    a database GUI,
    Case Studio is worth a try:
    www.casestudio.com/
    Massimo Foti, web-programmer for hire
    Tools for ColdFusion and Dreamweaver developers:
    http://www.massimocorner.com

  • Re: (forte-users) Round-trip database design

    We have used Erwin quite sucessfully, but it's not cheap.
    "Rottier, Pascal" <Rottier.Pascalpmintl.ch> on 02/15/2001 04:51:01 AM
    To: 'Forte Users' <forte-userslists.xpedior.com>
    cc:
    Subject: (forte-users) Round-trip database design
    Hi,
    Maybe not 100% the right mailing list but it's worth a try.
    Does anyone use tools to automatically update the structure of an existing
    database?
    For example, you have a full database model (Power Designer) and you've
    created a script to create all these tables in a new and empty database.
    You've been using this database and filling tables with data for a while.
    Now you want to do some marginal modifications on these tables. Add a
    column, remove a column, rename a column, etc.
    Is there a way to automatically change the database without losing data and
    without having to do it manually (except the manual changes in the (Power
    Designer) model).
    Thanks
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Hello Pascal,
    Forte has classes which might be able to scan the database structure
    (DBColumnDesc,etc.). Express use this classes to determine how the
    BusinessClass looks like. We use Forte to create the tables,indexes and
    constraints. We have the Problem that the above described classes are only
    readable but not fillable. The solution for us will be to create our own
    classes in
    the same manner than existing classes are. So we are able to make updates in
    the database structure and maybe able to change the database tables with tool
    code. Another reason for us to have the database structure in the
    application is the
    ability to see the table structure on which the Forte code works always up
    to date
    with the code. You are always able to compare the structure of the database
    with
    your businessclasses and able to convert a wrong structure to the correct
    structure
    with maybe just a little piece of code.
    Hope this helps
    Joseph Mirwald

  • Database design (ERD )for Inventory Management System

    Dear All,
    I am going to develop a simple Inventory Management System software using C# .NET for my learning. After searching different forums, many people have suggested to first create a database design for the software. I want a database design, in short, an ERD
    diagram for simple Inventory Management System which shows proper entities(tables), attributes and relationship between entities.
    It would be highly helpful for me as I am newbie to C# and databases.
    Thanks,
    momersaleem

    Dear Rebecca,
    Thanks for you suggestions.
    As I am going to develop IMS for learning purposes so I think I wouldn't need to go in detail regarding Customer name and addresses. However, I am still thinking of adding country attribute in customers' table which I think will be helpful to sort out customers.
    What's the difference between a purchase and an order?  They're usually the same thing, which doesn't mean you're
    wrong, but what are you picturing here? Purchase entity will be used to keep record of purchases you made and an order entity will be used to keep record of orders that cutomers placed.
    Pricing:
    Any order system needs to manage two very distinct bits of data that are easy to confuse. The price in the Product entity is the current
    price. The price in the Order entity is the selling
    price. Not at all the same thing--current price is almost certainly going to change over time. Selling price won't.
    Does it mean that I'll change the price attribute for product to current_price and add selling_price to order table which will help to keep record of price at the time of order?
    Why did you include a quantity field in the Products table? Is it meant to represent stock on hand?
    Yes you are right. It represents stock in hand.
    Could you please recheck the entities relationships as I am not confirmed whether these are correct or not?
    Thanks,
    momersaleem

  • New Oracle database design tool...

    Whether you are a beginner or an expert data modeler, ModelRight for Oracle is the database design tool of choice for Oracle. Here are some of the things that make ModelRight for Oracle unique:
    • Extensive support for Oracle – support and advanced features - OR types, object tables, object views, materialized views, index-organized tables, clusters, partitions, function-based indexes, etc...
    • full Forward, Reverse and Compare capabilities
    • Unique User Interface and Diagrammatic elements: with our mode-less and hyperlinked user-interface, navigating and editing your model is intuitive and easy.
    • Extensive use of Domains: you can create Domains for just about every type of object to propagate patterns, reusability & classification.
    • Unprecedented level of programmatic control: you can control the smallest details of the FE and Alter Script generation process.
    Please check out our website at http://www.modelright.com and download the free trial version.
    Please let me know if you have any suggestions or comments.
    Thank you,
    Tim Guinther
    Founder, ModelRight, Inc.
    [email protected]
    (215) 534 5282

    Jens I found a few good links in there...I was trying to
    find if there was a certification track offered in
    DB Design? I see a lot of instructor led classes most
    of them only 2-3 days long.

  • Good database design and modelling books

    Hi ,
    I need to work on designing a database from the scratch by creating logical database design and then physical database design.I'm new to database design.
    Can someone please point me to some good database design and modelling related books /tutorials.
    Regards,
    Bharath.

    bharathDBA wrote:
    Hi Girish Thanks for the information.
    I would definitely look into this book later.
    I don't mind paying any amount of money,if that book gives me the knowledge I want.
    As this book is international edition,for shipping it is taking 8-10 business days and by that time I need to complete designing my database and probably I might need to some other book.
    Is this a school assignment? I hope so. Referring back to your opening statement "I need to work on designing a database from the scratch by creating logical database design and then physical database design.I'm new to database design." I can only say that database design is a very big subject. If you are starting from a position of no knowledge at all, I'm afraid there is nothing that is going to give you the knowledge you need in the time frame you have. I will say you need to start by learning the rules of Data Normalization. Make your logical design Third Normal Form. Good can be your friend. There is actually a pretty good write-up on Data Normalization on Wikipedia.

  • Database design for swapping/trading items between companies

    What is the best SQL table schema for items being swapped/traded between companies? For instance:
    e.g.1 If company A wants to swap item 0001 (owned by customer X but being managed by company A) with company B who is offering item 0002 (owned by customer Y but being managed by company B) and item 0003 (owned by customer Z but being managed by company B)
    e.g.2 If company A wants to swap item 0004 (owned by customer X but being managed by company A) with company B who is offering item 0005 (owned by customer Y but being managed by company B)
    These are the tables I have so have so far, it should be good enough to support 1 to 1 trades but not too sure about 1..* to 1..* (many to many) trades, is it correct or can it be improved further?
    Note: Trades can only happen between two companies, but they could trade as many items as they wish.
    Trade
    id: int (primary key)
    company1_id: int (foreign key)
    company2_id: int (foreign key)
    datetime: string
    status: string
    TradeDetail
    id: int (primary key)
    trade_id: int (foreign key)
    item_id: int (foreign key)
    Company
    id: int (primary key)
    name: string
    address: string
    phone: string
    email: string
    rating: int
    Customer
    id: int (primary key)
    f_name: string
    s_name: string
    dob: string
    address: string
    phone: string
    email: string
    Item
    id: int (primary key)
    customer_id: int (foreign key)
    company_id: int (foreign key)
    price: double

    I made a few changes.
    You need to think about NATURAL KEY for each table.  For example, what is the NATURAL KEY for the Customer table. It can be:
    CompanyTaxID char(9) NOT NULL UNIQUE
    or
    SSNO char(9) NOT NULL UNIQUE
    Trade
    id: int (primary key)
    company1_id: int (foreign key)
    company2_id: int (foreign key)
    datetime: datetime
    unique(company1_id, company2_id, datetime)
    status: string
    TradeDetail
    id: int (primary key)
    trade_id: int (foreign key)
    item_id: int (foreign key)
    Company
    id: int (primary key)
    name: string
    address: string
    phone: string
    email: string
    rating: int
    Customer
    id: int (primary key)
    f_name: string
    s_name: string
    dob: string
    address: string
    phone: string
    email: string
    Item
    id: int (primary key)
    customer_id: int (foreign key)
    company_id: int (foreign key)
    price: decimal(20,2)
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Urgent help database design

    Hi,
    I need an urgent help with the design of the database, We have already a database in production but we are facing a problem with extensibility.
    The client information is variant that is
    1) number of fields are different for each client
    2) client may ask anytime in future to add another field into the table
    Please provide your views with practical implication (advantages and disadvantages) or any resource where I can find information.....
    Help appreciated.....

    Hi,
    Database design is an art & science by itself - as far as I know, there aren't any rigid rules.
    I would suggest that you have a look at the discussions in these two threads for a few general ideas :
    Database Design
    conversion from number to character
    If your client requirements keep changing, I would suggest that you keep 8- 10 "spare" columns in your tables - just call them spare1, spare2, etc.. The only purpose of these tables is to allow flexibility in the design - i.e.., in future you can always extend the table to accommodate more fields.
    I have used it a couple of times & found it to be useful - again, this is only a suggestion.
    Regards,
    Sandeep

Maybe you are looking for

  • Mapping Multiple Nodes ?

    Hi Guys, Request Structure - Node - occurs   0 - unbound Target Structure - Node - occurs  0 - unbound If there are 3 transactions coming from the reguest structure then i need to generate only 2 node structures on the target side.  can anybody expla

  • Httpurlconnection and Proxy settings

    hi all, I wrote a servlet that uses an HTTPUrlConnection to get a page from a remote server and the code looks like this : url = new URL(urlstr); HttpURLConnection uc = null; System.getProperties().put( "proxySet", "true" ); System.getProperties().pu

  • Error -69

    Can someone help me? For some reason when I plugged my iPod (color) to my iTunes 6.0, I get an error message that reads "Attempting to copy to the disk "SCORREA'S I" failed. An unknown error occurred (-69)". I don't know why this happened since it wa

  • 10.4.8 followed by wireless might mouse = no keyboard?

    For everyones info, I installed 10.4.8 minutes before I installed my new wireless Mighty Mouse (sw v1.3) and then by the next reboot the (PC) keyboard that I have running though a usb hub stopped working. As with many problems I've read about before,

  • No Largepages by default on x86

    Hi, is there any reason why auto_lpg_disable is set to 1 by default on Solaris 11.1 x64? This makes the kernel not use larger pages (2M and IIRC 1G for newer CPUs) for heap (and anon?!) unless you tell it explicitly (i.e. via MPSS preloading, ppgsz e