Questions tagged [database-schema]

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.

2931 questions
20
votes
1 answer

cassandra add column if not exists

I need to insert a new column into an existing column family via a CQL script. I want to do something like: alter COLUMNFAMILY rules ADD rule_template text IF NOT EXISTS; How can I achieve this purely in CQL script?
beterthanlife
  • 1,668
  • 2
  • 18
  • 30
19
votes
3 answers

Handling migrations with MongoDb

Just to give a little more context to the question, I have a web application (asp mvc) which basically wraps CRUD operations to a MongoDb instance, it carries out validation and certain business logic before the model is verified and sent over to be…
Grofit
  • 17,693
  • 24
  • 96
  • 176
19
votes
7 answers

Schema Builder length of an integer

I've been searching around and the question was asked a few times, but no-one seem to be able to give a definite answer to it. How do you specify the integer length for the table column using Schema? I've seen someone…
Spencer Mark
  • 5,263
  • 9
  • 29
  • 58
19
votes
1 answer

Creating PostgreSQL tables + relationships - PROBLEMS with relationships - ONE TO ONE

So I am supposed to create this schema + relationships exactly the way this ERD depicts it. Here I only show the tables that I am having problems with: So I am trying to make it one to one but for some reason, no matter what I change, I get one to…
Georgi Angelov
  • 4,338
  • 12
  • 67
  • 96
18
votes
5 answers

Help a CRUD programmer think about an "approval workflow"

I've been working on a web application that is basically a CRUD application (Create, Read, Update, Delete). Recently, I've started working on what I'm calling an "approval workflow". Basically, a request is generated for a material and then sent for…
gerdemb
  • 11,275
  • 17
  • 65
  • 73
18
votes
2 answers

How to include MySQL database schema on GitHub?

Stackoverflow and MySQL-via-command-line n00b here, please be gentle! I've been looking around for answers to my question but could only find topics dealing with GitHubbing MySQL dumps (as in: data dumps) for collaboration or MySQL "version control"…
Kay
  • 797
  • 1
  • 6
  • 28
18
votes
3 answers

mongodb schema design naming convention

So I have something called exports.create = function(projectJSON){ var project = new ProjectModel({ id : projectJSON.id, projectName : projectJSON.projectName , authorName : projectJSON.authorName, firstPostDate :…
bouncingHippo
  • 5,940
  • 21
  • 67
  • 107
18
votes
7 answers

List all stored procedures with schema name

Can anyone advise on a way to list all stored procedures along with their schema names in a database? Thanks!
daniness
  • 363
  • 1
  • 4
  • 21
17
votes
2 answers

Database normalization for School Management System

I am creating system for a school management system and come up with the attached database schema. Following is how the system works: A school has many students and teachers. It has also many courses(subjects) taught. A grade level can have many…
17
votes
2 answers

How to see table partition size in MySQL ( is it even possible? )

I've partitioned my table horizontally and I'd like to see how the rows are currently distributed. Searching the web didn't bring any relevant results. Could anyone tell me if this is possible?
17
votes
3 answers

Designing "social-feed" in DynamoDB

This question might be relevant for any document based NoSQL database. I'm making some interest specific social network and decided to go with DynamoDB because of scalability and no-pain-administration factors. There are only two main entities in…
17
votes
3 answers

How to SELECT in Oracle using a DBLINK located in a different schema?

We have an Oracle DBMS (11g) and the following configuration: A DB user "MYUSER" Two schemas "MYUSER" and "SCHEMA_B" User "MYUSER" can access "SCHEMA_B" and has READ permissions on its tables A public DB link "DB_LINK" located in "SCHEMA_B" The…
Steffen
  • 171
  • 1
  • 1
  • 4
17
votes
3 answers

Best Way To Build A Multi-Notification System in PHP

I am currently working on a mobile app that lets you ask friends for favourites, it's a HTML5 frontend and a PHP backend. I am stuck as to what the best way is to build a notifications system, more-so the database schema than the actual code…
Dwayne Charrington
  • 6,524
  • 7
  • 41
  • 63
16
votes
3 answers

Connect with postgreSQL schema

I am looking to connect and query to a PostgreSQL. But I only want to connect to a particular Schema. As per the doc (JDBC) we can use jdbc:postgresql://localhost:5432/mydatabase?searchpath=myschema or update As of 9.4 you can specify the url with…
Abhishek Soni
  • 1,677
  • 4
  • 20
  • 27
16
votes
7 answers

How do I generate a script of all database objects in Toad for MySQL

In the freeware version of Toad for MySQL (latest version), I can generate a script of all tables in my database in one file. However, for stored procedures and functions, Toad generates a separate script/file for each one. Ideally, I'd like a…
JohnB
  • 18,046
  • 16
  • 98
  • 110