« first day (601 days earlier)      last day (4566 days later) » 

06:09
@Aaron a) simpler foreign keys b) they aren't lookup string, they are 'things' that are modelled - eg label type or carrier, therefor the data will in general be constrained differently and of course you have the flexibility to add columns. c) more specific names. d) 100 is probably an exaggeration e) in complex queries there will be less work for the planner to do as it won't have to guess cardinalities based on the filter - simpler is better for the planner
e) assuming you are doing FKs properly, you will be hard-coding the 'type' into your check constraints - I prefer not to hard-code values in this way but would rather build the relationships into the model f) memorability - it is easier to remember a well named lookup table name than an id or code g) making it easier for there to be a single interface to changing the data means there probably will be one. Even if a single interface is really not the most appropriate.
h) permissions. Perhaps someone should be able to add new 'colours' but not new 'payment methods'
 
3 hours later…
08:59
That should be an answer.
09:19
in Vote to ellipsis, 27 secs ago, by Jack Douglas
too broad?
gbn
gbn
09:33
I'd say yes, too broad
10:00
Hmm, does this smell like homework to anyone else?
1
Q: Vehicle spare parts inventory datadase model

hades985Currently I am modeling a database to be used for vehicle spare parts inventory management and I am stuck... I have a specific requirement that I do not know how to model in the database and that is that some spare parts can be broken from set into pieces. Spare can be issued in set or pieces. ...

@SimonRigharts not to me - I can see a bit more about the OP on his profile and I think it is likely a real problem (though homework is allowed too - it should just be tagged of course)
Yeah I'm not objecting to the question, just checking if my spidey-sense was set up right ;)
 
1 hour later…
11:15
2
Q: Can we add 'asked', 'answered', 'edited' text to each question featured the front page?

Jack DouglasWhen I'm looking down the front page on dba.se, I often wish I could tell at a glance what happened to the question to bump it there. Sometimes it is obvious from looking at the number of answers, other times you have to follow a link to find out if it has been edited or if an answer has been add...

 
2 hours later…
Ell
Ell
13:26
Hi guys
Ell
Ell
I was thinking about asking a question
but I just found the answer >.< haha thanks anyway
13:53
Top link from this week's newsletter: SQL Puzzles for Teachin': http://dba.stackexchange.com/questions/29/where-are-some-useful-sql-puzzles-to-teach-sql-in-a-workplace See the newsletter: http://eepurl.com/oQBtP
14:08
IF you're on the tweeterers and you haven't retwerted that, would you please be a doll and go share all the Ozar goodness with your fellow followers?
14:36
Thanks again @AaronBertrand
 
4 hours later…
18:24
take care of yourself @jcolebrand
porque?
tropical storm, or something like that
But ... you know where in the state I live, right?
Whoops, wrong picture, but it illustrates the point
S-Port, LA ... right?
Aye
You do realize it has to be at least a Cat 4 storm for me to see any kind of damage worthy of worrying about
18:27
alrightythen
didnt realize that ... i was raised in FL and we always assumed that you guys were the only state closer to sea level than we
were
Well, NO is closer to sea level
But I'm in a whole other place
so ... nevermind ... go get yourself a kite
2
I might as well be in the Texas mountainous regions
@swasheck I happen to enjoy kites.
@jcolebrand "mountainous"
But we don't get nearly as good a wind as you lot do in FL most of the time here, and I expect to work through the storm, sadly.
18:28
well i've been in Denver for the last 13 years
@swasheck well I did specify Texas ;-) There aren't really any mountains in Texas (I'm ignoring all parts west of Austin)
@swasheck ha!
i usually disavow any involvement with Florida
@jcolebrand you only just received?
19:30
@JackDouglas aye
But to be fair, our company moved offices
and I'm in the South, which is the utter backwater of the country
19:48
albino zebra?
i'm changing my display name to that
20:20
@jcolebrand With those eyes, it's probably leucistic, but similar idea.
or phenilketonuriac, kept on phenilalanine-less diet :)
@CadeRoux do leucistic zebra get red-eye if they are looking directly at the camera flash?
@JackDouglas haha
provided they have red blood cells
Hi @JNK you here?
JNK
JNK
ok @ReynierPM....
I'm not sure if I get your requirements correctly
First - do you get how cartesian products work?
20:30
Let me explain a bit more maybe I wasn't clear at all
JNK
JNK
AKA Cross Join?
Maybe I'm a little loss at this
JNK
JNK
ok
but wait a minute let me explain what I'm trying to do
JNK
JNK
When you say SELECT <stuff> FROM TableA, TableB it's a cartesian product
which means you will get every row in TableA paired with every row in TableB
So if A has 10 rows and B has 4 rows you get 40 rows, not 14
20:31
ok this convert into product and not sum
JNK
JNK
exactly
It's A * B
ok understood
JNK
JNK
What you probably want to do is a union
and/or a subselect
not sure how those work in MySQL to be honest
I'm assuming the same as SQL Server
@JNK that's quite the wager
JNK
JNK
20:33
@swasheck Notice I said assume not bet
@JNK :)
JNK
JNK
So your best bet will be something like SELECT SUM(f) FROM (SELECT 1 as F FROM <first set> UNION ALL SELECT 1 as F FROM <Second Set>)
which will still get you dupes potentially if something matches both A and B
hmmm basically I've three tables blog, users and friends. What I'm trying to get is all the blog posts, all the users and all the blog posts from my friends that suit a LIKE condition
but because of pagination support I need to count all those records to see how many I get in a LIMIT query
JNK
JNK
You want the actual rows or just a count of matches?
both
two separated queries: one for the count and the second one to get the values
the count will allow me to paginate trough them
JNK
JNK
20:36
ok but you aren't getting them TOGETHER right?
You are returning a superwide row with all values from all tables?
or for each table separately?
yes can't split in two separated queries because this will cause problems with pagination
a superwide
just a few colums not all of them
JNK
JNK
OK then, here's what I would recommend
edit your question to include all this information
and table structures
and some sample data
and EXPECTED output
ok, will do this right now
JNK
JNK
That should get you an actual solution
OK good luck!
can you delete the post I leave so I can start a new one?
20:40
Why can't you just edit what you have?
We can eliminate comments, and if there are answers that are grossly wrong we can remove them
@jcolebrand ok just remove comments for start over with better question as JNK suggested
@jcolebrand here is the post dba.stackexchange.com/questions/23223/…
comments removed
@jcol
@jcolebrand thx
20:57
some of those are bloody impressive
(lost its freshness (sort of))
 
2 hours later…
23:14
@jcolebrand @dezso Sometimes I wonder, is this what the internet was made for? If the answer is yes, I'm ok with that.
23:25
@swasheck: I don't see the RECURSIVE_CTE in the FROM clause, in the second part, after the UNION ALL.
It's not recursive as it is now (and that's why the [BOMLevel] and [ItemPosition] are giving error).

« first day (601 days earlier)      last day (4566 days later) »