473,805 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which RDBMS checks 1-1 relationship validity?

I mean: which RDBMS

1) allows to declare that relationship is in fact 1-1, and
2) protests when one tries to violate the 1-1 relationship,
that is inserts into a table two records with the same
foreign key?

Thank you in advance.

Marek Kotowski
Warsaw
Jul 20 '05 #1
5 1809
Marek Kotowski wrote:
I mean: which RDBMS

1) allows to declare that relationship is in fact 1-1, and
2) protests when one tries to violate the 1-1 relationship,
that is inserts into a table two records with the same
foreign key?


Create a unique index on your foreign key field.

And remember that in MySQL enforces foreign key references only if the
table is stored as an InnoDB table.

Regards,
Bill K.
Jul 20 '05 #2
Bill Karwin <bi**@karwin.co m> wrote in message news:<ck******* *@enews2.newsgu y.com>...

Thank you for the answer.

Create a unique index on your foreign key field.
I was thinking about specifing 1-1 relationship
in CREATE or ALTER TABLE.

And remember that in MySQL enforces foreign key references only if the
table is stored as an InnoDB table.


I know that. AFAIK in 5.0 MyISAM will have the RI enforcing option
as well.

Regards

Marek Kotowski
Warsaw
Jul 20 '05 #3
Marek Kotowski wrote:
I was thinking about specifing 1-1 relationship
in CREATE or ALTER TABLE.


You _can_ say "CONSTRAINT UNIQUE (columnName)" in a CREATE or ALTER
TABLE statement.
Read about it at: http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html

But I think I know what you mean, you want some other syntax that is
specific to 1-1 relationships. No, I don't think there is such syntax.

Regards,
Bill K.
Jul 20 '05 #4
Bill Karwin <bi**@karwin.co m> wrote in message news:<ck******* **@enews3.newsg uy.com>...
Marek Kotowski wrote:
I was thinking about specifing 1-1 relationship
in CREATE or ALTER TABLE.
You _can_ say "CONSTRAINT UNIQUE (columnName)" in a CREATE or ALTER
TABLE statement.
Read about it at: http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html

But I think I know what you mean, you want some other syntax that is
specific to 1-1 relationships.


Exactly.
No, I don't think there is such syntax.
It'a pity. May be next SQL standard will propose
such formal syntax.

Regards

Marek Kotowski
Warsaw
Regards,
Bill K.

Jul 20 '05 #5
Marek Kotowski wrote:
No, I don't think there is such syntax.


It'a pity. May be next SQL standard will propose
such formal syntax.


Well, there's no SQL syntax that explicitly declares a one-to-many or a
many-to-many relationship either. SQL has language the describe the
physical implementation of a relational database. What you're
describing is like an Entity Relationship diagram that describes the
_logical_ relationships, and then enables you to generates a database
based on that.

In fact, there exist several software products that do this.
For instance:
http://solutions.mysql.com/search.php?q=diagram

Regards,
Bill K.
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2771
by: Hari Om | last post by:
I am using Oracle 9.2.0.1 on IBM AIX 5.1 box. It seems that when I install ORACLE, it gets FULLY LOADED with all the SCHEMA's - wonder why. Following SCHEMAS are availavle when I checke din OEM - but which of these are "actually" needed and which are not needed and can be deleted safely without affecting normal DB functions. Here is a LOADED list: CTXSYS, HR, MDSYS,...
1
1832
by: Marek Kotowski | last post by:
I'm preparing short dictionary and this is the question: are 'RDBMS' and 'database server' synonyms? If not, what are the differences? Thanx in advance. Regards Marek Kotowski Warsaw
3
3376
by: Jason | last post by:
Suppose you have two (or more) tables with foreign key constraints. My question is thus: Is it better to check if the fk exists before you try to perform the insert or let SQL do it for you? On one hand, if you check yourself and the key does not exist you can gracefully handle it (maybe exit out of method with error). If you let SQL do it, the server will throw an error which cannot be suppressed.
17
2580
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this with a link to old information that suggests use of "navigator": http://developer.irt.org/script/43.htm
4
1971
by: cartoonsmart | last post by:
My problem is described here in detail http://members.home.nl/cartoonsmart/ any help, suggestions are very welcome K.R
122
7932
by: seberino | last post by:
I'm interested in knowing which Python web framework is most like Ruby on Rails. I've heard of Subway and Django. Are there other Rails clones in Python land I don't know about? Which one has largest community/buzz about it?
43
2914
by: sinister | last post by:
Is MS Access a true RDBMS?
1
3524
by: Rasheed | last post by:
We are building a smart client application (.NET 2.0) which uses Web Services to access the business objects. Services: The Web Services have been secured by brokered authentication using X509 certificate along with message level security. (Right now the web services are consumed only by the smart client application in intranet environment. However, few services would be exposed as enterprise services in future. Such services can be...
9
1648
by: Andy Dingley | last post by:
Here's a chunk of a longer piece of punditry I'm working on, re: the choices between doctypes for authoring and the State of the Union for validity. I've got a bucketload of nasty code and a bunch of developers who need education on validation, validity and all the usual good stuff. In particular it's a problem of triage on the legacy code: what's correctable now, what's going to need serious work, what's going to be a total re-write. ...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10614
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.