14,606 questions
429
votes
10
answers
109k
views
Is storing a delimited list in a database column really that bad?
Imagine a web form with a set of check boxes (any or all of them can be selected). I chose to save them in a comma separated list of values stored in one column of the database table.
Now, I know ...
415
votes
56
answers
901k
views
Storing Images in DB - Yea or Nay?
So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.
What do you think ...
2425
votes
19
answers
855k
views
What is the "N+1 selects problem" in ORM (Object-Relational Mapping)?
The "N+1 selects problem" is generally stated as a problem in Object-Relational mapping (ORM) discussions, and I understand that it has something to do with having to make a lot of database queries ...
1624
votes
8
answers
351k
views
What are the options for storing hierarchical data in a relational database? [closed]
Good Overviews
Generally speaking, you're making a decision between fast read times (for example, nested set) or fast write times (adjacency list). Usually, you end up with a combination of the ...
539
votes
8
answers
449k
views
Best way to store password in database [closed]
I am working on a project that has to have authentication (username and password)
It also connects to a database, so I figured I would store the username and password there. However, it seems like ...
312
votes
17
answers
123k
views
Why is SELECT * considered harmful?
Why is SELECT * bad practice? Wouldn't it mean less code to change if you added a new column you wanted?
I understand that SELECT COUNT(*) is a performance problem on some DBs, but what if you ...
1899
votes
29
answers
3.6m
views
Insert into ... values ( SELECT ... FROM ... )
I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the ...
79
votes
5
answers
160k
views
How to populate options of h:selectOneMenu from database?
I am creating a web application, where you have to read a list of objects / entities from a DB and populate it in a JSF <h:selectOneMenu>. I am unable to code this. Can someone show me how to do ...
6
votes
2
answers
3k
views
Is there any rule of thumb to construct SQL query from a human-readable description?
Whenever there is any description of query in front of us, we try to apply heuristics and brainstorming to construct the query.
Is there any systematic step-by-step or mathematical way to construct ...
893
votes
25
answers
308k
views
MyISAM versus InnoDB [closed]
I'm working on a projects which involves a lot of database writes, I'd say (70% inserts and 30% reads). This ratio would also include updates which I consider to be one read and one write. The reads ...
372
votes
10
answers
401k
views
How to use multiple databases in Laravel
I want to combine multiple databases in my system. Most of the time the database is MySQL; but it may differ in future i.e. Admin can generate such a reports which is use source of heterogeneous ...
2907
votes
7
answers
1.1m
views
How does database indexing work in reality? [closed]
Given that indexing is so important, as your data set increases in size, how does indexing work at a database-agnostic level?
For information on queries to index a field, check out How do I index a ...
685
votes
25
answers
553k
views
How can I insert multiple rows with a single statement in SQLite?
In MySQL you can insert multiple rows in a single statement:
INSERT INTO 'tablename' ('column1', 'column2') VALUES
('data1', 'data2'),
('data1', 'data2'),
('data1', 'data2'),
('data1', ...
278
votes
4
answers
157k
views
Entity Framework and Connection Pooling
I've recently started to use the Entity Framework 4.0 in my .NET 4.0 application and am curious about a few things relating to pooling.
Connection pooling as I know is managed by the ADO.NET data ...
-4
votes
1
answer
2k
views
Normalization in database management system
How do I normalize this relation?
Emp_project(SSN,PNum,Hours,Ename,PName,Plocs)