Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 1111

All versions of MySQL (not Microsoft SQL Server). Please also add a version-specific tag like mysql-5.7 if that is relevant to the question.

1 vote
1 answer
3k views

How to serialize a record / row in SQL?

Preferably with MySQL compatibility. I am guessing that xml, a udf or stored procedure might be necessary. is there a way to use xml or json directly in sql/mysql? Thanks! …
Neil McGuigan's user avatar
1 vote
1 answer
1k views

Which Optimistic Concurrency Control method will work out best in the long run?

These are the options I've thought of: DotNet Dave: UPDATE mytable set f1=newval where id=666 and f1 := f1ValueFromSelect Charlie Checksum: UPDATE mytable set f1=newval where id=666 and md5(c …
Neil McGuigan's user avatar
0 votes

Managing features for a real estate agency

If you don't need to sort or search features, then using a CLOB might be fine, storing all the features as XML, which you can still query and is easy to format to HTML. If there are business rules or …
Neil McGuigan's user avatar
2 votes

MySql Database solution for specific web app problem

You could use Nested Set, but CRUD operations are more complex than other patterns, and there's no referential integrity. The Closure Table pattern is simpler to CRUD and supports integrity, but requ …
Neil McGuigan's user avatar
1 vote
Accepted

Database design for surveys in MySQL

Make one table for all surveys. Don't make a new table for each survey. Also, make sure you hash and salt your passwords with bcrypt.
Neil McGuigan's user avatar
1 vote
Accepted

Table Design Cardinality

--this is postgres syntax, but similar for mysql --using single table inheritance for simplicity --organizations (o) and individuals (i) go here: create table parties ( party_id int primary key, …
Neil McGuigan's user avatar
0 votes

Designing database with Category and Tags for Posts - Seeking for guidance/advice

I think you're on the right track. You are using Single Table Inheritance (STI) appropriately here. You could say that a Category is a sub-type of Tag. Categories extend Tag by having a possible pare …
Neil McGuigan's user avatar
1 vote

Dynamically change schema to accommodate custom fields!

Don't use EAV. There's no integrity and it's hard to query. Your best bet is either to simply change the database schema, or to use LOB fields, such as XML or JSON. These are what Martin Fowler recom …
Neil McGuigan's user avatar
0 votes

General structure advice for beginner

There is some redundancy in your design. If you think of a condo building and condo unit as different types of facilities, then you can put them in one table, like this: create table facilities ( …
Neil McGuigan's user avatar
1 vote

Query design for tracking order status

A good start. use InnoDB (or better yet, Postgres). You can use MyISAM slaves if you want full-text search, but otherwise, foreign keys are your friends. watch your under_scores and camelCase. Use l …
Neil McGuigan's user avatar
3 votes

Multiple parents and multiple children in product categories

You should consider Postgres, as it does hierarchical querying better than Mysql. If using Mysql, consider using a closure table to aid querying. …
Neil McGuigan's user avatar
1 vote

Database setup/design for multiple services

good lord, no. read up on multi-tenancy http://msdn.microsoft.com/en-us/library/aa479086.aspx read up on the Party Model http://www.tdan.com/view-articles/5014/ read up on Table Inheritance http:// …
Neil McGuigan's user avatar
1 vote

Is it possible to allow missing value inserts in mysql instead of requiring "NULL" in the qu...

You can use the default keyword instead of null: create table foo ( id int not null AUTO_INCREMENT, name varchar(255), primary key (id) ); insert into foo values (default, 'john doe'); selec …
Neil McGuigan's user avatar
2 votes

Main Purpose of FOREIGN KEY

A foreign key means "ensure the values in this column exist in another column" For example create table sales_orders ( order_id int primary key, customer_id int, ... ); If customer_id does n …
Neil McGuigan's user avatar
2 votes

Difference between backup methods: Oracle and MySQL

Because MySQL is not as mature. … But there are options, such as Percona's (free) hot backup for innodb: http://www.percona.com/software/percona-xtrabackup/ There is also MySQL Enterprise Backup from Oracle, but it is not free. …
Neil McGuigan's user avatar

15 30 50 per page