Tagged Questions
2
votes
0answers
40 views
Best way to rename existing unique field names in database?
I have a database table that contains id, filename, userId
id is unique identifier
filename should also be unique
table may contain >10000 records
When a user uploads a file it should be ...
0
votes
0answers
39 views
Database model for keeping track of likes/shares/comments on blog posts over time
My goal is to keep track of the popular posts on different blog sites based on social network activity at any given time. The goal is not to simply get the most popular now, but instead find posts ...
0
votes
0answers
7 views
How to manage primary key while updating [closed]
In the following table primaryKeyColumn is primary key.
To maintain the data history I always uses the values with WHERE condition(WHERE StatusColumn=1) And will set the StatusColumn to 0 if the data ...
1
vote
2answers
89 views
Configurable tables in sql database
I have the following tables in my database:
Config Table:
======================================
Start_Range | End Range | Config_id
10 | 15 | 1
...
5
votes
1answer
268 views
Is inline SQL still classed as bad practice now that we have Micro ORMs?
This is a bit of an open ended question but I wanted some opinions, as I grew up in a world where inline SQL scripts were the norm, then we were all made very aware of SQL injection based issues, and ...
2
votes
2answers
218 views
Using Autoincrement Primary keys as Foreign Keys
When creating a table, there is an option for us to set the numeric primary key as autoincrement where it's value increases whenever a new data in inserted.
This primary number can be used for ...
0
votes
2answers
138 views
Best practices for rotating large datasets?
[edit]Turns out there's 1.5 million records... The SQL database is taking about 17-20 seconds to run the query. Would it be best to have Java handle the joins and rearranging in that case? Since this ...
1
vote
1answer
70 views
What's the best approach to building a db schema for profile, but to track changes?
I'm working on a site where companies can create a profile then add locations for each profile.
Those first two tables are simple enough.
But any changes to their profiles or locations have to go ...
4
votes
2answers
358 views
Logic design question for SQL query
Was wondering if you could help me on a SQL problem I’m having.
I have a set of records of events where each event has a start time and end time. No event has the same start time, and the end time ...
4
votes
4answers
624 views
C# Minimal SQL Database
I'm working on a small project (not production) where I'm needing to store enough data that something like a CSV would be inefficient to process and an SQL/MySQL server would be too much. Does .Net ...
10
votes
5answers
574 views
At what size of data does it become beneficial to move from SQL to NoSQL?
As a relational database programmer (most of the time), I read articles about how relational databases don't scale, and NoSQL solutions such as MongoDB do.
As most of the databases I have developed ...
0
votes
2answers
188 views
ACID compliant Database that isn't NoSQL? [closed]
I'm not necessarily asking if a NoSQL database can be ACID compliant, which has been asked here:
Is there any NoSQL that is ACID compliant?
I'm wondering if we have a database either now or in the ...
2
votes
3answers
137 views
Referencing countries via Foreign Key Constraint
To make things simple to explain: I've got two tables: Table1 and Countries.
The Countries table contains a nice flag and some information, such as DisplayName, the ISO3166 ALPHA3 code and the phone ...
2
votes
1answer
197 views
Designing a universal database driver class
I have a homebrew MVC framework that I have been using for a while, and it has been working great, but I am planning an upgrade to it for its ORM classes. So far, it only supports SQL databases by ...
0
votes
4answers
199 views
Create a database for database tables
I'm working on a project where I have to give users the ability to build their own tables,
each user can create more than one table.
(the type of all data is string).
The user can create a table and ...
10
votes
4answers
1k views
Why do relational databases only accept SQL queries?
As far as I know, most relational databases do not offer any driver-level API for queries, except a query function which takes an SQL string as an argument.
I'm thinking how easier it would be if one ...
100
votes
13answers
33k views
Why use a database instead of just saving your data to disk?
Instead of a database I just serialize my data to JSON, saving and loading it to disk when necessary. All the data management is made on the program itself, which is faster AND easier than using SQL ...
1
vote
1answer
170 views
Database data structures for RESTful api
I am creating a RESTful API. I am struggling to decide on the best way to design my database tables around my resources.
Initially, I though a table per resource would be a good way to go, but I'm ...
2
votes
2answers
723 views
Why is NoSQL better for this scenario?
Hypothetical scenario: Let's say we are downloading JSON from Facebook with details of a user's friend's checkins, posts, etc... These come in as one document per friend per activity, so with 8 ...
1
vote
1answer
116 views
Is Neo4j graph database sufficient to itself for all query types?
Neo4j eases relationship traversals => especially useful for a social network for instance.
But are there any scenarios when it's advised to associate an additional relational database (or other ...
7
votes
4answers
1k views
Database History Table / Tracking Table
Currently I want to structure a tracking/history table like this:
PrimaryKey - ID
OtherTableId - fk
fieldName - name of the field its tracking
OldValue
NewValue
UserName
CreateDateTime
So ...
12
votes
6answers
1k views
Do You Still Need Indexing After Database Normalization
After you have done a good normalization, do you still need to index the table? How is this going to affect the performance? Will it even affect the performance in some way after a good normalization? ...
8
votes
4answers
421 views
Should database queries be abstracted out of the page itself?
When writing page generation in PHP, I often find myself writing a set of files littered with database queries. For example, I might have a query to fetch some data about a post directly from the ...
-1
votes
1answer
289 views
keeping connection open all time in sql
I have developed a Windows application in c# in which multiple users can add some numbers and their name and can view the data entered. The problem that I have is that the sever is on my laptop and ...
5
votes
3answers
468 views
Should we have a database independent SQL like query language in Django?
Note :
I know we have Django ORM already that keeps things database independent and converts to the database specific SQL queries.
Once things starts getting complicated it is preferred to write raw ...
4
votes
4answers
320 views
Designing a Database Application with OOP
I often develop SQL database applications using Linq, and my methodology is to build model classes to represent each table, and each table that needs inserting or updating gets a Save() method (which ...
7
votes
4answers
995 views
Best C# database communication technique
A few days ago, I read an answer stating that writing queries within your c# code are long gone.
I'm not sure what the specific person meant with the comment but, it got me thinking. At the company ...
11
votes
4answers
551 views
TDD with SQL and data manipulation functions
While I'm a professional programmer, I've never been formally trained in software engineering. As I'm frequently visiting here and SO, I've noticed a trend for writing unit tests whenever possible ...
6
votes
2answers
501 views
Best method to implement a filtered search
I would like to ask you, your opinion when it comes to implement a filtered search form. Let's imagine the following case:
1 Big table with lots of columns
It might be important to say that this SQL ...
0
votes
1answer
2k views
how to compare two large sets of data using PL/SQL?
I have two different tables in two separate databases with around 1.5 million records each. (BTW: im working on oracle databases)
The objective is to check if every record present in table A is ...
2
votes
2answers
253 views
Where should SQL/DB Queries be encapsulated in a software system?
I frequently write small applications (either web based or otherwise) that require heavy database usage. i've attempted various ways of handling where to put the actual sql queries (sort of ad-hoc ORM ...
2
votes
7answers
2k views
What is the best approach for database design with lots of columns?
I am writing a query based financial application. It lets the user to write complicated equations (much like WHERE part of an SQL query) and find companies matching those criteria.
For the above, I ...
0
votes
1answer
151 views
Recommendation for a database to query records with attributes that are arrays or hashes?
I'm building site with a very simple data structure: documents that are nodes that reference other nodes that each have arrays of parents, children and siblings, so the structure is:
Node:
uuid
name ...
4
votes
2answers
162 views
When and how much should we validate input when working with (C)AP storage?
Herein, we consider a server-client architecture. Suppose we keep the details flexible, but there's more than one layer of servers supporting our hypothetical service. The general question is "When ...
52
votes
6answers
2k views
Is this a ridiculous way to structure a DB schema, or am I completely missing something?
I have done a fair bit of work with relational databases, and think I understand the basic concepts of good schema design pretty well. I recently was tasked with taking over a project where the DB was ...
4
votes
2answers
3k views
Why NoSQL over SQL? [duplicate]
Possible Duplicate:
When would someone use MongoDB (or similar) over traditional RDMS?
How well the SQL and NoSQL go head-to-head. I read somewhere that SQL databases are not well for data ...
3
votes
4answers
546 views
Other things to learn for becoming a Database Admin/Developer?
Obviously i'll have to make some sort of choice at what DB i choose to go with (MS-SQL/MYSQL/etc) but this question isn't about that.
The question mainly is what other languages/tools would be ...
2
votes
4answers
413 views
Job market-wise, are more and more companies moving to NoSQL? [closed]
I know NoSQL isn't nearly as mature, but it's been about a year or so since I've kept up with anything recent. Is it still "the future", are companies moving towards this, or are they still stuck in ...
1
vote
1answer
1k views
Size of database a factor for Hibernate vs JDBC?
Do you know if the size of the database (number of tables used) is a factor when choosing between Hibernate and JDBC? Why or why not?
1
vote
1answer
556 views
How to begin writing a relational SQL database [closed]
I was wondering about how databases like MySQL and SQLite are developed to run as quickly and as well as they do.
I'm looking for answers to questions like:
How is SQL token-ized? Do you build an ...
2
votes
2answers
497 views
Database for storing books by grouping, their pages, and the table of contents
I'm looking for a better way to deal with the design I have here, I'm not confident it's really suitable.
To give this some context, lets say we have a bunch of groups, one group could be "SQL", and ...
61
votes
16answers
4k views
Co-worker renamed all of my queries [closed]
I don't know if I should be very irritated or what. I single handedly built over 300 queries for a large database, and developed a naming convention so I could find them later. No one else in my ...
27
votes
11answers
1k views
Why don't relational databases support returning information in a nested format?
Suppose I'm building a blog that I want to have posts and comments. So I create two tables, a 'posts' table with an autoincrementing integer 'id' column, and a 'comments' table that has a foreign key ...
2
votes
1answer
335 views
Active Record library with support for both SQL and NoSQL?
I'm looking for a PHP Active Record library that supports both SQL and NoSQL drivers (mongodb in particular). It doesn't matter if it actually has the NoSQL driver, I can write it myself, as long as ...
4
votes
6answers
126 views
Arguments for storing binary asociations in a single field vs. in a mapping table?
When do you draw the line between relational tables, and fields holding multiple values of a particular type. Let me illustrate in an example below where a PokeMaster can be associated to multiple ...
6
votes
3answers
422 views
Types of databases
I read that there exists three main types of databases
* Transactional (Client-Server database// OLTP database)
* Decision support system (DSS) (Data warehouse database // Data mart // Reporting ...
8
votes
3answers
392 views
How do you handle constantly changing database dimensions?
For the last two months or so I have been looking for solutions or practices to handle release management within databases. I'm looking for what people view as the best process for handling this.
We ...
16
votes
4answers
383 views
Database abstraction — is it being overdone?
After being exposed to numerous database abstraction layers, I'm starting to wonder what the point is of every library inventing their own different paradigm to access data. Picking up a new DAL feels ...
6
votes
6answers
694 views
Is the “One Description Table to rule them all” approch good?
Long ago, I worked (as a client) with a software which use a centralized table for it's codified element.
Here, as far as I remember, how the table look like :
Table_Name (PK)
Field_Name (PK)
Code ...
1
vote
1answer
434 views
DB Schema for ACL involving 3 subdomains
I am trying to design a database schema for a web app which has 3 subdomains: a) internal employees b) clients c) contractors. The users will be able to communicate with each other to some degree, ...