Two tables that have a relationship as "many-to-many" and "one-to-many.
I have the next two represents tables users and the other represents the items where each item can have an author (user) and of course, users can create a lot of articles, so the one-to-many relationship: -.1. users: -.
User_id (primary_key)
User_name
User_sex
user_address
2.ARTICILES: -.
Article_id
Text
Author_id (foreign key to the users.user_id)
but the problem I have been facing is that, on another requirement each items can have several (users) approval before being published, so in this way have become the many-to-many relationship, so I created a third table called "trusts": -.
3.approval: -.
approval_id (foreign key to the users.user_id)
article_id (foreign key to the articles.article_id)
level.
so is this a good approach to flow, or there is another way I can better build these tables.
Hello
Relationship seems to be ok for your current condition. but make sure you have sequence approval on your table to the approval, in case you should find the flow of approvals.
See you soon
Kanchana
Tags: Database
Similar Questions
-
Mr President.
I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?
the page source is
<?xml version='1.0' encoding='UTF-8'?> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:f="http://java.sun.com/jsf/core"> <af:panelFormLayout id="pfl1"> <af:group id="Group"> <af:inputText value="#{bindings.VoucherId.inputValue}" label="#{bindings.VoucherId.hints.label}" required="#{bindings.VoucherId.hints.mandatory}" columns="#{bindings.VoucherId.hints.displayWidth}" maximumLength="#{bindings.VoucherId.hints.precision}" shortDesc="#{bindings.VoucherId.hints.tooltip}" id="it1"> <f:validator binding="#{bindings.VoucherId.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId.format}"/> </af:inputText> <af:inputDate value="#{bindings.VoucherDate.inputValue}" label="#{bindings.VoucherDate.hints.label}" required="#{bindings.VoucherDate.hints.mandatory}" columns="#{bindings.VoucherDate.hints.displayWidth}" shortDesc="#{bindings.VoucherDate.hints.tooltip}" id="id1"> <f:validator binding="#{bindings.VoucherDate.validator}"/> <af:convertDateTime pattern="#{bindings.VoucherDate.format}"/> </af:inputDate> <af:inputText value="#{bindings.Credit.inputValue}" label="#{bindings.Credit.hints.label}" required="#{bindings.Credit.hints.mandatory}" columns="#{bindings.Credit.hints.displayWidth}" maximumLength="#{bindings.Credit.hints.precision}" shortDesc="#{bindings.Credit.hints.tooltip}" id="it2"> <f:validator binding="#{bindings.Credit.validator}"/> </af:inputText> </af:group> <af:group id="g1"> <af:inputText value="#{bindings.Lineitem.inputValue}" label="#{bindings.Lineitem.hints.label}" required="#{bindings.Lineitem.hints.mandatory}" columns="#{bindings.Lineitem.hints.displayWidth}" maximumLength="#{bindings.Lineitem.hints.precision}" shortDesc="#{bindings.Lineitem.hints.tooltip}" id="it3"> <f:validator binding="#{bindings.Lineitem.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.Lineitem.format}"/> </af:inputText> <af:inputText value="#{bindings.VoucherId1.inputValue}" label="#{bindings.VoucherId1.hints.label}" required="#{bindings.VoucherId1.hints.mandatory}" columns="#{bindings.VoucherId1.hints.displayWidth}" maximumLength="#{bindings.VoucherId1.hints.precision}" shortDesc="#{bindings.VoucherId1.hints.tooltip}" id="it4"> <f:validator binding="#{bindings.VoucherId1.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId1.format}"/> </af:inputText> <af:inputText value="#{bindings.Debit.inputValue}" label="#{bindings.Debit.hints.label}" required="#{bindings.Debit.hints.mandatory}" columns="#{bindings.Debit.hints.displayWidth}" maximumLength="#{bindings.Debit.hints.precision}" shortDesc="#{bindings.Debit.hints.tooltip}" id="it5"> <f:validator binding="#{bindings.Debit.validator}"/> </af:inputText> <af:inputText value="#{bindings.Credit1.inputValue}" label="#{bindings.Credit1.hints.label}" required="#{bindings.Credit1.hints.mandatory}" columns="#{bindings.Credit1.hints.displayWidth}" maximumLength="#{bindings.Credit1.hints.precision}" shortDesc="#{bindings.Credit1.hints.tooltip}" id="it6"> <f:validator binding="#{bindings.Credit1.validator}"/> </af:inputText> <af:inputText value="#{bindings.Particulars.inputValue}" label="#{bindings.Particulars.hints.label}" required="#{bindings.Particulars.hints.mandatory}" columns="#{bindings.Particulars.hints.displayWidth}" maximumLength="#{bindings.Particulars.hints.precision}" shortDesc="#{bindings.Particulars.hints.tooltip}" id="it7"> <f:validator binding="#{bindings.Particulars.validator}"/> </af:inputText> <af:inputText value="#{bindings.Amount.inputValue}" label="#{bindings.Amount.hints.label}" required="#{bindings.Amount.hints.mandatory}" columns="#{bindings.Amount.hints.displayWidth}" maximumLength="#{bindings.Amount.hints.precision}" shortDesc="#{bindings.Amount.hints.tooltip}" id="it8"> <f:validator binding="#{bindings.Amount.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.Amount.format}"/> </af:inputText> </af:group> <f:facet name="footer"> <af:button text="Submit" id="b1"/> <af:button actionListener="#{bindings.CreateInsert.execute}" text="CreateInsert" disabled="#{!bindings.CreateInsert.enabled}" id="b2"/> <af:button actionListener="#{bindings.Commit.execute}" text="Commit" disabled="#{!bindings.Commit.enabled}" id="b3"/> <af:button actionListener="#{bindings.Rollback.execute}" text="Rollback" disabled="#{!bindings.Rollback.enabled}" immediate="true" id="b4"> <af:resetActionListener/> </af:button> </f:facet> </af:panelFormLayout> </ui:composition>
Concerning
Go to your VO Wizard, select the tab of the entity and to check if both the EO is editable or not.
See you soon
AJ
-
Compare two tables that have columns of nulls and undesirable in where clause
Table A:
col1 col2 COL3 COL4 col5 col6 ANY
NULL VALUE
NULL VALUE
YES
YES
YES
NULL VALUE
NULL VALUE
YES
NULL VALUE
YES
YES
NULL VALUE
ANY
YES
ANY
NULL VALUE
YES
NULL VALUE
NULL VALUE
ANY
YES
YES
YES
Table B:
col1 col2 COL3 COL4 col5 col6 ANY
NULL VALUE
NULL VALUE
YES
ANY
YES
ANY
NULL VALUE
YES
NULL VALUE
YES
YES
NULL VALUE
ANY
YES
NULL VALUE
NULL VALUE
YES
ANY
NULL VALUE
ANY
YES
YES
NULL VALUE
column values
Yes: Current value
No: Null
All: Junk
Must match all columns in TableA to TableB.
TableA.col1 to TableB.col1
.
.
.
TableA.col6 to TableB.col6
Any help is very appreciated
Thank you
Based on your last post that only good data must match exactly and your definition of junk:
WHERE (decode (substr (A.col5, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ', "junk," A.col5 ") = decode (substr (B.col5, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ',"junk", B.col5"))
AND (decode (substr (A.col6, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ', "junk," A.col6 ") = decode (substr (B.col6, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ',"junk", B.col6"))
And so on for the six columns. This assumes that this junk * still * starts with a ~. In addition, it assumes that the unnecessary and null words are not in the form of good data.
-
two elements that have the same source
Hi guys,.
I am trying to use the display on a Google Map plugin location. As I had this plugin requires two elements that have the same source:
Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
2 - Google Map plugin ELEMENT to visualize on the map. The source of this issue should also be "Map" the column that is used to read the address.
But the problem, as you saw, we can not create a new record if we have two items with the same source. How can I get around this?
Here is the link to the plugin:
http://Apex.Oracle.com/pls/Apex/f?p=plugins:LOCATION_MAP:2943553726537511
Kind regards
Fateh
Published by: Fateh July 21, 2011 02:52Hi Fateh,
Tried the plugin you mentioned! Had a preview of your problem.
>
I am trying to use the display on a Google Map plugin location. As I had this plugin requires two elements that have the same source
>
As your form seems to be running automatic process line processing DML that will obviously give an error if you have two items
with the same source i.e. 'MAP' that is your database column.
>
Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
>
I think that this point is already with you as you may have created form based on a Table or form and report based on a Table.
Leave the source of this article because it's IE card - the database column.
>
2 - Google Map plugin ELEMENT to visualize on the map.
>
Change the source of this article as:
Source type: static assignment (value corresponds to the source attribute)
Source of value or expression:&P1_ADDRESS.
Where P1_ADDRESS is the element:
>
Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
>I hope that helps!
Kind regards
Kiran -
Hi guys,.
I have the schema name but who want to find the names of all tables which do not have all the data, perhaps no records = 0.
I also want to find then of these tables that have names of data columns and then I want a search on that columns with column name
Need help. Your help would be really appreciated.
Thank you
If the statistics are correctly collected in the schema, then:
select * from user_tables where num_rows=0 -----> (you may user all_tables/dba_tables);
And I do not understand your second question.
I also want to find then of these tables that have names of data columns and then I want a search on that columns with column name
Not sure if this is what you need...
SELECT * FROM user_tab_cols WHERE table_name IN (SELECT table_name FROM user_tables WHERE num_rows <> 0);
See you soon,.
Manik.
-
How to find the names of tables that have more than 100 columns
Hi gurus,
Please help me find the names of the tables that have more than 100 columns in the database.Below will be useful for you.
SELECT atc.OWNER,atc.TABLE_NAME,count(*) FROM all_tab_columns atc GROUP BY atc.OWNER,atc.TABLE_NAME HAVING count(atc.COLUMN_NAME) > 100
Adding another point, you can use user_tab_columns, all_tab_columns, dba_tab_columns, based on your needs/access.
Thank you
SuriPublished by: Suri on February 23, 2012 11:30
-
I need to implement Drag N Drop between two tables that saves the two records
I need to implement Drag N Drop between two tables that saves the two records on a third page, using drag 'n drop.Check out this video http://baigsorcl.blogspot.com/2011/01/drag-and-drop-collection-in-oracle-adf.html
-
How to list all the tables that have no data
Hi all
I want to list all the tables that have no data. (registration number is 0)
Someone help me.
Thank you
Thiensu2810Select owner, table_name from dba_tables where num_rows = 0;
This assumes that the table statistics are COMMON.
-
Find all tables that have not at least a DATE column
DB version: 10 gr 2
View user_tab_cols using, how can I find the tables that have not at least a column of DATE(user_tab_cols.data_Type='DATE')?SELECT table_name FROM user_tables WHERE table_name NOT IN ( SELECT DISTINCT table_name FROM user_tab_cols WHERE DATA_TYPE = 'DATE' );
Concerning
Arun -
Original title: Windows Live Mail 2011
I found already read the Emails that have been deleted, back in my 'box' and marked unread.
Also the subdirectories, I created my "inbox" which contained Emails for retention, disappeared.
I was informed by Microsoft that Windows Live Mail is no longer supported by Microsoft.
Can anyone help?
Try asking in the Forum Windows Live Mail:
http://answers.Microsoft.com/en-us/windowslive/Forum/LIVEmail?tab=threads -
How can I join two tables that belong to two different databases?
I can build a SQL query in SQL Server Management Studio, which performs a join of a table in a database with a table in another database. I have a good 'read' name to username/password for the two databases.
How to do the join in ColdFusion? The tag < cfquery > requires a unique data source. I could do like two queries and through comparing, or maybe even some use dbtype = query, but it would be horribly less effective than a direct join.
I could place the SQL statement in a stored procedure, but that seems like overkill - all the necessary number of fields in the "WHERE" clause will change based on the logic of the ColdFusion program.
Does anyone know of a way to do this with < cfquery >?
How do you take in SQL Server Management Studio? You must do something that I'm not aware, if what you're doing here does not work in a
block. The way I did in the past is just to fully qualify the names of the tables. Server.databaseOwner.database.table know if I remember correctly.
This does not require that the database connected to the name of data source is configured to be allowed to connect to the database.
-
Applications leave right after opening, cannot be updated. Yes, tried on each option on many forums. Easy to follow instructions or a GOOD prosaic site?
You have JAVA SE 6?
Download Java SE 6 Direct:
http://support.Apple.com/kb/DL1572
CS5 is legacy software. He was never certified to run on El Capitan. It might work, but again, he could not.
The last update for CS5 is released in 2011 in support of the browser lab. But the lab browser servers have been offline in 2012. There are more. For what it's worth, the link for updates can be found below, but I don't think it will be very useful for you.
Adobe - Dreamweaver Support Center: Updaters
Students & qualified teacher can go down the creative cloud 60 percent Plan.
Nancy
-
Pay your bills online. I suddenly can't pay them through Mozilla, even if I can pay through Explorer. Why has this happened? The two companies say it's my browser.
Hello, please try to reset firefox and see if that can solve the problem...
-
My two 'Favorites' folders have become different. I'm worried and how
I thought as the 'Favorites' folder under library "Documents / My Documents/favorite was just a mirror of the Favorites folder copy real slot" users/David (that's me) / Favorites. " But mine are very different.
I tried to sort the items in one of the favorite folders, but I guess I don't know that I actually changed until I suddenly discovered that they are now both quite different. Important to me that they are different, and how can I get them back to being the same?
THX
David
Which shouldn't be the case either. On a Windows installation, the favorite folders is normally lies in the "username" folder, such as your forces be something like c:\users\sabredave\favorites
But it is little matter, all you are concerned about now is fixing. In this case, you can just drag - drop where you want it either, or even delete one you don't want. One inside your username folder is used by your operating system when you add a favorite (bookmark) in Internet Explorer. One inside the Documents folder might have just an error, a wrong file copy job, or even just a mistake with a drag-and-drop at one point.
-
the system I use is vista. the internet is bell sympatico.
Does that mean that you are using Windows Mail, which is the e-mail provided in Windows Vista program or you are using an e-mail program provided by your service provider Internet, Bell?
If it is Windows Mail, try this: http://www.ehow.com/how_5984806_recover-e_mails-windows-mail-vista.html
Maybe you are looking for
-
I put this rom on my phone and my tablet. Great Firefox œuvres, but cannot find anywhere to open a menu to change any settings. Any help would be greatly appreciated. I have not had any problems on any other roms Terry
-
I'm on vacation and I'm trying to free up space on my iPhone 6, it keeps thing me I have 0 space, why?
-
will not display list of program when I hit start menu
When I hit the computer button all programs will not display any installed programs, weird!
-
Question Z10 blackBerry OS 10.2.1.2941
Hi guys, last week I received auto notification update software for 10.2.1.2941, I did it via wifi. Since then now, I am faced with a series of question, my mobile battery will not be charged more than 70% BBM, which is app application and the messag
-
My computer is a total mess. I BELIEVE THAT IT IS DUE TO TE VIRUS OR MALWARE THAT SPEAK
My computer is a total mess AND I can't UNDERSTAND WHAT O DO - I THINK it IS IN REASON OF TE VIRUS or MALWARE THAT PEOPLE TALK ABOUT AND I'M NOT SURE what MY NEXT STEP SHOULD. IT WAS ANNOUNCED THE NEWSPAPER TV TE DAS SEVERAL THERE THAT MICROSOFT HAD