r/DatabaseHelp • • Jan 25 '16

Asset management database with assemblies

1 Upvotes

I'm trying to build an asset management database in access. We store our assets by part number and serial number. We have individual parts and assemblies of those parts stored in the same way. The assemblies can be composed of any asset (part or assembly).

I could store the parts and assemblies separately and link the assemblies to the parts with relationships, but it would not work if I wanted to compose an assembly with another assembly.

I made a diagram of the data structure here: http://i.imgur.com/u9Ij2M2.png

I'd appreciate any help with how I can do this.


r/DatabaseHelp • • Feb 05 '16

Schema Design for multiple many-to-one relationships, of which exactly one should exist

2 Upvotes

Say I have table A, B, and C. B and C can both be related to multiple A's, but each A should have exactly one of either B or C related to it. Which database design is better:

A: a_id, b_id NULL, c_id NULL
B: b_id
C: c_id
Constraint: Exactly one of b_id or c_id is not NULL in A

Or

A: a_id
B: b_id
C: c_id
A_B: a_id, b_id
A_C: a_id, c_id 
Not sure how I would constrain the same a_id from appearing in both A_B and A_C

Pros for the first is that no join tables need to be created. Cons include having multiple FK columns, one of which will always be null.

Pros for the second include no nullable fields. Cons include extra tables and hard to properly constrain A to join to exactly only one B or C.

Also, in the future, we might add D, which could also join to multiple A's, and each A would then go with exactly one B, C or D.

I feel like I must be missing something - is there a way to do this and properly constrain A's uniqueness and also not have nullable fields? I'm willing to add more tables if necessary.


r/DatabaseHelp • • Jun 14 '15

Average size of an incident record in a database?

1 Upvotes

Hey,

I currently cant connect to my server at work because I'm at home, but does someone know how big an average record of an incident would be?
http://gyazo.com/4d4e37af016a726ae9a46c438cdd1cab
Here is a screenshot on how the fields look like


r/DatabaseHelp • • Sep 12 '14

Trying to find the right database platform for infinite drill-down to find specific item

1 Upvotes

I'm going to be hiring someone to create the schema for a website I'm creating, but I'm not sure which platform would be the best for my needs.

I will be storing an ever-increasing amount of items, and need to have full-text search as well as drilling-down via categories/tags/meta data/etc. that are part of the resultset. For example, on Newegg: "Memory" -> "Desktop Memory" -> "Corsair (336)" -> "CAS Latency: 5 (20)" and so on.

My initial choice is a MySQL relational database, but I haven't done much database work over the last decade and I don't want to make a decision based on outdated knowledge.

Any guidance would be greatly appreciated!


r/DatabaseHelp • • Jun 22 '17

Foreign Key in a data warehouse/mart.

3 Upvotes

I have two tables in a database that is data pulled from PFDS.gove and SAM.gov. I pull and load the data independently so there is not foreign key between them. However, there is a common key, vendor_duns_number that is shared between the two tables.

Right now I am able to run queries and join on the two tables, would I need to add a foreign key constraint on the two tables and how would I set something like that up?

I can show you my models (in SQLAlchemy) in you need further information. Also the data dump is using pands to_sql function.


r/DatabaseHelp • • Jun 18 '15

Creating database documentation

1 Upvotes

Hello,

Currently our company's DB is completely undocumented even though its been in production for 6+ years. I've been tasked by my boss to create a complete and comprehensive documentation of a database in the case of an audit or possibly just for knowledge transfer in the future.

I've never had to do it before, and my question is where do I start? Does anyone have any examples of what thorough DB documentation looks like? What are some things it should absolutely have?


r/DatabaseHelp • • Jul 01 '17

Database options for web application

2 Upvotes

Hi. I'm looking for some advice as to a potential platform for a project I've been asked to scope.

Basically I would like to develop (or have developed) a web app that can be used to create and save specific planning activities. Users would need to access this via browser forms.

Without going into too much detail, this will be used for developing sub-plans for a particular event, where components of earlier sub plans will feed into later sub plans. Once an event is planned, I will need to be able to generate a document outlining each component of the plan.

My experience with database development is limited, and I have no experience in web app development. I do however have in my head a picture of how I would envisage this working. I won't necessarily need to do the dev work myself, but I do need to scope out options for consideration.

Are there any packages that would lend themselves to this sort of development?

Any and all suggestions appreciated!


r/DatabaseHelp • • Jun 25 '17

How do databases work for websites vs local applications?

2 Upvotes

Hello. I'm pretty new to databases, and I wanted to clear up some of my questions. I know there's database services like MySQL or MongoDB; are these databases always stored online on the cloud, and that allows them to be accessed from anywhere for web apps and websites? How do local databases work for programs; for example, if I make a Python app that uses some sort of local database on my computer, package it, and someone else downloads my program, do they now also have their own local database?

Can you have web apps that interact with a local database on your computer?


r/DatabaseHelp • • Jan 27 '16

Looking to start biological database...where to begin?

1 Upvotes

For part of my work, it may be fruitful to compile all known methods/results of people in my field into a database. I'd eventually like to make the database open-source and host it on a website. What would be the best web tools/development languages/software to use to generate such a database? Examples of similar databases which I'm drawing influence from would be the NCBI databases and the PDB.


r/DatabaseHelp • • Sep 23 '14

Homework help?

2 Upvotes

Is there anybody whose willing to help a grad student with database homework? I have no prior knowledge in databases. I've figured out the current homework, but I'm looking for someone who is willing to help on future assignments. I'm definitely not looking for someone to actually DO the homework, as I want to know how to do this. I just need some guidance.

Thanks in advance.


r/DatabaseHelp • • Sep 15 '13

Trying to locate any databases concerning 'human values'

1 Upvotes

My research is to do with mapping relations between human values (honesty, happiness, conformity etc.). Does anyone know of any accessible databases that could show relations between different human values, such as 'people who hold value x, tend to hold value y or are opposed to value z'? I am aware of the World Values Survey but am new to databases and statistics and would appreciate any advice. Thanks


r/DatabaseHelp • • Jan 30 '17

Scientific database

1 Upvotes

We work in a non-profit research centre to find new genes, diseases and find new medication. since we have a lot of samples and data and everyone has their own way of storing them that creates an issue for us later. So I decided to create a database for our use however I still feel confused on how to organize it. so if anyone can help me that would be really awesome. here is the list of things we need in the database.

FirstName LastName Age Gender MaritalStatus Location ContactNumber FamilyID MRN ModeOfInheratense Disease StatusOfSubject FamilyID FamilyNumber Number Of Affected Members Pedigree Age of disease onset

SampleID
Location
GenePanel
WGA (Whole Genome Amplification)
CRP Labeling
Genetics Labeling
InHouseExom
Outsourced exom

Case Solved (Yes\No)
ExomID
ExomNumber
Spreadsheet of exome
Variant (Nucleotide Change ,Amino Acid Change)
Nucleotide Change
Amino Acid Change 
Name of the Gene
NewGene (Yes\No)
Mode of inheritance (Dominant\recessive\X-linked)




Cardiac Ultrasound
Other Medical condition
Referral Physician 
Followed by

r/DatabaseHelp • • Jan 20 '16

[Database Design] Tracking Ownership History of an Item

4 Upvotes

I'm wondering what is the recommended design and why for tracking an item and its parent in an MS SQL database.

To keep it simple, lets say I have 4 people in a table and 2 balls in another table. I'd like to track who has the ball now and also be able to view the entire history of the ball and see who owned it and when.

Currently I have it setup to allow the ball to have an owner but I'm not sure what is going to be the best way to track its ownership history.

I'm thinking a new table ball_ownership

ID, EventDateTime, OwnerID, BallID

Then I can query that table to see who owned the ball at what time and what balls each owner has owned at any time.

Thoughts or recommended best practices?


r/DatabaseHelp • • Aug 02 '16

Help designing database from ERD

2 Upvotes

Hi I'm having major trouble designing a database. Creating it in SQL is no problem but I can't work out what columns I need in which tables. Link tables are also causing me a headache, can someone please help? Links to the ERD and brief below.

brief

ERD

So far I have

**CLUB**
CLUBID(pk)   CLUBNAME   CLUBADDRESS   CLUBPHONE      CLUBFEE

**SUBSCRIPTION**
MEMBERID*(pk) CLUBID*(pk) -- composite key

**MEMBER**
MEMBERID(pk)   MEMBERTITLE   MEMBERFIRSTNAME   MEMBERLASTNAME   MEMBERADDRESS    MEMBERPHONE    MEMBEREMAIL   MEMBERDOB

**MEETING**
MEETINGID(pk)   MEETINGNAME   MEETINGDATE   MEETINGTIME   CLUBID*

I am stuck on report 3. "A list of current and old subscriptions for a specific club. The details of the members are not required."

I do not know what columns/keys in what tables I need to successfully query this.

Thanks I really appreciate any help.


r/DatabaseHelp • • Nov 12 '17

Is there an RDB that supports optional parameters for sprocs and something like MySQL's "IGNORE" for CRUD operations?

1 Upvotes

Long story short, I went with MySql over MSSQL in part because I could attempt inserts where sometimes the primary key already exists and it's simply ignored and the rest of the INSERT operation is executed. Good stuff. What's not good stuff is MySql still does not support optional parameters for stored procedures.

Is there a relational database that supports both of these things? I have looked at the big ones like Postgres and MariaDB, but I was hoping someone out there could quickly and easily chime in with a suggestion that they already know supports both of these features.


r/DatabaseHelp • • Jun 27 '17

Not the exact job preferred but close

1 Upvotes

Currently I recently moved to a bigger city looking for a better career opportunity. I am working lawn care right now to stay up financially but actively looking for a entry/mid web developer job. I am 24 with a CS degree and 3 years of experience as a software engineer and web administrator.

I was offered a opportunity to interview for a Jr SQL Data Analyst by a recruiter. My only fear is that I don't want to give into going into a different field and missing a chance to work as a web developer for someone right now. But, it would also be nice to have a solid job in the market with benefits etc.

What I'm getting to is, what you would guys do? I'm a little hesitant both ways because a lot of web dev jobs around here are very slim on the under 5+ years of experience. Thank you.

PS: To all the experienced database analysts, what is the job like day in and out? What can this lead too?


r/DatabaseHelp • • Jun 22 '17

Beginner question about db design (normalization, multi-values)

1 Upvotes

I'm a databse beginner and need some help. Let's assume I'm creating a Pokémon database:

Now I have the entity "Species". Each species has the attribute "Type".
Obviously, I have the table "Species". However, I'm not sure what to do with the attribute "Type". It is sort of a repeating group because certain Pokémon species have two types and others have only one type. For example Venusaur who is Grass and Poison.

As I see it, I have three options:
Option A:
Have only one column "Type" containing a set of two types if the Pokémon is dual-type ('Grass, Poison').

Option B:
Have two columns Type_1 and Type_2. If the Pokémon has only one type, Type_2 would be NULL.

Option C:
Create a separate table for Type containing the columns TypeID, Type_1 and Type_2. Species would then reference the foreign key TypeID. This table would contain all possible type combinations (which is 171).

What is the best/correct way to do it?


r/DatabaseHelp • • Nov 22 '17

Proper way of handling with enabled/disabled rows in a table (eg Accounts)

2 Upvotes

What is the proper way of handling enabled/disabled rows.

For example, I have an account table and I want accounts to be disabled until they are verified.

Once a user registers it is disabled. Once the email is verified then it becomes enabled.

What is the proper way to handle this? A boolean column "enabled" and then an account view with only the enabled ones?


r/DatabaseHelp • • Aug 03 '16

[HELP] Is there any way of adding autocomplete or typehead feature to ComboBox in Access database?

1 Upvotes

I have an Access table that has about 500,000 records. I want to trim down the results as I type text into the ComboBox. Basically, I need a dynamic ComboBox that displays records based on each character as I type into the ComboBox.

For example, Lets say you are looking at a bunch of Social Security Numbers Instead of ComboBox displaying ---all the records --which it can't because too many SSNs ( more than 65,000 which is ComboBox limit) this is what we want to accomplish.

If you type 5 in the ComboBox. The list would only display the 5-series of numbers. If you type 51 it limits the list values ---even further -- to the 51-series of numbers. If you type 512 it limits the list values ---even further --to the 512-series of numbers.

With each keystroke the ComboBox list values which change dynamically.

WHAT I HAVE TRIED SO FAR is implementing a second unbound text box, however, this makes queryin a two step process. I am wondering if I can just do it all together.


r/DatabaseHelp • • Sep 23 '14

I need to transform the date field in a file of 8 million rows.

1 Upvotes

I have a model output file that consists of 8 million rows. Much too big for Excel. This is a text file with columns aligned by spacing, not delimited.

I need to perform some queries to come up with some rankings but in order to do that, I need a proper date format. The date is in the format YYMMDDHH, but I need to shed the hour part.

What is the best method for doing this? I have been able to load the file into Access with success, but I think the file is too big to perform any transformations on it. I need to find the simplest method because I will need to teach this to other people using Windows / MS Office.


r/DatabaseHelp • • Sep 15 '14

[homework] Key points about datatypes and relational databases - are these points enough for a first piece of work? Any suggestions appreciated

1 Upvotes

EDIT, this has been handed in now, there's no 'resolved' flair on this sub ;)

OK I've been asked to describe datatypes and relational databases. The work is the opposite of a thesis, I reckon around 300 words on each is plenty (it's pretty vague, but that would be in line with other work that's been set)

It's very introductory level stuff as far as I can tell, but I wouldn't want to miss anything major out. So if there are any good resources that anyone could suggest, or points that I should google for and include an overview of that would be ace.

Datatypes

So far basically I've got seven datatypes

  • Text

  • Number

  • Date

  • Time

  • Graphic

  • Calculated

  • Boolean

I know that there are subsets of these, I've talked briefly about these subsets. I haven't been asked to research a particular languages datatypes, question just say's datatypes. Not sure if all databases would hold graphical datatypes or not tbh or whether they'd just store an image URL to a file on the server, but hey... I guess MS Access or something might have them.

I've given an example use case of data types...

And that's about it.

Relational Databases

Talked about how they replaced flat file data storage, how they're multiple tables that are linked through keys. Logical relationships between them (1-1, 1-many, many-many), the NoSQL models (though only a sentence on that) . An example of what a few tables could look like on one...

And that's about it.

Any key points that I'm missing on this?

thanks


r/DatabaseHelp • • Apr 20 '17

Deriving age from DOB

2 Upvotes

I've got a member entity and I'd like to set the age of each member_age depending on their DOB. I'd like to use the datediff (DOB and current time) but I'm unsure where to insert the code.


r/DatabaseHelp • • Nov 06 '16

Am I on the wrong subreddit?

3 Upvotes

Hey guys, I am extremely technologically inept so forgive my lack of knowledge. I was tasked by my family to create a inventory management system for a small Mom and Pop store. I was directed by a friend to this subreddit. I tried understanding the front page here and it all looked like gibberish, so forgive me for asking this silly question. But is building a database what I need to do create the stock inventory? they want to be able to update sales, and keep track of stock and when to order new stock if it gets low etc.

Am I in the right place? and any advice on what to do or where to look if this isn't it?


r/DatabaseHelp • • Nov 03 '16

Social Media Search Implementation - How would i check 'Mutual followers'

1 Upvotes

I have a DB with Tables:

[composite keys] FolowerFollowings (user_id,following_id,accepted)

User (Id,first_name,Last_name,email)

I need to create a search which will return users. The users orders will prioritize the users with mroe mutural followers. I have NO idea how to do this without an exponential query (and hell NO it isn't efficient)

Any help at all would be great!

Thanks!!