The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [database-design]

The development of the conceptual schema and/or the logical model and/or the physical settings of a database.

923 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
27 views

Design and queries for analysis of event-sequences

I will have to store sequences of events with certain properties in a database (MariaDB preferably) and I have some issues regarding the design and queries. The crucial part is the analysis of the ...
0
votes
0answers
6k views

Need Help in DFD Diagram for online hotel booking system

Hi friends, I am creating a data flow diagram for online hostel booking system. not sure if i created a correct diagram or not any help would be appreciated. thanks in advance
0
votes
0answers
61 views

Oracle 11 table design for better performance for reports?

We have a requirement to design a report page. A few factors we have are: number of fields in report is 70 computed fields is going to around 14*8 (based on toggles) a filter is going to have ...
0
votes
0answers
26 views

How to model mappings at various levels

I'm trying to design the database model for my application and I'm finding it difficult to design the mappings for user access to various entities stored in the database. If access was only ...
0
votes
0answers
257 views

Storing DB credentials in an application source code?

I am making an app which connects to a DB, and the app will have plenty different userslogins. Is it a good design choice to have a specific DB login/password for the application, using which the ...
0
votes
0answers
165 views

Struggling with normalisation (database design critique)

I'm relatively new to database design and have been reading up a lot on best practice, and I'm starting to design a schema for a new application that will be developed and I am struggling with a few ...
0
votes
1answer
99 views

Optional oneToOne relations and criteria field

Introduction: Visitors can fill reports on my website. Those report can either be filled by a legalPerson or a naturalPerson. Constraint: I don't like empty fields and I would like to normalize as ...
0
votes
0answers
119 views

MySQL Table with 568 columns: 1118, 'Row size too large…'

I'm currently migrating a database from Oracle to MySQL5.6. One table consists of 568 columns. When atempting to create the table I received this Error 1118, 'Row size too large..' I already ...
0
votes
0answers
181 views

Store both a city and its region?

I store various events (such as a search on the site) into a table (in fact I have two tables: one for the event and other (linking to the first) with characteristics of the event). Each city belongs ...
0
votes
0answers
5k views

Need help to create chat application database schema?

I am developing a chat application in asp.net using SignalR. Client requirements are: Admin can create different chat rooms e.g. (News Room, Sports Room, Android Room etc) Registered users can then ...
0
votes
0answers
33 views

loading k:v pairs from DB into JS Object

I'm creating a single player web RPG. I'm debating the following method of storing/retrieving quest items per player id: In userstats table, have a quest_items column of type mediumtext, where I ...
0
votes
0answers
67 views

Normalization to BCNF help needed

I have a table with 5 columns as A, B, C, D, and E. The functional dependencies are: AB -> C,D,E BCD -> A BCE -> A,D BD -> E I think AB is the candidate key. I can't find any other candidates. ...
0
votes
1answer
73 views

ORM for Image model

I'm uncertain as to how a certain table should establish relationships, and I feel as if the solution I came up with is incorrect. The images table is used to store an absolute path on a server (path)...
0
votes
0answers
379 views

How to convert this relation to 2NF?

In my Entity Relationship Diagram, an entity type TEACHER had a relationship of TEACH with another entity type called CLASS. CLASS was a week entity type of TEACHER,so when mapping to a Relational ...
0
votes
1answer
89 views

Create one-to-many to two fields in different table

I have a database where I am trying to figure out how to join a table that contains an object called ModelType. The calibration table contains two fields (EffModel and BkgModel) that are based on a ...
0
votes
0answers
65 views

Organizing a couple tables in postgresql

I have a data structure that is represented like this: { 'question_id': 1, 'is_required': False, 'question_text': [ { 'id': 1, '...
0
votes
0answers
80 views

Reduce read write delays in specific database setup

I have a database with a large table with 15 columns (type double). It contains a large amount of data (~ 100 rows of data for every second. Holds 3 days of data). I also have a real-time program that ...
0
votes
0answers
139 views

Efficient way to fetch/update X records in a loop

What I need is a simple process that handles requests. I have setup a simple table as follows: CREATE TABLE Requests ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, request_param VARCHAR(250) ...
0
votes
0answers
3k views

Alphanumeric field in MySQL

I need to create a character field with some rules, they are, Field name: contract_number. Rules: Contract Number Contract number must be alphanumeric. Contract number must be unique. Contract ...
0
votes
2answers
56 views

MYSQL Indexes when looking up on alternating sets of columns

I have a table that looks like: CREATE TABLE `connections` ( `connection_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `service_id` smallint(5) unsigned DEFAULT NULL, `parent_id` bigint(20) ...
0
votes
0answers
33 views

Impact of additional int field as primary key

Directly to the point, at one time I have a table like this: create table item( item_id varchar(50), constraint pk_item1 primary key (item_id) } However from my discussion one day, there is ...
0
votes
0answers
158 views

How should I restructure a table that contains multiple columns that contain similar, but not same data?

I currently inherited an InnoDB table that describes a product. In the table there are a few columns that describe the maximum height at which the product may be mounted. These are the columns: ...
0
votes
0answers
75 views

Same table for real persons and fictional one

In my application stores both real and fictional persons (from movies, etc.) as well as stage names and alter egos. These entities have almost the same properties and are often referenced via foreign ...
0
votes
0answers
62 views

Advice on DB Changes

Requirement: I'm required to prefix a couple of strings to the existing one. I.e. The current way, the Accounts been recorded in AccountID field looks as "621230093VN00" Under the new format it ...
0
votes
0answers
1k views

Inserting and updating on same table

I am currently working on a database that aims to provide information regarding the amount of time people stay in a company's car-park premises. This is done using a table called "tbl_stay" which has ...
0
votes
0answers
109 views

Database design: Modifying an open source database without a lot of changes

I am adding more functionality/features to an open source project. The project is about a forum where each post can be given a specific list of tags. The tags are homogeneous. I.e they are of similar ...
0
votes
0answers
366 views

Import only selected column from tsv into mongodb

I have a very large tsv file. I need to upload some data from the file into MongoDB (just two columns, title and body). I don't want to import the full file, as I only really need the two columns. I ...
0
votes
0answers
1k views

Trouble converting MySql Database to SQL Server

I have an mysql database that contains 38 tables. I used "SQL Server Migration Assistant for Mysql" tool to convert this database to SQL server Database. I successfully converted 37 tables. Only one ...
0
votes
0answers
202 views

How implement MySQL unique index with two foreign key that one can be null?

I would know if can be declared in MySQl to create an index constraints in a table with two foreign key that one can be null. For example cannot be repeated a null foreign key with the other foreign ...
0
votes
0answers
815 views

InnoDB errors after having deleted “ibdata1”

By accident, I have deleted the ibdata1 file in the MySQL directory because MySQL wasn't functioning correctly. After reading so many forums, I found a post that recommended deleting the 3 files ...
0
votes
0answers
1k views

Postgresql Retrieve / Find Primary Key Serial Autonumber field for Audit logs

I need to find the Primary Key field name in each of a number (approx 70) of tables to create audit logs. All the primary keys are type serial (auto incrementing integer) and all have the name in the ...
0
votes
0answers
156 views

Database Schema/Structure advice

Well i am reconstructing an already created application and was looking to improve this, especially with in the database structure. I want to start off with probably the biggest section and that is ...
0
votes
0answers
251 views

Ternary Relations three attributes and an association

I have 4 tables: Workers Work Workers Relationship/Work Registration Time I need to have organized the Workers Relationship with Work so you can make a ListBox organized. Where each worker may ...
0
votes
1answer
38 views

Foreign keys to prevent “orphan” file rows in a database for a scenario involving projects, files and downloads

In a system that monitors a file mirror by regularly downloading a file, I want to store a history of the results. So I have three tables: ┌──────────┐ ┌──────────────────┐ ┌────────┐ │projects │ │...
0
votes
1answer
655 views

How to structure a MongoDB database to allow for multiple users to use the same account with restrictions based on roles?

Ok, firstly I'm very new to MongoDB, and newish to DB development/management as a whole. I've done a unit using Oracle through uni, but apart from just manipulating fields through the phpmyadmin ...
0
votes
2answers
63 views

Is it possible to COPY tables into PostgreSQL without setting structure first?

I'm just getting to grips with PostgreSQL 9.6. I'm wondering if there is a simple way to add a .csv table to a database without first creating the table structure in psql or pgAdmin? Or...I've not ...
0
votes
1answer
93 views

Products relation structure

I'm trying to design a products relations table structure. There is an existing product table that has the following fields: A product could be related to other product but also to a category or a ...
0
votes
1answer
57 views

Set indexes for database used for login and register actions

I am thinking on how to set indexes to improve performance of a database for register and login actions.I have seen that alphabetical indexes are not good so I don't know how to do...Can you help me?...
0
votes
2answers
81 views

Mysql replication with c

I have huge database on MySql and It's become more and more huge. So, Now I am facing performance issues with my database. Some of tables has millions of records in it. like my login detail table ...
0
votes
1answer
1k views

Efficient way to move rows across the tables?

This is somewhat long question as I would like to explain all details of the problem. System Description We have a queue of incoming messages from external system(s). Messages are immediately stored ...
0
votes
1answer
58 views

How to model parent-child relationship correctly in multi-tenant, multi-schema Postgres database

I have a multi-tenant SaaS app where each tenant gets their own schema. When a user creates an account, I create a new schema and run a bunch of migrations to create tables under that schema. Then, ...
0
votes
1answer
114 views

Database analysis

I have database which that store the sold products in Orders Table and another table called Transaction to set the time and the total price for the individual order ,my question is: How to combined ...
-1
votes
0answers
18 views

Partition key selection/modeling for hierarchical data

Please advise if this is not the right place to ask this. I'm trying to find a suitable partition key/sort key pair for a simple relational model (a seller has many customers, a customer has many ...
-1
votes
1answer
20 views

Relation with many roles - Logical Model

I have an assignment where I am asked to draw a logical model. The data is for a hospital where each doctor can have three roles: supervises a patient requests for a procedure carries on a ...
-1
votes
1answer
31 views

The fastest way to Copy Schema or Table in MySQL DB

I have a schema (size 500 GB) in my MySQL DB and I want to make a copy of this schema to another schema in the same DB. May I ask what is the fastest way of copying all the tables in that schema? (I ...
-1
votes
1answer
43 views

Design with new table and old tables

I have to add a new table according to some new requirements, the model currently consists of two tables: DETAIL and SUMMARY. The relation is that every detail has associated one summary, so now I ...
-1
votes
1answer
54 views

the difference between customer address table and address table

I was having a look at this data model to get more acknowledged for designing my own. Could someone kindly tell me what I need the Customer_Address table for? why don't we just settle with the ...
-1
votes
1answer
41 views

The best database design for multistage forms?

I have multiple forms (actually one single form which has some sections) with a progress bar like: // ----- Request Being Agent Form ----- CEO-Basics: f-name, l-name, age, mobile, email, address, ...
-1
votes
1answer
431 views

Export only certain column on single table to csv format

I need to export certain column only of a database table to csv file. Here is the format of the source: ID | user_email | user_login | user_nickname | usergroup | address | user_registered | ...
-1
votes
1answer
242 views

Storing 128D facial descriptors for search-ability

I'm working on some facial recognition scripts in python using the dlib library. dlib takes in a face and returns a 128 dimension tuple with floating point values representing the values for key ...