A description of the structure of the database - including the structure of the tables, columns, constraints, views, etc, etc... that make up the database.Normally defined in the text, generally SQL in an RDBMS, the schema describes the complete blueprint for the database, defining everything about the database except that data itself.
Questions tagged [database-schema]
2931 questions
0
votes
2 answers
Use optional keys or a catch-all key in MongoMapper?
Suppose I'm working on a MongoMapper class that looks like this:
class Animal
include MongoMapper::Document
key :type, String, :required => true
key :color, String
key :feet, Integer
end
Now I want to store a bird's wingspan. Would…

Ross
- 1,415
- 10
- 10
0
votes
2 answers
How can i get the view count of a post like stackoverflow view counter?
For stackoverflow.com there is a stat for how many views for a question.
How is it tracked? Registered and unregistered user can view any question.
What is the database relation schema for that counting?
Should i just increment the column value for…

cola
- 12,198
- 36
- 105
- 165
0
votes
3 answers
How to design a schema for a website similar to monster.com?
I am developing a website similar to a job seeker's site. There is also a 3rd party involved here as well (like Job Seeker, Employer and Job/Recruitment_Agency). The 3rd party arranges the transaction between the first 2 parties.
What approach i…

Muhammad Maqsoodur Rehman
- 33,681
- 34
- 84
- 124
0
votes
1 answer
Formulating a MySql join query with aggregates
Let's say i've got a database with 4 tables:
users: (personal database)
id
user_name
lessons: (lesson names like math / gym etc.)
id
lesson_name
payments (contains payments with lesson_id and a part of the payment [the whole payment is divided…

bukzz
- 9
- 1
0
votes
2 answers
DB schema, many-many or bool values in table
If I have a bunch of restaurants in my db, and each restaurant can have either a lunch menu, dinner menu, or brunch menu, does it make sense to have boolean values in the Restaurants table like so:
Restaurant id | Restuarant Name | Address | etc.. |…

Apollo
- 8,874
- 32
- 104
- 192
0
votes
2 answers
Database structure: how to best design for this issue?
I have users that have several objects and can upload images for those objects. Each object has several items. The photos the user upload can be assigned to those items. The thing is, one object can have one specific item more than once.
To give an…

Chris
- 3,756
- 7
- 35
- 54
0
votes
4 answers
How to plan such database with maybe same id?
I have table customer, table seller; and every customer have many phone-numbers, as seller do to. And I decide to do new table: Telephone, with IdTelephone, Prefix, Number, and IdCustomer or IdSeller, i don't know how to identify it, becouse…

byCoder
- 3,462
- 6
- 28
- 49
0
votes
1 answer
What's the best way to modularize a User schema so it's generic
I have a database design question. Basically I want to be able to create a schema for a User model, then use this User model in other models that extend User but I want to design it in such a way that it's generic enough to be used in every…

AntelopeSalad
- 1,736
- 1
- 16
- 27
0
votes
1 answer
How can the properties of a table be overridden by the properties of the group it belongs to, while designing database schema?
I have a table called Person:
person_id | first_name | middle_name | last_name | group_id | property_id
(group_id will refer to the group_id column of table GroupOfPerson and
property_id will refer to the property_id column of table Property)
And…

bns007
- 43
- 5
0
votes
1 answer
Providing create table feature over GUI
I am developing a web application in which a user can Create a table in data base. I am thinking on taking the attribute names and table description from user and put them into SQL query and execute it. But the drawback is that if this application…

Dhruv
- 1,668
- 9
- 29
- 40
0
votes
3 answers
Database Structure for hierarchical data with horizontal slices
We're currently looking at trying to improve performance of queries for our site, the core hierarchical data-structure has 5 levels, each type has about 20 fields.
level1: rarely added, updated infrequently, ~ 100 children
level2: rarely added,…

Glenjamin
- 7,150
- 6
- 25
- 26
0
votes
1 answer
Why won't this schema install file work in Drupal 7?
I have the following schema defined in the file 'doodil.install' as part of a custom module I'm writing. Every time I enable the module in Drupal, however, I get a white screen of death. The code for doodil.install is shown below:

Andy Mills
- 135
- 2
- 13
0
votes
1 answer
Assigning a value to multiple Id's in database schema
Id Value
A single value can be assigned to any number of Id's - one, two or many. Can also store the number of Id's to which the value is applied to. Would appreciate if anyone provides recommendations around the same as to how to represent that…

John C
- 1,795
- 4
- 27
- 42
0
votes
1 answer
Finding all the FDs in a given schema
I am supposed to find FDs from the given the schema =>
Loan(ISBN:pk, copy:pk, loandate:pk, loanerNr:fk, returnDate)
pk = primary key fk = foreign key
Lets say that this is for a library DB-system that keeps the records of books loaned out.…

John Smith
- 79
- 3
- 11
0
votes
2 answers
ClickOnce update, controlling version jumps
We have a ClickOnce deployed application. We would like make sure that the installations only update 1 version jump eacn time. (Other best practice solutions are welcome as well).
Say for example a user has version 1.16 installed, in the mean time…

sreddy
- 200
- 2
- 9