473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Database Design

I have been committed to doing a database based on an application; yet I can't seem to get a proper relationship in. My tables are Applicant - t, Criminal -t, Application - T. Is it possible to do a one to one relationship between these tables? I figure an applicant has or doesn't have a criminal background; an Application is filled out by one person only. I guess the primary keys should be the same from the Applicant - t. I'm not good with one to one relationships. HELP!!! How should I connect these tables?
Mar 23 '08 #1
7 1175
JConsulting
603 Expert 512MB
I have been committed to doing a database based on an application; yet I can't seem to get a proper relationship in. My tables are Applicant - t, Criminal -t, Application - T. Is it possible to do a one to one relationship between these tables? I figure an applicant has or doesn't have a criminal background; an Application is filled out by one person only. I guess the primary keys should be the same from the Applicant - t. I'm not good with one to one relationships. HELP!!! How should I connect these tables?

If its one to one, then put it into the same table.
Mar 23 '08 #2
orangeCat
83 64KB
I have been committed to doing a database based on an application; yet I can't seem to get a proper relationship in. My tables are Applicant - t, Criminal -t, Application - T. Is it possible to do a one to one relationship between these tables? I figure an applicant has or doesn't have a criminal background; an Application is filled out by one person only. I guess the primary keys should be the same from the Applicant - t. I'm not good with one to one relationships. HELP!!! How should I connect these tables?
This info may be useful
Relational Data Base
Mar 23 '08 #3
mshmyob
904 Expert 512MB
As suggested, depending on what you are doing then you can have either a 1-1 or 1 to Many between Applicant and Criminal.

If you do just need to designate if an Applicant has a criminal background then a simple YES/NO field in the Applicant table will suffice.

If you need to say track types of criminal records an applicant has you will have a 1 to Many or a Many to Many depending on other factors.

If you can give us more details (business rules) then we can give you more guidance.

cheers,

I have been committed to doing a database based on an application; yet I can't seem to get a proper relationship in. My tables are Applicant - t, Criminal -t, Application - T. Is it possible to do a one to one relationship between these tables? I figure an applicant has or doesn't have a criminal background; an Application is filled out by one person only. I guess the primary keys should be the same from the Applicant - t. I'm not good with one to one relationships. HELP!!! How should I connect these tables?
Mar 23 '08 #4
The applicant submits only one application. The applicant may or may not have Criminal, Mental, Medical, Alcohol/Drug background. I am unable to make tables or at least whn I get one, the primary keys dont relate.

I had applicantid as the primary key in each one to one table with join #2 but the information does not cross over. When I put every thing in one table I still have problems.
Mar 24 '08 #5
Stewart Ross
2,545 Expert Mod 2GB
The applicant submits only one application. The applicant may or may not have Criminal, Mental, Medical, Alcohol/Drug background. I am unable to make tables or at least whn I get one, the primary keys dont relate.

I had applicantid as the primary key in each one to one table with join #2 but the information does not cross over. When I put every thing in one table I still have problems
Hi. One feature of the relations you describe is that many of them are optional - you may have a one to zero or one relationship (an applicant may not have any criminal record, for instance). Joining the tables in an Access query using a standard inner join (where both fields are equal) will exclude all rows where these optional relations are not filled in - and in the worst case, where all applicants have one or more unfilled options, you will see no rows at all.

Another name for this kind of join between tables is an equi-join - rows are shown where the joined fields are equal. Where there is a null on one side of an equi join there is no equality, so the row is not returned. The relationships are valid - but with equi-joins the whole row is excluded if there is no entry in any one of the optional joins.

What you need to do in these circumstances is to use a left-join in your queries between the Applicants table and all those which represent optional (one to zero or more) relations. This way you will always see the applicant data, and only see the related table data for criminal record etc if it exists.

It is because of such complications that the normal practice in designing database tables is to merge back 1-1 table relations into a single table. There can be very good reasons not to do so, of course, in which case left-joining the optional tables is essential.

Left-joining can be done when you set the relationships (in the relationship window) for the table as a whole, or in the query editor for individual queries. Click on the relationship line to select it, right-click and select edit relationship, Join Type, then change the relationship to 'include all rows from Applicants, and only rows from ... where the joined fields are equal'.

-Stewart
Mar 24 '08 #6
NeoPa
32,556 Expert Mod 16PB
Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

ADMIN.
Mar 25 '08 #7
mshmyob
904 Expert 512MB
Sounds like you don't have a foreign key. You do not join PK's to PK's. Show us your schema.

Do you need to track the type of 'Criminal' record applicants have. In other words do you need to specify the type such as Criminal, Mental, Medical etc.,. Do you need to do counts or reports based on those types.

If so then you would have one table for Applicant with ApplicantID as the PK and one table for Record with RecordID as the PK and in the Applicant table you would have a field called RecordID that links the 2 tables.

This will give you a 1 to Many relationship. Each Applicant can have 1 type of record but Each type of record can have Many applicants.

If you need to indicate multiple types of records then you put a bridge table between.

Does any of this sound like what you want to do. If so we can elaborate a little more for you.

cheers,


The applicant submits only one application. The applicant may or may not have Criminal, Mental, Medical, Alcohol/Drug background. I am unable to make tables or at least whn I get one, the primary keys dont relate.

I had applicantid as the primary key in each one to one table with join #2 but the information does not cross over. When I put every thing in one table I still have problems.
Mar 26 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Rushikesh | last post by:
I am designing a WEB BASED Accounting Software with ASP and SQL Server. For this I need some help for the Database design. My design is as follows. I)User table: User_id, UserName..... Users...
5
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of...
1
by: Lane Beneke | last post by:
All, New to the list and a relative newbie to PostgreSQL. Please forgive stupid questions. Designing an application server for a work order processing (et al) database. I have a good handle...
5
by: trynittee | last post by:
Hello, It's been a while since I've posted. I am an intermediate user of Access. I can read simple VB code, have done complex queries, comfortable with event procedures, designing forms and...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
3
by: vicky | last post by:
Hi All, Can u please suggest me some books for relational database design or database modelling(Knowledgeable yet simple) i.e. from which we could learn database relationships(one to many,many to...
0
by: Laurynn | last post by:
# (ebook - pdf) - programming - mysql - php database applicati # (Ebook - Pdf)Learnkey How To Design A Database - Sql And Crystal Report # (ebook-pdf) E F Codd - Extending the Database Relational...
1
by: abhijitbkulkarni | last post by:
Hello, I am designing a .NET database application that uses 3 tier architecture. Starting initially, this application will be desktop application but I will convert it into a website later but...
0
by: sam | last post by:
Hi, Hope you are doing well !!!! One of our clients is looking to augment their team with “Database Architect – DB2" please find below the details and respond with
2
by: programmerx101 | last post by:
Ok, I'm looking for expert advice on this one. I have a database which keeps going into read_only mode. Sometimes it goes into read_only / single user mode. Once it was taken offline completely....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.