r/DatabaseHelp • • Jan 17 '17

ELI5: Difference between partial and transitive dependency

1 Upvotes

This is something resolved between 2NF and 3NF in relational databases but I have trouble understanding the two.


r/DatabaseHelp • • Jan 16 '17

ELI5: Normalisation: 1NF, 2NF, 3NF and BCNF as well as difference between transitive and partial dependency.

1 Upvotes

Just took up database class and am having trouble understanding these phases. I sorta understand that there are things to check in each stage such as dependencies such as partial in 2NF and transitive in 3NF. I've been googling definitions and checking other online forums about normalisation but still left me pretty confused.

Would live a short and simple explanation for each phase, the sorta things to look for in each phase and the difference between transitive and partial dependency.


r/DatabaseHelp • • Jan 15 '17

Can a database function as a spreadsheet?

2 Upvotes

I work with Excel spreadsheets as part of my day to day work.

I can see various ways of improving them and making them easier / foolproof.

As I sit at night thinking about it I thought the best way would be for me to take on a project and learn to code it, so that certain tasks can be done by clicking a button.

As more thought goes into it I realise that a database would be needed and then I code certain behaviours and the look.

So I start to think about how to learn and plan a database. As I look into it and think about how it performs I cannot find a decent answer to the question of this post.

As an example, let's say I have 20 columns in my table. If I change a value in column 2 can a database be coded so that column 5 10 and 15 automatically change to reflect these changes. So the user sees the change straight away.


r/DatabaseHelp • • Jan 13 '17

Suggestions for browser-based database with GUI for data input.

2 Upvotes

I'm working for my friend's company, which is involved in biodegradation of food waste, so every day we have to carry out inspection of various aspects of the system; the data is then entered into a spreadsheet kept on google drive for record-keeping and analysis.

I've been asked to take care of switching from the spreadsheet to a database because the spreadsheet is becoming time-intensive for data entry, among other issues. The requirements are that the new database can be accessed via web-browser; that data collected that day can be easily added to the database through a GUI; and that various predefined statistics and graphs can be displayed from the data in the database.

The issue with all of this is that I don't really know anything about databases; I can write script in python, and I know a little bit of SQL, but that's it. I have no idea where to start, or what I need to be looking into, so any help at all would be appreciated.

I've found multiple options for having an online database as Software-as-a-Service, but I have no idea what to do about the GUI, or how to putting all of these different aspects together.

How should I start working on this problem? Given my level of experience how long should it take me?


r/DatabaseHelp • • Jan 13 '17

Mapping a Large Number of Tables

1 Upvotes

I have the task of mapping a pretty large database schema (~250 tables). I can have Visio reverse engineer the database in pieces, but there are just too many tables to have it map the entire database. Is there other software out there meant to handle bigger databases?


r/DatabaseHelp • • Jan 12 '17

Making a check in/check out database system for a chartroom

1 Upvotes

I plan on making a database for our chartroom and I want to make it so that the chartroom workers can checks charts in and out easier than using the spreadsheet they are now.
The database itself shouldn't be to difficult. Client table, location table and transaction table. I want it to be easy to use for non techie people. We use windows on the computers. I will probably be using Microsoft Access for the backend. For the front end I don't know which would be better. Making a form on Access or using Visual Basic and link it into the database. I want them to be able to open up the program and have the homepage where they can search for a chart and be ready to go. I don't want them to have to set anything up. Any help would be appreciated.


r/DatabaseHelp • • Jan 11 '17

Database design help for tracking historical documents, locations, and the people living therein

3 Upvotes

I am an historical researcher and spend a lot of time reading old manuscripts dealing with native settlements and Indian traders. I currently have a spreadsheet detailing my transcriptions, sources, and the related data on the Indian settlements, important Indian individuals, and traders within those settlements, as well as geographic data. It contains roughly 11,000 rows at this point and I want to take it to the next level. I am currently designing my database tables and their relationships and would love some help since I've never done this before. I'll link you to the preliminary design diagram I drew up and just go through my needs/thought process, table by table. I also have $10 to spare for someone to spend 30 minutes with me on Discord if that is preferable. Link to schema: http://imgur.com/a/JahOH [edit: oops, ignore the unlinked foreign key I accidentally left in the Settlements table]

  1. All transcriptions must be linked to at least 1 settlement (or to an individual who can be linked to a settlement). The aim of the database is to track towns and villages mentioned in historical texts.
  2. If a transcription also contains references to Indian leaders or traders living within a settlement, the transcription should also link to those individuals, and those individuals should link to a settlement. The secondary aim is to track individuals residing in those historical settlements.
  3. My questions lie mostly in the relations between tables. A single transcription entry can contain references to multiple settlements, traders, or Indian leaders, and a single settlement or individual appears in many transcriptions (many-to-many). I do my best to break these up into single occurrences, but sometimes I cannot. One trader can have licenses in multiple settlements and more than one trader can be licensed per town (many-to-many); also, Indian leaders can have lived in more than one place throughout their lifetime and each place has multiple leaders (many-to-many). This is mostly where I think I need your expertise. It seems like the way I have it set up there will have to be separate join tables for 1) each settlement - one for Indians, one for traders, and one for transcriptions; 2) each transcription - one for settlements, one for Indians, and one for traders. Am I looking at this the right way? To make it analogous to other database examples, it seems like each transcription entry is an 'order' which contains a 'customer' (settlement) and 'products' (traders and Indians), but not always both. Also, should I simply make one table for People and set a field for their ethnic description instead of having separate tables for Indians and traders (I want to record different information for each though...)? Relationships: Sources >>one-to-many>> Transcriptions ; Transcriptions >>many-to-many>> Settlements ; Transcriptions >>many-to-many>> IndianLeaders ; Transcriptions >>many-to-many>> Traders ; Traders >>many-to-many>> Settlements ; IndianLeaders >>many-to-many>> Settlements ; IndianLeaders >>one-to-one>> IndianAlias ;
  4. I want this database to lend itself to easy integration with mapping software down the road. Think ArcGIS StoryMaps. Click on a point or polygon on the landscape, up pops a short narrative, and you can hyperlink directly to my database entries associated with that settlement if you wish. Should I have a field designated within my Settlements table for hyperlinked .KML (or similar format) files like I do currently or is there a more efficient way to do this so it plays well with maps through something like CartoDB?

Transcriptions table, Sources table: This is the raw data I draw on and currently enter in my spreadsheet on a daily basis and from which this idea came. It is text-heavy and I want the cells containing the raw transcriptions to be searchable. You'll notice I also have a Sources table (seems redundant, but hear me out). The transcriptions are excerpts/passages from original correspondence and there can be multiple entries from a single source that need to be linked to the individuals and settlements in other tables. Because most bibliographies cite sources with the full page range, my thought is that separate tables will allow individual page numbers to be tied to each passage of transcribed text (for my own in-text citations when writing), while a full citation in the Source table (for my bibliographies) will contain the entire page range. In some cases involving published compilations I may want to cite the original document and author [Transcriptions] and then link it through a relation to the compiled volume with its publisher [Sources]. I keep reading online that duplication in cells means you should break it into separate tables, and I often transcribe 20 different passages mentioning multiple Indian settlements across a single document, so I figure it's more efficient to relate all those entries to a single entry in the Source table. It also allows for my annotations to be paired with a single transcription entry rather than the source as a whole. Is there a better way to arrange this?

Settlements table: This contains the data for the name and physical location of the towns and villages mentioned in the transcriptions. The question I have regarding this table is that of later integration into mapping software. I want this database to eventually lend itself toward viewing point or polygon .KML (or another file format, any suggestions?) to integrate into Google maps or something similar, where users can then link directly to my transcriptions and other info after clicking a point on a map. Think ArcGIS StoryMaps. I'm aware that there are additional hoops I'll have to jump through to get it to that level, but I just want to make sure the geodata is of the proper format and my fields are setup properly in the database so that process is easier down the road. I looked at Google Fusion Tables, which seems pretty straightforward, but that seems to have limited data size, etc.

Traders table, IndianLeaders table: These tables are similar in that they contain the details of specific individuals identified in the historical transcriptions. Entries in the Transcriptions table will link to individuals if/when they are mentioned in a text. Each person should be linked to at least 1 location in the Settlements table, but can be associated with more.

Thanks to anyone who read this to the end and I really appreciate any help. Once again, I am happy to speak with someone directly if I didn't explain my goals or needs well enough.


r/DatabaseHelp • • Jan 10 '17

Advice on creating simple biodiversity database

1 Upvotes

Hi, I want to create a simple database to house biodiversity information for local fish. The database will contain general information about each species (habitat, length range, lifespan, ect), genomic information (barcodes for each specimen caught per species), and catch information (when caught, location caught). I want to embed the database into the a website and make it publicly available, but I have never gone about this before and am not sure exactly which direction to run. The data requirement shouldn't be much as the list of records will only in the 100's and eventually low 1000's. What services to people recommend to those with little experience with in publishing online databases?

The data will likely be relational, but I don't even know if that's a requirement due to the low data requirement.

Just looking for advice.


r/DatabaseHelp • • Dec 18 '16

Import large CSV file into a database and query the database (How to)

2 Upvotes

Total noob here. I have a large csv file that I downloaded and would like to look at the contents and query them. What is a setup that I can use? How do I dump the file into an sql type database and then query it. Do I need to create a LAMP / WAMP / MAMP on my computer, create a new sql database including figuring out all the fields and use PHP code to query?


r/DatabaseHelp • • Dec 14 '16

Critique my Schema

1 Upvotes

This one started out a simple web-scraping project, and is now becoming quite a daunting yet-fun project to a programming/database noob like me.

I'm basically building a database of soccer leagues. And, like in every sport, you have seasons ("2015-2016" and "2016-2017"), and in each season you have different teams (some were regulated/promoted to other leagues), placed in different rankings after different match-weeks/rounds, according to the performance in matches.

Anyway, what I want to do is extrapolate from individual soccer match scores (ex.: "Chelsea FC 2 : 1 Manchester United") the table standings by season. Let's assume that all the data (league name ,season (year), teams names, final score) comes pretty much bundled inside the HTML source page.

Don't ask why I'm not just scraping the individual tables by season, there is a reason =) (example: "Where was team X positioned in the 14th round of the 2004-2005 season?")

I've put together a schema map (Haven't entered any actual columns yet) which I think should do and I'd love some feedback.


r/DatabaseHelp • • Dec 12 '16

Creating a Relational Products / Package Database

1 Upvotes

Hello,

To prefix this, I am stuck using Microsoft Access, or at least relating to it, so my capabilities are a bit limited. I also do not want to use an EAV model.

Some of the business rules I have to accommodate for:

  • Products must have multiple price levels.
  • Products can be stand alone and/or part of a bundle of products.
  • A "product" can also be a service. Such as education.
  • Bundles themselves are not a tangible product, they only contain products and will have 0 price.
  • Products can also be part a package of products. Sometimes they have a different price.
  • Packages can have bundles of products in them. These packages can also have their own special prices for both the individual products and the products inside of bundles.
  • Packages have several "Steps" that require a specific product or bundle. The user must pick an item defined for that step. Think about designing your own vehicle and the "Package" is a truck. The "steps" with variable products would be things like what color body do you want for your truck or what shape body of the truck do you want. Each option being a different product. Stuff like that, that defines the package.

Here is the idea I had to fulfill this.

The problems with this model are:

  • I cannot have multiple prices for bundles in this model. (E.G., we sell a bundle to resller A for price X and resller B for price Y).
  • Packages cannot override bundle prices in this model.
  • Querying seems a bit difficult.

I looked at Magento's ERD, and would much prefer a relational model database. I do not want to use EAV, as I feel that would be overkill for what we need anyway, and seems like a real headache to deal with.

Do you have any ideas or suggestions?


r/DatabaseHelp • • Dec 10 '16

Recommendations for Heterogeneous Database Federation

2 Upvotes

Say you're at a company that has decided against implementing a data warehouse for its users (... I know), but the users still need to do ad-hoc and scheduled BI reporting on data that resides in Oracle, DB2, Hive, and SQL Server. What would you recommend?

I understand you may say this requirement is unrealistic and unobtainable, and you may be right. But I haven't gained any traction with management on that route, and I want to do what I can for my users. I have tried a few different tools out, such as:

  • Apache Drill - it kind of worked, but when you join two tables from two different databases, it wanted to "SELECT * FROM table" from each table and then hash-join them in-memory. Not good for very large tables.
  • PostgreSQL with FDW - I really wanted this one to work, but I was having the same kind of issues with query push-down not really working on cross-database joins. Not to mention the JDBC FDW is basically broken, and that was a necessity for hooking up to DB2. The company has also committed to using Oracle, so I can't really roll out a PG solution anyway, unfortunately.
  • Oracle Gateway - management says it's too expensive.
  • JBoss Data Virtualization - I'm still just trying to get this setup, since I'm not a developer by trade and this is a bit of a heavy lift for me. I like the idea in concept though, and I haven't given up on it yet.
  • H2 with Linked Tables - this definitely did not work that well when it came to table joins.

So I guess the rub here is that getting the databases connected isn't really the obstacle here. It's obtaining usable table join performance over the wire using efficient query push-down. Anybody have any thoughts on this?


r/DatabaseHelp • • Dec 10 '16

Help with database relationships in access

1 Upvotes

I'm working on a project that needs to resolve a many-to-many relationship into at least 2 one-to-many relationships. I've got a current database that seems to be setup to do this. Is there anyone that could take a look at it and tell me what I'm doing wrong?


r/DatabaseHelp • • Dec 10 '16

What technology to use?

1 Upvotes

Okay, so I'm currently trying to develop a tool for searching a large dataset (units from a game, if it helps). The problem is that i Can't quite figure out what database technology is should use. I've worked with SQL databases before, but they seem rather clunky for the task.

The task: Each data entity (a game unit) has 4 connected sub-entities (abilities). Each of these sub entities has any number of attributes (effects) associated with it. These attributes are pulled from a defined list of possible attributes (all game effects), but any given sub entity could have any number of them. Each attribute instance for a sub-entity has 1 or more associated numerical properties, specific to that entity-attribute pair (Percentages & values associated with the effect).

What i want to do is be able to perform a search on all entities (units) on the criteria of one of their sub-entities (abilties) having a given attribute (effect), and sorting on the numerical properties (effect strength, etc.).

I could make it work in SQL, but it feels like an inelegant solution, to be honest. MongoDB seems like an option, but i'm not familiar enough to anticipate problems. Is there a database technology out there that is well suited to what i'm aiming for?


r/DatabaseHelp • • Dec 08 '16

Is this the correct way to handle survey answers?

1 Upvotes

r/DatabaseHelp • • Dec 08 '16

Where to start learning Oracle?

1 Upvotes

Hello Reddit, please point me in right direction. I am a complete newbie when it comes to DB and have never worked with them before. I have opportunity to start working as Oracle DB admin and I need to educate myself in the shortest time possible for the basics of it. I started reading Oracle 12c for Dummies but I do not find that book very helpful. Do you have any suggestions what can I try as a complete newbie? I need to get solid grasp on concept of DBs and implement it via Oracle 12c.


r/DatabaseHelp • • Dec 06 '16

What Shall I Use for my Organisation's Database & Apps?

1 Upvotes

My organisation's data is a mess - all spread out over 100 spreadsheets, work processes heavily involve printing and scanning and emails... They are in dire need of a relational database.

The trouble is, there's a no 3rd party data policy. This means my 1st choice is not allowed (SaaS options like Teamdesk, Zoho Creator, caspio, etc.). It would have to be a self-hosted solution.

I've been using an sqlite db and some lightweight python scripts for data import & export to great effect in my small team, however I'd like to expand it for use in multiple offices. My basic knowledge of python and sql is the best chance we've got.

What I'd really like is a very simple database & form builder with access control & user groups that can be self hosted, but I'm not really finding anything decent or popular after extensive searching.

At the moment I am thinking that our best shot would be a self hosted MySQL or MS SQL database with web apps produced to provide basic CRUD using flask for a web framework. I'm also considering using MS SQL with something like Sharepoint or Access for data entry & viewing, but I'd really like to keep it on the web as we pretty much have no IT department that can babysit / troubleshoot software installation.

The purpose of the database would be initially to keep all reports made by everyone, to be viewed by department or by staff involved or by month etc. etc. with a good permissions system for obvious reasons and ideally commenting & resolving. Then I'd like it to track details of procurements, with email updates when the next person is required to approve the purchase. I'd like that all to tie in to a staff table, which is also tied in to asset assignment... You get the picture - very much organisation wide with a lot of flexibility.

I think trying to develop this purely in SQL and python is going to be a real uphill struggle. Any advice, shortcuts or suggestions? Is there anybody else here who solely develops and manages an organisation's database? How do you do it?

Thanks for any info!!!


r/DatabaseHelp • • Dec 02 '16

Looking for an SQL database viewer with filtering capabilities

1 Upvotes

I use HSQLDB, and use it like a log.

I would like to be able to view tables in it and type in a box to filter the rows to those that match.

Does anyone know of any good free software that can do this?

thanks.


r/DatabaseHelp • • Dec 01 '16

[Oracle] Need help creating a multiplication table using SQL loops

1 Upvotes

So I want to create a procedure that will use loops to create a multiplication table based on a user-inputted value between 1 and 10. For example, if I put in the value "3" as a parameter for the procedure, the output would be:

1 2 3

2 4 6

3 6 9

How can I accomplish this using loops in Oracle SQL?

Edit: I should add that this should be outputted to the DBMS Output window


r/DatabaseHelp • • Dec 01 '16

Database design help

2 Upvotes

So I have a database project I could use help on, the requirements are:

The library patrons’ data should include:

Library card number

Last name

First name

Address

City

State

Zip code

Phone

A book record should include

  1. Book ID
  2. Book Title
  3. Author’s last name
  4. Author’s first name
  5. Year of publication
  6. ISBN

Include forms to:

  1. Enter new patrons
  2. Enter new books
  3. Facilitate book checkouts/checkins (see example) (note, the due date should be auto calculated to be two weeks after the check-out date)

I am thinking I need three tables patron, book, and check out. Any help would be much appreciated.


r/DatabaseHelp • • Dec 01 '16

Video series that explains database modeling concepts?

3 Upvotes

I'm an online student taking a Database Systems course. Unfortunately, because it's online only, most of our classwork depends upon reading large quantities of text. Due to a medical condition that makes it difficult for me to fully retain information in this way, it takes me forever to get through all of the reading I have to do, and I'm starting to seriously fall behind in my coursework.

I was having the same issue in my math classes, and I started watching Khan Academy videos as a supplement. The difference has been night and day, and I feel like I'm actually making progress now.

I was wondering if there were any resources like that for database modeling and design? Specifically for ER and EER modeling? They're the only really new concepts that I've been introduced to this semester (I'm familiar with the relational model and primary/foreign keys from taking a course in MS Access previous to this), and they're what's tripping me up the most so far.

If there are no videos to speak of, are there any other kind of multimedia resources you could suggest for someone like me? Thanks in advance!


r/DatabaseHelp • • Nov 28 '16

Export results of a Stored Procedure to a CSV file.

1 Upvotes

I am trying to run a stored procedure and have the results of what it returns saved to a csv file. It is a Sybase database. Any help would be greatly appreciated. Or if any further info is needed I can provide.

Thanks!


r/DatabaseHelp • • Nov 25 '16

How would you design Santa's database?

4 Upvotes

How would you design Santa's database? This would be a first iteration PoC with only the essentials. This would be a first "commercial release" that would go into production, with essential features and some thought put into supporting future features.

What technologies would you use? Architectures? What sort of schema?

The specs for the first iteration would be as follows:

  • 2 billion tracked "users" (amount of children in the world)
  • "events" will be assigned to the users based on their actions that have been recorded by elves, with a niceness value of -1000 (very naughty action) to 1000 (very nice action)
  • Elves will record on average one action per child per day (from around the world, peaks local daytime)
  • Once a year (around 23-24 December) every active user will be determined naughty or nice (boolean) - in this version the calculation is made based only on the events recorded in the last 365 days.

In future versions the users will be expanded to include adults and more events per user per day. Santa will also record historical data - so all events and users will need to be kept for future analysis.

Regarding disaster recovery Santa has a RPO of 24 hours for the initial implementation and needs geographical redundancy (at least for backups).

Santa might not need a full 100% of events to go through, but the elves' clients must know when the submission of an event failed - the clients will then retry. There will also be logic to avoid accidental duplicate events (eg. accidental resubmission).

Santa also needs some sort of HA solution. An acceptable SLA to start with would be 99,9% (max 8h 45m yearly downtime)

Have a nice winter!

Edit: formatting, removed "PoC", this would go into production. added naughty/nice calculation requirement


r/DatabaseHelp • • Nov 15 '16

Relational Algebra [Help]

1 Upvotes

I'm unsure if my query is correct, specifically the join.

Rel 1 = σ CarType = Ford (CARS)

Rel 2 = Rel 1 ⨝ MANUFACTURER - can I join Rel 1 with a seperate entity (MANUFACTURER) even if there are no common attributes between the two? How would I use an equijoin in this situation?

Rel 3 = Rel 2 ⨝ Rel 1

Rel 4 = π idCode,LicencePlate (Rel 3)

Thanks.