To get best database design

Hello...
I am going through one case study for the database design. and for this I want your view / suggestion regarding this.
I have one table with 6 column
create table test (
id primary key,
col1 varchar2(100),
col2 varchar2(100),
col3 varchar2(100),
col4 varchar2(100),
col5 varchar2(100))
It might be possible that col1 value duplicated in col2 or col3 or col4 or col5 for some other raw.
Now I have query that is require to search for the row by matching given value with all of 5 column col1 to col5. like this:--
select * from test where col1=''pratik' or col2='pratik' or col3='pratik' or col4='pratik' or col5='pratik';
I want to know, is this design is good for large table with millions of records into it.
Is any other design is possible?? that is more efficient
Thanks

But in case of address, generally I am going to retrieve address for a give
name or id. while in this case on basis of supplied value I have to search
all 5 columnsNot necessarily. A search might be for all customers in a given postal district. But that is my point. I suggested address as a possible explanation for your requirements to fill a void.
You have given us a strawman architecture and no clues about the underlying business premises. Under those circumstances all I can say is if you want to retrieve Col1, Col2, Col3, Col4 and Col5 for each ID where any of those columns matches 'Pratik' then I think your design is probably correct.
Certainly I wouldn't want to suggest a different design without knowing why it is legitimate for the value 'Pratik' to appear in Col1, Col2, Col3, Col4 or Col5.
Cheers, APC

Similar Messages

  • Physical Database Design Steps & Performance Considerations

    Hi,
    We have a Oracle 9i install need help to create a DB.
    Required to know the Physical Database Design Steps & Performance Considerations.
    like
    1-Technical consideration of DB as per server capacity. how to calculate..?
    2- What will be the best design parameter for DB...?
    Can you please help how to do that. Any metalink ID help to get those information.
    thanks
    kishor

    there is SOOO much to consider . . . .
    Just a FEW things are . . .
    Hardware - What kind of Host is the database going to run on?
    CPU and Memory
    What kind of Storage
    What is the Network like?
    What is the database going to do OLTP or DW?
    Start with your NEEDS and work to fulfill those needs on the budget given.
    Since you say Physical Database Design . . . is your Logical Database Design done?
    Does it fulfill the need of your application?

  • 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.

  • 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

  • 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

  • Database design for share market

    Hi One and All,
    I have a query regarding, design of New database....
    Right now I joined as a Database administrator as a fresher, my superior has given me one assignment i.e. I have to create a sample database on Share market. As per his requirement the tables should be Issuer table, Security table, Broker table, INvestor table, Account table, Order table, Tradeing table. He said that I have to prepare the fiellds for this tables and relation ships and whole database structure.... I can prepare relations ships and database structure but the problem is, I don't know how the stock market is really works. If any body help me in this issue I am very thank full to him.
    I need just the table feilds, if I get this rest of job i wil do by studying the subject of share market.
    Thank You

    Hi,
    As per Hemant this forum is not appropriate for this question. However you have to analyze the system by meetings with stock broker at stock Exchange or to the client for which you are designing the system. Ask your superior to arrange meeting with client and then ask question to him so that you can made database design for them.
    Regards,
    Abbasi

  • Database design for Help Desk application.

    Hello does any one know
    Database design for Help Desk application.
    ERD
    Business rules and features
    ?

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • Database Design for Multiple function site

    Hi
    I am working on one project which involve multiple function
    site, such as
    Company Product Catelog, Customer Support Forum, Document
    Exchange Engine and
    etc...
    Normally we will combine ALL TABLEs into one DATABASE.
    My question are:
    1) Is my break them to individual DATABASE, will it perform
    better?
    Means Product Catelog and Forum will have different
    DATABASE, but they
    will using the same DOMAIN NAME.
    2) I am worried about the break down and corruption of
    DATABASE, so I have the
    idea to separate them out. Are my idea correct or wrong?
    3) I am seeking for better DATABASE DESIGN, because I know
    the database will
    become huge in future. I request for your idea and opinion.
    Thank you very much.

    Creating views: not an option I think. It would involve a lot of programming with 'instead of' triggers etc.
    Seperate databases: a good way if the locations are completely independant and do not share information. This involves more DBA work.
    Separate schema's in one database: this would make public synonyms impossible, and is probably not a good option.
    Adding a location id to tables: the best way I think, and flexible. You can easily add another location, and locations can easily share information.

  • SIMPLE Database Design Problem !

    Mapping is a big problem for many complex applications.
    So what happens if we put all the tables into one table called ENTITY?
    I have more than 300 attributeTypes.And there will be lots of null values in the records of that single table as every entityType uses the same table.
    Other than wasting space if I put a clustered index on my entityType coloumn in that table.What kind of performance penalties to I get?
    Definition of the table
    ENTITY
    EntityID > uniqueidentifier
    EntityType > Tells the entityTypeName
    Name >
    LastName >
    CompanyName > 300 attributeTypes
    OppurtunityPeriod >
    PS:There is also another table called RELATION that points the relations between entities.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    check the coloumn with WHERE _entityType='PERSON'
    as there is is clustered index on entityType...there
    is NO performance decrease.
    there is also a clustered index on RELATION table on
    relationType
    when we say WHERE _entityType ='PERSON' or
    WHERE relationType='CONTACTMECHANISM'.
    it scans the clustered index first.it acts like a
    table as it is physically ordered.I was thinking in terms of using several conditions in the same select, such as
    WHERE _entityType ='PERSON'
      AND LastName LIKE 'A%' In your case you have to use at least two indices, and since your clustered index comes first ...
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Have you ever thought of using constraints in your
    modell? How would you realize those?
    ...in fact we did.We have arranged the generic object
    model in an object database.The knowledge information
    is held in the object database.So your relational database is used only as a "simple" storage, everything has go through your object database.
    But the data schema is held in the RDBMS with code
    generation that creates a schema to hold data.If you think that this approach makes sense, why not.
    But in able to have a efficent mapping and a good
    performance we have thought about building only one
    table.The problem is we know we are losing some space
    but the thing is harddisk is much cheaper than RAM
    and CPU.So our trade off concerated on the storage
    cost.But I still wonder if there is a point that I
    have missed in terms performance?Just test your approach by using sufficiently data - only you know how many records you have to store in your modell.
    PS: it is not wise effective using generic object
    models also in object databases as CPU cost is a lot
    when u are holding the data.I don't know if I'd have taken your approach - using two database systems to hold data and business logic.
    PS2: RDBMS is a value based system where object
    databases are identity based.we are trying to be in
    the gray area of both worlds.Like I wrote: if your approach works and scales to the required size, why not? I would assume that you did a load test with your approach.
    What I would question though is that your discussing a "SIMPLE Database Design" problem. I don't see anything simple in your approach when it comes to implementation.
    C.

  • DataBase Design For InvoiceSystems

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Invoice Systems
    Please Could you help me in terms of DataBase Design......

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • DataBase Design

    Hello Friends!
    I am new in database design. I design a database for a company which sale their products. The company has their outlets in four regions i.e. (North, South, East and WEST) and they want to check their sale of the Product.. The sample report’s format and data are shown below:
    1.     Product-Wise Monthly Sale
    Sale for the Month of July-2004
         Books     NoteBooks     Pen     Pencils
    Schools     25     10     50     25
    Colleges     15     5     10     3
    Universities     6     30     14     3
    Government     2     27     6     1
    Others     21     32     54     8
    TOTAL:     69     104     134     40
    2.     Sector-Wise Annual Sale
    Sale for the Year 2004-05
         Books     NoteBooks     Pen     Pencils
    Schools     25     10     50     25
    Colleges     15     5     10     3
    Universities     6     30     14     3
    Government     2     27     6     1
    Others     21     32     54     8
    TOTAL:     69     104     134     40
    3.     Sale of Product for the current and previous years
    Sale by Product
         2001-02     2002-03     2003-04     2004-05
    Books     10     5     15     25
    NoteBooks     10     5     15     25
    Pens     10     5     15     25
    Pencils     10     5     15     25
    TOTAL:     40     20     60     100
    3.     Sale by Sector for the current and previous years
    Sale by Sector
         2001-02     2002-03     2003-04     2004-05
    Schools     10     5     15     25
    Colleges     10     5     15     25
    Universities     10     5     15     25
    Government     10     5     15     25
    Others     40     20     60     100
    TOTAL:     80     40     120     200
    4.     Region-Wise Sale for the current and previous years.
    Sale by Region
         2001-02     2002-03     2003-04     2004-05
    East     10     5     15     25
    West     10     5     15     25
    North     10     5     15     25
    South     10     5     15     25
    TOTAL:     40     20     60     100
    With the help of above reports I design the following database. Please let me tell whether the following database design is ok or not otherwise please suggest me how to improve it so that i can get the result as per given the above-format.
    Year (Table)
    YearID int
    Description Varchar2
    Period_From Date
    Period_To Date
    Current logical
    Month (Table)
    MonthID int (1,2,3,4,5,6,7,8,9,10,11,12)
    MonthDescription varchar2 (Jan,Feb, Mar, Apr, May, Aug, Sept, Aug, Oct, Nov, Dec)
    StartDate Date
    EndDate Date
    Region(Table)
    RegionID int (1,2,3,4)
    RegionName varchar2 (East, West, North, South)
    Sector (Table)
    SectorID int (1,2,3,4,5)
    Sector Varchar2 (School, Colleges, University, Government, Others)
    Product (Table)
    ProductID int (1,2,3,4)
    ProdName varchar2 (Books, NoteBooks, Pen, Pencil)
    Sale (Table)
    SaleID int
    ProductID int
    Product varchar2
    Sale int
    RegionId int
    SectorID int
    MonthID int
    YearID int
    Thanks.
    (BASIT)

    how could we get the report of previous five years sale of the products.
    SELECT trunc(sale_date, 'YYYY'), sum(sale_qty)
    FROM   sales
    WHERE  sale_date >= add_months(sysdate-60)
    GROUP  BY trunc(sale_date, 'YYYY')
    suggest whether dropped Product name from the sale table as I already have a column prodid in it?Yes. Duplicated data is a Bad Thing. This is Rule #1 of the late Dr. Codd's 12 rules. These are the foundationstones of good relation design. Wikipedia has a good introduction to them.
    Cheers, APC

  • Multi-lingual Software & Database Design

    I am interested in how the industry is approaching multi-lingual software and database design. Specifically, I would like to know if there are any good resources (whitepapers, web sites, books) that get into the details of what the object model and data model of a multi-lingual design would look like and how the two fit together. I am working on a project that requires Product information to be stored in both English and French. Thank you.

    http://java.sun.com/j2se/1.3/docs/guide/intl/

  • New Database Design

    Hi,
    I'm an DBA and i was assigned to design a new database(fresh) in oracle 11gR2 in windows platform for a project. Since, i'm new to database design, getting confusion on what perspective to approach and where to begin.
    Can anyone please help on this.
    Note: URL's are welcome.

    1011442 wrote:
    Hi,
    Thanks for providing the link.
    The link that you sounds good and providing much info on considerations in creating a database and schema security.
    But, i want the logical design part.
    Assume that the database design for College Management System. It might have enrollment module, result module, staff module, etc., including more schema objects. I'm expecting the procedures or steps involving in such designs & how to design.
    It starts with interviewing the end-user and determining their requirements .. especially flushing out all the entities (student, staff member, department, course, class, etc, etc, etc) and their attributes, then determining the relationship between said entities and attributes.  Those entities, attributes, and relationships will be your logical database design.

  • New book! Physical Database Design: The Database Professional's Guide

    Morgan Kaufmann publishers have just released a new book on physical database design covering how to design indexes, range and hash partitioning, materialized views, storage layout, RAID, warehouse design and other physical design areas. The book covers Oracle and several other major databases. Lots of diagrams and examples. It's actually a really good book. An excellent book for people who design and administer databases.
    Available on Amazon and most other book sellers.
    Physical Database Design: The Database Professional's Guide to Exploiting Indexes, Views, Storage, and More
    by Sam S. Lightstone, Toby J. Teorey, Tom Nadeau
    Paperback, 448 pages, publication date: MAR-2007
    ISBN-13: 978-0-12-369389-1
    ISBN-10: 0-12-369389-6
    Series: The Morgan Kaufmann Series in Data Management Systems
    Link on Amazon:
    http://www.amazon.com/Physical-Database-Design-professionals-exploiting/dp/0123693896
    Link on the publisher's web site:
    http://www.elsevier.com/wps/find/bookdescription.cws_home/710637/description#description
    Comments on the book can be sent to: [email protected]

    how could we get the report of previous five years sale of the products.
    SELECT trunc(sale_date, 'YYYY'), sum(sale_qty)
    FROM   sales
    WHERE  sale_date >= add_months(sysdate-60)
    GROUP  BY trunc(sale_date, 'YYYY')
    suggest whether dropped Product name from the sale table as I already have a column prodid in it?Yes. Duplicated data is a Bad Thing. This is Rule #1 of the late Dr. Codd's 12 rules. These are the foundationstones of good relation design. Wikipedia has a good introduction to them.
    Cheers, APC

Maybe you are looking for