Forum Stats

  • 3,759,178 Users
  • 2,251,510 Discussions
  • 7,870,526 Comments

Discussions

Inserting, deleting and updating in one to one, one to many and many to many relationship

2712919
2712919 Member Posts: 11
edited Jul 14, 2014 6:03PM in SQL & PL/SQL

Hi. I'm new one in oracle database and also I don't have some good knowledge in databases. I'm working in oracle forms and reports 10g so i'm creating some small form which relies on small database. What I need help from u all from this discussion is the basic stuff. For simplicity lets say I have two tables: Persons and Orders.

1) One to one

- I need sql/ pl sql code for creating this two tables and the references for one to one relationship and then how to insert data in parent and in the child table, update and delete sql.

2) One to many

- Same idea as one to one. insert or update sql and sql about creating the tables

3) Many to many

- Same as prev. two

I need help for this. So if u have some questions feel free to ask. I don't grasp easily databases, they aren't my best side, too much trouble with them. :/

Thanks

Tagged:

Answers

  • SomeoneElse
    SomeoneElse Member Posts: 14,866 Silver Crown

    So, you want us to write code for tables and data we can't see and requirements are unknown.

    > I don't grasp easily databases, they aren't my best side, too much trouble with them. :/

    I hate to be blunt, but maybe you are in the wrong line of work.  The forums aren't a coding service.  If you have trouble with something that isn't working or getting errors we might be able to help.

  • RobbR
    RobbR Member Posts: 102 Red Ribbon
  • 2712919
    2712919 Member Posts: 11

    For both of u:
    Just need someone if like to help. I know that i'm not in good place for asking this question. Just i need to see working code how needs to look the sql for all this things. I'm ok when creating the tables, for example one to many, but i dont know how to set up one to one or many to many relationship i.e the references. and after that i'm totally loss how to insert in child table, parent is not problem. i have problem inserting in the child table where is the reference key. for now i need one to one and one to many. many to many can wait for other time

  • 2712919
    2712919 Member Posts: 11

    Just basic example as i say People, orders. the data is not important. it can hold 2-3 columns nothing more. I need the correct sql how to create one to one or one to many relationship between two tables and then how to insert or update in child table. this is my main problem.

  •  Just i need to see working code how needs to look the sql for all this things. I'm ok when creating the tables, for example one to many, but i dont know how to set up one to one or many to many relationship i.e the references. and after that i'm totally loss how to insert in child table, parent is not problem. i have problem inserting in the child table where is the reference key. for now i need one to one and one to many. many to many can wait for other time 

    You need to search the internet and find a tutorial and/or a good book that covers the basic database operations.

    There are PLENTY of books available (e.g. Programming for Dummies) - and they are easy to find on the internet or in your local book store.

    The forums are to help people that have questions about what THEY are doing or code that THEY are writing. They are not the place to try to teach someone a new topic or skill.

  • 2712919
    2712919 Member Posts: 11

    Links are not bad. But i need concrete sql code. The theory behind don't help me nothing. :/ The biggest problem for me is how to insert or update child table after the relationship is created between the tables. and need sql how one to one and many to many sql is done when reference the parent table. one to many i can do myself. and again insert and update after the references are done with creating the table or after altering the table.

  • 2712919
    2712919 Member Posts: 11
    edited Jul 14, 2014 6:14PM

    recommend some quick sql book and good. i dont like big book which goes deeply in databases. and also the book work with 2 or more tables connected and explain all that details i need.

This discussion has been closed.