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
23
votes
4 answers
Best Practices for storing a database schema version in SQL Server?
I have an app which will be deployed on production PCs with SQL Server.
I want to be able to store and retrieve a version of the schema in my database.
I'm interested in best practices to be able to accomplish this, with the following main…

pearcewg
- 9,545
- 21
- 79
- 125
22
votes
1 answer
What is the difference between an Oracle and Microsoft schema?
Is this an accurate way to describe the difference in the meaning of schemas between the two technologies?
An Oracle schema is associated with a single user and consists of the objects owned by the user.
A MS SQL Server schema is a namespace.

Tarzan
- 4,270
- 8
- 50
- 70
22
votes
2 answers
Laravel - Creating tables dynamically (without migration)
I'm trying to create a table dynamically upon an admin request, and while it seems it should be straightforward like most of Laravel's documentation, I can't seem to create a table. Though I can drop tables, and add or drop columns as I wish.
This…

Shay
- 2,060
- 2
- 16
- 22
22
votes
4 answers
22
votes
8 answers
How to find foreign-key dependencies pointing to one record in Oracle?
I have a very large Oracle database, with many many tables and millions of rows. I need to delete one of them, but want to make sure that dropping it will not break any other dependent rows that point to it as a foreign key record. Is there a way to…

daveslab
- 10,000
- 21
- 60
- 86
22
votes
4 answers
How to Design a SaaS Database
I have a web app that I built for a trucking company that I would like to offer as SaaS. What is the best way to design the database?
Should I create a new database for each company? Or should I use one database with tables that have a prefix of…

Josh Curren
- 10,171
- 17
- 62
- 73
22
votes
3 answers
How to check if database schema matches Entity Framework schema?
For my surprise, using the CreateDatabaseIfNotExists context initializer, the line
context.Database.Initialize(true)
doesn't throw an exception if the schema does not match my code first schema.
Is there a way to validate if the current database…

Eduardo Brites
- 4,597
- 5
- 36
- 51
21
votes
2 answers
Database schema - representing location
I'll need to represent location of some events and I am designing database schema for this application.
I have two approaches for presenting the location:
approach 1:
4 tables:
Countries
States
Cities
Locations (in location I have foreign key to…

Bart
- 2,301
- 3
- 29
- 27
21
votes
5 answers
What is meant by sparse data/ datastore/ database?
Have been reading up on Hadoop and HBase lately, and came across this term-
HBase is an open-source, distributed, sparse, column-oriented store...
What do they mean by sparse? Does it have something to do with a sparse matrix? I am guessing it is…

Jai
- 3,549
- 3
- 23
- 31
21
votes
4 answers
Database with "Open Schema" - Good or Bad Idea?
The co-founder of Reddit gave a presentation on issues they had while scaling to millions of users. A summary is available here.
What surprised me is point 3:
Instead, they keep a Thing Table and a Data Table. Everything in Reddit is a Thing:…

Claudiu
- 224,032
- 165
- 485
- 680
21
votes
1 answer
is `date` a valid mysql column name?
I was wondering if date is actually a valid mysql column name?
According to the manual
MySQL permits some keywords to be used as unquoted identifiers because
many people previously used them. Examples are those in the following
…

Hailwood
- 89,623
- 107
- 270
- 423
20
votes
3 answers
Database Design for storing Chat Messages between people
I am trying to build a messaging/chat system. which can store conversation between two people in a chronological order. Also if User A deletes the conversation User B still should have access the conversation until he wishes to delete them.
Inbox -…

Harsha M V
- 54,075
- 125
- 354
- 529
20
votes
10 answers
SaaS database design - Multiple Databases? Split?
I've seen SaaS applications hosted in many different ways. Is it a good idea to split features and modules across multiple databases? For example, putting things like the User table on one DB and feature/app specific tables on another DB and perhaps…

Vyrotek
- 5,356
- 5
- 45
- 70
20
votes
2 answers
Polymorphic relationships vs separate tables per type
I am working on a database which has some types (e.g. User, Appointment, Task etc.) which can have zero or more Notes associated with each type.
The possible solutions I have come across for implementing these relationships are:
Polymorphic…

Peppermintology
- 9,343
- 3
- 27
- 51
20
votes
1 answer
MySQL: Embedded JSON vs table
I'm designing the database schema for a video production project management app and struggling with how to persist some embedded, but not repeatable data. In the few CS courses I took, part of normalizing a relational database was identifying…

ToddSmithSalter
- 715
- 6
- 20