A schema of a database system is its structure described in a formal language supported by the database management system (DBMS) and refers to the organization of data to create a blueprint of how a database will be constructed (divided into database tables).

learn more… | top users | synonyms (1)

30
votes
5answers
71k views

Difference between database vs user vs schema

I'm really confused with the terms database, user and schema. Can anyone explain how they are different from each other (if they are)? If they are same then, what are the similarities between them? ...
1
vote
2answers
355 views

Schema Migration: SQL Server Data Tools vs Liquibase and Flyway

This might seem like a stupid question, but I've been looking into open source solutions for schema migration, namely Liquibase and Flyway. However, my boss told me that SQL Server Data Tools (SSDT) ...
0
votes
0answers
54 views

Hard dba case [schema to store delivery prices for shops]

I want to make a database scheme which would allow me to fetch the delivery price for the different Shops basing on the delivery destination (Address/Region) and order value (price). Here is the ...
1
vote
1answer
39 views

Active Directory group as a schema in SQL Server

In SQL Server 2008 R2 we have a database that is being maintained by a team of developers. Each of them should have permissions to perform DDL operations such as adding a column or creating a table. ...
1
vote
1answer
50 views

SQL Schema Change; Modification of Existing Table vs Creation of New

We are planning the data schema for our project. Currently we have a table with classifications, but there is the possibility of a new classification in the future which would require a new field to ...
1
vote
0answers
21 views

DATE - Normalization, a multiple ranged query, multiple inserts and multiple update

I have a booking system, airbnb style. TABLES -> prices, house, available_date A house has available days and not available days, but sometimes the days have different prices. A weekend is more ...
0
votes
1answer
48 views

How would you design a table for approval system between User and Sports Club

I am currently learning database modelling and struggling to model the following requirement. I have a user and sports_club table. User can only join a sports_club if three existing users of the club ...
0
votes
1answer
43 views

Compare order of columns between two databases

I have two postgres databases which should have an equal db-schema, but have not. I want to see the difference in the column order. Columns of table1 in Dev: id, foo, bar Columns of table1 in ...
0
votes
1answer
45 views

Single-Table vs. Multi-Table design

I'm trying to come up with a database schema which is going to be used for a social network similar to that of Facebook. Now for posts I have two schemas in mind which are as follows: Single-Table ...
0
votes
1answer
35 views

Default schema is ignored on SELECT

According to my understanding, a default schema should apply when issuing SQL statements on tables using unqualified table names. My problem is that the following statement fails, because the table ...
8
votes
4answers
40k views

Copy complete structure of a table

Using some methods, when you create a copy of a table you lose indexes, PK, FK, etc. For example in SQL Server I can say: select * into dbo.table2 from dbo.table1; This is just a simple copy of the ...
2
votes
2answers
168 views

Schema to make a Payment History/Viewing History

On some websites I have seen two history of events: Payment History and View/Watched History. I want to have both payment and viewing histories in my app, but I got stuck when I started thinking ...
0
votes
0answers
44 views

How can I layout a schema that will track monthly installments?

I'm pretty new to database design and have a beginner's understanding of SQL, mostly simple SELECT statements. I find myself in a situation where I have to create a system that will track monthly ...
0
votes
0answers
20 views

How can I organize this data?

I have been working in a system but don't know how to represent some of the data and its relations. There are three warehouses and a four shops working with the system and until this moment we can ...
0
votes
0answers
62 views

Finding the closure and super keys of a schema?

I am working on a problem in which I have to look at the relation R with schema R(w, x, y, z), and the three functional dependencies: w -> z ; x,y -> w ;z -> y For every non-empty subset X of ...
0
votes
1answer
34 views

How do I host and separate multiple projects on one Oracle Database?

From Difference between database vs user vs schema I'm trying to understand the concepts of the schema, user and database. My current understanding is you cannot create a schema separately. You can ...
5
votes
3answers
6k views

database schema design for school system

I am trying to create a database to store information about a school. I need to store each department in the school. Each department then has a list of teachers. Each teacher has a list of classes ...
14
votes
6answers
3k views

Redgate SQL Compare vs Visual Studio 2010 Premium/Ultimate database project

I currently use the Visual Studio Professional Edition which has the database project as a project template, but some of its features are not available, for example Schema Compare tool. The schema ...
3
votes
3answers
2k views

What's a good way to model user authorization to hierarchical data?

I'm wanting to implement something that's basically an ACL in SQL Server (2008, we'll be moving to 2012). We're working with farm production information. We will have users who need to be authorized ...
1
vote
0answers
31 views

SQLite reference table question

I'm using SQLite and Python for making a sensor network database. I have a table holding the nodes: NODE, another 2 tables for sensor specification: SENSOR_TYPE ("Temperature, Humidity...) and ...
0
votes
0answers
56 views

How to design relationship for racing team trades?

I'm working on a fantasy racing team project. I'm having trouble laying out the schema when it comes to the team table and the trades. I think I have the race, driver, and result tables laid out okay: ...
3
votes
2answers
2k views

Error 42P01: relation does not exist

I'm new at creating databases, and this error has me dumbfounded, as I am super new with DB admin things (I mostly do reporting type queries). I created a new database through pgAdmin3 GUI, and I'm ...
1
vote
1answer
157 views

Referral table structure

I need to make a simple referral system and I have a database table set out as follows: mem_id | date | refer_email | accepted And the meaning of such columns is the following: mem_id: The ...
0
votes
0answers
16 views

custom field related to usergroup and products

We need to create dynamically custom fields and store values related to each user or product in database we have product table related to category table and also user table related to usergroup and ...
1
vote
4answers
6k views

Can't create user in SQL Server

Hi guys when I try to create user for my database I always encounter this kind of error. This is the sequence of task I done. I manage to create new login using windows authentication of SQL then ...
1
vote
0answers
25 views

Possible to have duplicate fully qualified schema names with separate data in DB2 for z/OS?

We have several application teams that are looking to do a re-write of large legacy applications. This is mostly COBOL going against DB2 for z/OS (v11). The COBOL code was generated using a tool, so ...
4
votes
1answer
135 views

UPDATED: Relational (or NoSQL) Database Design

(Updated this question with more specifics. Decided on a Relational Database, and would love some comments on its design) This database holds assembly instructions data for shipbuilding, later use in ...
0
votes
0answers
20 views

Variable Dimensional Data in Table

My application needs the ability to store data of variable dimensions. For example, it might have some three dimensional data, with values addressed by the vector [age, region, type], together with ...
0
votes
0answers
33 views

design of schema in mongoDB

I'm using mongoDB as my database. i have an record of 100 hospitals. To store all the information i'm designing schema of my database for that i've three solutions: i can create collection for each ...
3
votes
1answer
148 views

Constrains relationship

I have the following design. Each user has it's own contacts, it's own hosts and assign those to a domain which belongs only to him. I want to insure that the host you assign to the domain belongs ...
1
vote
1answer
38 views

MongoDB schema for a news service

I would like to create a mongoDB database that would be very similar to how various news services store and display their data. The database would be queried by an android phone. Lets have a look at ...
6
votes
2answers
2k views

Will table inheritance in PostgreSql suit this situation?

Let's start off by saying, I'm new to PSQL and coming from a MSSQL background. I'm starting to design a DB in PSQL. So my main aim is to have a Main schema in this DB, which I am going to use to ...
2
votes
2answers
52 views

Asking SQL schema by FOIA

I've sent FOIA requests to various public institutions in my area. I'm only asking for the schema of the SQL databases their financial services might be using (column name for every table for every ...
0
votes
0answers
84 views

Comparison of MySQL Workbench model schema with existing database?

I need to compare the schema of a MySQL Workbench model with the schema of an existing database. My initial approach was to use the 'Forward Engineer SQL Create Script' option and compare its output ...
2
votes
1answer
84 views

Howto use typeperf to store performance monitor values in a custom schema?

I have setup a performance monitoring of my SQL server system using typeperf.exe to store the values directly to SQL Server. I went through the following article, that explains howto use typperf.exe ...
7
votes
1answer
94 views

Functional dependencies applies to whole database or to a particular relation?

I am new to dbms. I saw a lecture video about functional dependencies. But I am confused a bit that whether functional dependency is a constraint put on whole database or on a particular schema?
0
votes
1answer
91 views

Documenting SQL Server Database [duplicate]

I wrote the following (Quick and Dirty) script to document a database schema: Note - The relationships part came from another guys site (I just can't remember where). Does anyone know how to ...
2
votes
1answer
341 views

Building a restaurant database

I am designing an Italian restaurant database, but I face some problems considering the database design, which lead me to a halt. The part that I find difficult developing is the dishes table. A main ...
3
votes
0answers
158 views

Form builder schema for SQL database?

There are many ways one can envision the solution, from the top of my head: Two table approach: Field table with (name, field_name, type, description, meta) attributes Form table with (name, ...
0
votes
1answer
57 views

Store parameters of various types

I am a (poor, young) scientist working to develop a database to allow a project to scale up. I am experimenting with MySQL and have had very encouraging experiences so far, but I am still novice and ...
0
votes
0answers
37 views

PostgresSQL ignoring search_path when using input file

I have a SQL file generated using pg_dumpall, and I'm attempting to use it to restore a database with the -f option for psql (eg: psql -h 127.0.0.1 -p 8888 -U owner -f ~/restore_file.sql). My SQL dump ...
0
votes
2answers
211 views

Export pump all schemas except Sytem related schemas

I have around 111 schemas in one database instance and have to export all the schemas except the system related schemas to a new instance. Is there any way as to exclude system related schemas while ...
2
votes
2answers
5k views

SQL Server - backup / restore schema only

We have a DB on over 100 servers of which we want to backup / restore the structure of just 1 at a time to a specific UAT database. They're all called the same thing but vary in terms of schema - ...
3
votes
3answers
324 views

Implementing User Privacy Settings with MySQL Database

I am actually working on a social website. Not big, aimed at a very small group of folks. And I am curious, to how I can best implement Privacy settings for my users in a MySQL driven database. For ...
1
vote
1answer
154 views

Schema for yearly data models

I am developing a school management system. Most data will not be reused after the end of the school year. I am contemplating using schemas to separate data in various school years, however I am ...
4
votes
1answer
1k views

Pros and cons of using many schemas in PostgreSQL as opposed to just one?

For a large SAAS application (backed by PostgreSql 9.4), with over 300,000 accounts (and growing), what are the pros and cons of using a schema per account to partition the data vs putting all the ...
2
votes
0answers
17 views

How do I quickly tell the structural differences between two databases? [duplicate]

I am upgrading a web application to a newer version and need to migrate the data manually. The newer version uses slightly different database structure. It has added a few tables, but all of the old ...
0
votes
1answer
45 views

Is it good to save Keywords stored by users in a new DB schema?

My question is more from the schema design and of further performance of the DB. I'm designing a DB schema which will store primarily strings. Actually, users work on these string, as normal mortals, ...
2
votes
0answers
27 views

Getting error 1064 in automatically-generated code from MySQL workbench [duplicate]

I have started using mySQL workbench (Version 6.3.4.0) and I have used the EER Diagram tool to design a schema. So far, so good. However, when I try and run the Forward Engineering, I get the error ...
1
vote
1answer
37 views

Is this the correct way to model a relationship between an object which may or may not have another object?

I'm creating a database for a department store and the database has two tables: Items and Coupons. An item, like a TV, can only ever have one coupon. Some items don't have a coupon at a given time. ...