database-design Questions

9

Solved

What I'm looking for is a breakdown of table names w/ corresponding fields/types. The bible I want to store will be in English and needs to support the following: Books Chapters Section Ti...
Gomel asked 14/1, 2011 at 4:1

5

Solved

I have one entity in room @Entity(foreignKeys ={ @ForeignKey(entity = Label.class, parentColumns = "_id", childColumns = "labelId", onDelete = CASCADE), @ForeignKey(entity = Task.class, parentCo...

11

Solved

I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use. Since supposedly char columns of a fixed width are more efficient, I was ...
Karyolysis asked 22/10, 2008 at 4:8

3

Solved

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 imple...

6

Solved

I'm building Ruby on Rails 2.3.5 app. By default, Ruby on Rails doesn't provide foreign key contraints so I have to do it manually. I was wondering if introducing foreign keys reduces query perform...
Dessalines asked 11/4, 2010 at 19:27

14

Solved

Example I have Person, SpecialPerson, and User. Person and SpecialPerson are just people - they don't have a user name or password on a site, but they are stored in a database for record keeping. ...
Proprietor asked 5/9, 2008 at 12:16

10

Solved

What are the best practices for modeling inheritance in databases? What are the trade-offs (e.g. queriability)? (I'm most interested in SQL Server and .NET, but I also want to understand how othe...
Submultiple asked 10/10, 2008 at 6:3

5

Solved

How can I create a primary key in SQL Server 2005/2008 of the format CurrentYear + auto-increment? If current year is 2010, in a new table ID should start at 1, so: 20101, 20102, 20103, 20104, 2010...
Esperance asked 15/7, 2010 at 14:31

13

Solved

I want to store a single row in a configuration table for my application. I would like to enforce that this table can contain only one row. What is the simplest way to enforce the single row cons...
Stendhal asked 19/10, 2010 at 10:25

12

Solved

If you were going to store a user agent in a database, how large would you accomdate for? I found this technet article which recommends keeping UA under 200. It doesn't look like this is defined i...
Austria asked 17/3, 2009 at 16:10

15

Solved

I've been reading a couple of questions/answers on StackOverflow trying to find the 'best', or should I say must accepted way, to name tables on a Database. Most of the developers tend to na...
Backhand asked 10/12, 2009 at 13:53

6

Solved

I'm building a small application and setting up foreign key relationships between tables. However I'm confused as to WHY I really need this? What is the advantage - does it assist me when writing m...
Akela asked 8/8, 2010 at 15:53

3

Solved

One of the main reasons given for using auto-increment PK in MySQL is that it guarantees all inserts into the clustered PK index will be in order and hence fast. I understand that. But what about ...
Lacielacing asked 28/3, 2011 at 21:22

5

Solved

When do we need to use a 1-to-1 relationship in database design? In my opinion, if two tables are in a 1-to-1 relationship, they can be combined into one table. Is this true?
Greenish asked 15/6, 2011 at 2:20

3

Solved

I am looking to build a scalable real-time chat app (I am just doing this for fun and out of interest so please don't ask why!) and I know that I am going to be handling the realtime messaging part...
Ransell asked 4/4, 2021 at 21:33

3

Solved

FYI: I explicitly mean SQL Server 2000-8 and C#. So DBMSs with enum support like MySql is not the subject of my question. I know this question has been asked multiple times in SO. But still, I see...
Replica asked 25/5, 2011 at 16:30

11

Solved

How to design a database that supports a feature that would allow the application user to create a snapshot of their data at a point in time, a bit like version control. It would give the user the...
Hammerless asked 6/4, 2009 at 9:57

4

Solved

Is it a good idea to show triggers and stored procedures in an Entity Relationship Diagram? If yes, what is the notation? Information seems really scarce on this topic. Also, are there any UML diag...
Guava asked 14/4, 2013 at 12:9

3

Solved

I need to a value associated to a month and a user in a table. And I want to perform queries on it. I don't know if there is a column data type for this type of need. If not, should I: Create a s...
Miscarry asked 27/4, 2017 at 12:13

4

I have an assignment for shopping cart dealing with shirt store, and was confusing with database design in storing shirt attributes such as color, size and stock for each item. Let's say to store b...
Anguilla asked 31/7, 2015 at 13:23

3

Solved

How to provide primary key for multiple column in a single table using PostgreSQL? Example: Create table "Test" ( "SlNo" int not null primary key, "EmpID" int not null, /* Want to become prim...

3

Solved

I have a deferred AFTER UPDATE trigger on a table, set to fire when a certain column is updated. It's an integer type I'm using as a counter. I'm not 100% certain but it looks like if I increment ...
Lacerate asked 20/1, 2012 at 5:39

17

Solved

I'm creating a database table and I don't have a logical primary key assigned to it. Should each and every table have a primary key?
Willamina asked 8/5, 2009 at 14:49

9

Solved

When having a one-to-one relationship in a database the other table has a foreign key ID (in this example). And in a one-to-many relationship the table contains many foreign keys. But does the data...
Clansman asked 20/1, 2011 at 19:59

4

Solved

I would like to add a constraint that will check values from related table. I have 3 tables: CREATE TABLE somethink_usr_rel ( user_id BIGINT NOT NULL, stomethink_id BIGINT NOT NULL ); CREATE T...

© 2022 - 2025 — McMap. All rights reserved.