Instead of using NVarchChar (max) for my field I am limiting the lengths arbitrarily. WHen does limiting these fields really make a significant difference in terms of performance? Every 100? 200? 1000 characters?
...
In a DB I'm designing, there's one fairly central table representing something that's been sold or is for sale. It distinguishes between personal sales (like eBay) and sales from a proper company. This means there is literally 1 or two fields which are not equally appropiate to both cases... for instance one field is only used in one cas...
Original Question:
Hello,
I am creating very simple hobby project - browser based multiplayer game. I am stuck at designing tables for storing information about quest / skill requirements.
For now, I designed my tables in following way:
table user (basic information about users)
table stat (variety of stats)
table user_stats (conne...
I'm currently building a "Lifesteam" style website in Rails. A lifestream usually is an aggregate of public content (usually received via APIs).
I'm currently confused about the database structure.
There will be a Users table (as users will be able to sign up and have their own lifestream). I'm wondering whether I should also have a S...
I use schemas in my databases, but other than the security benefits and the fact that my OCD is happy, I don't really know whay it is good practice to use them. Besides the more granular security, are there other reasons for using schemas when building a database?
...
I ask this because need to understand/explain better with examples.
clasical examples like: an Article can be published in multiple Publication objects, and a Publication has multiple Article objects. (source)
I see is usefull for web2.0 for sharing features.
...
For a certain piece of business logic, a sequence could be either two separate updates, or a delete followed by an insert. Basically, the update would nullify a column so I can make it seem like a delete. I am not concerned with losing rows (so a soft delete is not necessary): what is the more efficient approach?
...
Currently am using postgres with diff schemas for diff modules.Now i am planning to switch towards oracle.But i heard that in oracle schema is not there..Is it true..if it is like that how can i migrate?
...
I was wondering if anybody had recommendations for some good datamodelling software? I've used an older version of Sybase Powerdesigner and found it a bit clunky - was hoping to get something a little easier to use...
...
Is it things like tables? Or would it also include things like constraints, stored procedures, packages, etc.?
I've looked around the internet, but finding elementary answers to elementary questions is sometimes a little difficult.
...
Lets say that I have a database structure with three tables that look like this:
items
- item_id
- item_handle
attributes
- attribute_id
- attribute_name
item_attributes
- item_attribute_id
- item_id
- attribute_id
- attribute_value
I would like to be able to do this in SQLAlchemy:
item = Item('item1')
item.foo = 'bar'
ses...
I am learning database right now -- and some of the queries are getting just plain crazy. I know that during query optimization you may sometimes rewrite queries in different ways to minimize certain things. I am looking at a correllated subquery example and see that it results in the same resultset as a LEFT JOIN.
I am thinking that...
I know this is subjective, but I'd like to know peoples opinions and hopefully some best practices that I can apply when designing sql server table structures.
I personally feel that keying a table on a fixed (max) length varchar is a no-no, because it means having to also propogate the same fixed length across any other tables that use...
I have a fairly common scenario where a user can select from a set of attributes. The attributes in the UI are represented by checkboxes.
For example:
Components: Harddrive(y/n), CPU(y/n), Monitor(y/n), Keyboard(y/n), etc....
In the past I have generally modeled this scenario like this:
"PCs" 1:M "PC Components" M:1 "Components"
A...
We use a third-party product to manage our sports centre membership. We have several membership types (eg. junior, student, staff, community) and several membership statuses (eg. annual, active, inactive, suspended). Unfortunately the product only records a member's current membership type and status. I'd like to be able to track the way...
Possible Duplicate:
What is the optimal length for an email address in a database?
What would you put as the length of an email address field?
In the db I look after we have nvarchar(60) but this seems arbitrary.
Is there a maximum length I can allow for or are email address lengths unbounded?
EDIT this is a dupe of
http://st...
Hi,
We have a database with a very simple schema:
CREATE TABLE IF NOT EXISTS tblIndex(
frame_type INT,
pts VARCHAR(5),
ts_start INT primary key,
ts_end INT)
And the application scenario is :
Every second user will insert 2 ~ 50 records ,and the ts_start fields of those records is always increasing. After ...
Thank you one and all for you're answers.
I'm learning as I'm going - so I'm learning but still got a long ways to go. For work, we primarily use MySQL for our databases - web development. I have a question concerning unique indexes - when to use them properly and how.
I'm sure pretty I understand their purpose - declare a column as a ...
I'm wondering about how to store language tag IDs (e.g. en-US).
A quick example:
Table l10n ( l10n_id SMALLINT, code VARCHAR(5) )
PK: l10n_id
Index on code
Table product ( product_id INT, ..language-neutral columns.. )
PK: product_id
Table product_l10n ( product_id INT, l10n_id SMALLINT, ..language-specific columns....
Ok, so I am creating tables in MySQL with indexes and foreign keys. I use MySQL Workbench to create the tables and then have it forward engineer a SQL create script (I do better in a visual DB environment than just writing out the SQL code by hand right away).
The problem is many times when I import the sql script into mysql, I get the ...