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 ...
1
vote
1answer
58 views
Store data for multiple User Type
I am developing an app where four types of user share same module. So is it a good idea to create:
one table and user_type and user_id (something like that)
table prefixes basically 4 diff tables of ...
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
1answer
205 views
Are there any SQL servers that support compiled queries?
Can SQL queries be compiled into byte code or equivalent to enhance performance?
I know that most database servers support prepared statements, but is that the same thing as compiling? Most ...
3
votes
7answers
560 views
OOP (php) for beginners - some unclarities
I started reading some tutorials about OOP, because I want to learn the basics.
I have a question about it. I understand how you can have a object "Car" and give it a color like this ...
2
votes
2answers
394 views
Why OTServs have an item cloning problem if the server crashes? [closed]
OTServs are open source MMORPGs with a huge community. Mostly all of them have a serious problem: if the server crashes, people can clone items. This is a dirty trick that can be executed because the ...
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
5answers
465 views
Is it Considered Good SQL practice to use GUID to link multiple tables to same Id field?
I want to link several tables to a many-to-many(m2m) table.
One table would be called location and this table would always be on one side of the m2m table.
But I will have a list of several tables ...
0
votes
1answer
666 views
How to check for null in most sql's - “column is null” or “column = null” [closed]
I'm not sure of the right syntax to use.
Is it
select * from tlb
where flag is NULL
or
select * from tlb
where flag = NULL
Is the answer the same for oracle, sqlserver and Postgres?
2
votes
2answers
164 views
Better way to search for text in two columns
Here is the scenario. I am making a custom blogging software for my site. I am implementing a search feature. It's not very sophisticated - basically it just takes the search phrase entered and runs ...
4
votes
3answers
318 views
Rule of thumb for field sizes
What VARCHAR sizes should be used for first and last names, phone numbers (preferably international), email adresses, urls, dictionary words and file names?
Edit: Zapped the introductory phrase to ...
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 ...
5
votes
2answers
162 views
Storing stop/start points in a database
Let's say I am storing start and stop points per user into a database table.
For example... let's say in a chat system, a user only needs to see lines 24-293, and 500-512. (Let's say he logged off ...
3
votes
3answers
664 views
Why put SQL statement in a variable before using mysql_query()?
I'm been working with PHP on and off for a bit now, and I've seen plenty of code both ways:
$sql = "SELECT …";
mysql_query($sql);
vs
mysql_query("SELECT…");
Is there a reason for separating the ...
0
votes
1answer
122 views
Which EXPLAIN SELECT is better — the one in PostgreSQL or the one in MySQL? [closed]
Or are the two basically the same when it comes to figuring out how to build the right indexes?