Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wufoo's Database Schema - How would you design it?

Wufoo is a:

HTML form builder that helps you create contact forms, online surveys, and invitations so you can collect the data, registrations and online payments you need without writing a single line of code.

How would you approach the database design if building a similar site?

Higher level designs (tables and relationships) or Lower level designs (tables, relationships, fields, views, rules, MySQl queries, etc)... are all welcome :-)

MySQL based solutions preferred ;-)

like image 227
Chris Jacob Avatar asked Jul 21 '09 15:07

Chris Jacob


People also ask

What are the 3 types of database schema?

Schema is of three types: Logical Schema, Physical Schema and view Schema.

What is database schema with example?

In MySQL, schema is synonymous with database. You can substitute the keyword SCHEMA for DATABASE in MySQL SQL syntax. Some other database products draw a distinction. For example, in the Oracle Database product, a schema represents only a part of a database: the tables and other objects are owned by a single user.

What is design schemas of data modeling?

A schema is a collection of database objects, including tables, views, indexes, and synonyms. There is a variety of ways of arranging schema objects in the schema models designed for data warehousing. One data warehouse schema model is a star schema.


1 Answers

This type of database design calls for EAV tables. For example, the form section probably contains:

1. User table (user_id, user_name, etc.)
2. Form table (user_id, form_id, form_name, etc.)
3. Form_field table (form_id, column_id, column_name, column_type, etc.)
4. column_type table (column_type_id, column_type_name)

Filled in results will be saved in a different table:

Filled_form (form_id, column_id, value)

The idea is to create a database model that is just generic enough (but no more than) needed, in order to accommodate for the needs of different users. For example, the column types are set by the programmers, and each type has a different meaning when rendering the form.

like image 189
OmerGertel Avatar answered Sep 30 '22 02:09

OmerGertel