I'm designing a personal database that has a table which contains categories for seasonal events of a video game. In my design I have a related column from Events to Items (one to many [1:m] respectively). However, whenever there is no event/season going on, I'm not sure whether I should create a...
> I have [found several] reasonable arguments for either case (to use or not to use a null), but the problem is that none of what I've read so far is framed in use-case that would apply for my specific dilemma.
and this exchange in the comment section:
NULL is the "natural" way in SQL to store the absence of information. I personally avoid "magic values" or "magic rows" at all costs — a_horse_with_no_nameNov 6 at 6:58
@a_horse_with_no_name Thanks, that settles it. I'm going to use nulls. Besides, what I didn't add in my question to make it simpler is that, there was a intermediate table between the ones I mentioned that would have had to "inherit" the blank category row. It seems much simpler now. — DavidNov 7 at 4:02
I mean, horse's comment still didn't provide the OP with an argument specific to the OP situation but it somehow managed to convince him?
Anyway, I'm so far struggling to find how this question is not primarily opinion-based, to be honest
And an answer is not very likely to emerge either, it seems
@Philįµį“¹ I'm... genuinely usure if that's trolling or actually something they'll take your money for...
Next up: AWS Merlin - on demand, enterprise-scale MAAS (magic as a service). Support cloud-scale conjuring and arcana needs of the modern global corporation. (coming soon in wandless and incantation-free *nix distibutions)
@PaulWhite This question Already has 4 close votes again and the user didn't respond to your comment (even if he was seen just 3 hours ago) so I think it's safe to use CommentConverter by now
@George.Palacios IMO: It has a "touch" of homework, but doesn't "feel" like homework. However, it is pretty broad and may also pass as a shopping-list question. The question is probably missing the tag normalization and might benefit from it.
Oh! Ha! I had forgotten I'd offered to write the answer already. Sorry @TomV!
@miracle173 I reopened this so you can add a self-answer. There is some lasting value in this Q & A and it would be better to have that value in an answer rather than the question comments. If you don't want to self-answer for any reason, let me know and I'll do it for you. — Paul White ♦Nov 22 at 3:02
@PaulWhite perhaps I'm mistaken, but what is the lasting value in the question? Unless I'm missing something, that only applies to sqlfiddle, no? Or, are we tech support for sqlfiddle now? (I'm not trying to be sarcastic.)
@PaulWhite your "Comment Converter" sock is misleading users into thinking that's the way to do it. Don't get me wrong, I love the idea, and perhaps everyone should just have a comment-converter-account. Of course, I suppose people could just make the answer community-wiki. And you probably don't want your name attached to every comment converted into an answer.
Maybe a nice option would be to allow "anonymous" posts with just a simple checkmark, the same way there is a checkmark for "community wiki"
I'd ask StackExchange to implement something like that, but it would probably be conscripted to the "6 to 8 weeks" pile.
and, while I'm ranting, why the heck doesn't the Close-Vote-Review-queue allow you to vote on questions. And by vote, I mean downvote.
@MaxVernon That's exactly how I used to do it - a CW answer with my name on it. I created the sock simply to avoid that. Not every answer I converted was something I wanted my name on directly. The idea of converting comments to answers and optionally CW-ing is as old as the hills, and certainly predates my participation on the network.
@MaxVernon I don't know about that. We allow Q & A on other tools database people use regularly.
I created Comment Converter as way to show people how much better answers are in answers than comments. It is not intended to be used as a service (it is time consuming). Why make work for others? Answering in comments does new users a disservice by illustrating how not to do things! — Paul White ♦Jul 19 at 14:03
@MaxVernon Likely to be declined since you can already do that simply by logging out or using a different browser.
@PaulWhite You've just saved me several massive headaches with that - bookmarked, remembered, put in notepad. fiddle doesn't work for me assumedly because of some corporate filters / firewall
SQLFiddle has been an essential tool and a great complement to dba.se for a very long time, but it has gone downhill a bit in the last year or two.
I have also wondered for some time what a 'fiddle' designed specifically with dba.se and markdown in mind might look like, and over the last few day...
I didn't buy my car. It was given to me by a company I work for. The boat is also owned by the same company. The same company also builds road networks in the area where I live. There's an area across the river I frequently want to visit, which I always do during my boat trips. I suggest to my company that a new bridge is built. My company tells me that I don't need to go there while driving their car (which I'm told not to rush with), and if I do want to go there, I can use the foot bridge 100 meters downstream. Since I like that area and the bridge is far, I'm tempted to stop using my car. — John DvorakDec 3 '14 at 5:01
@MaxVernon I have the same gripe with the low quality posts queue, it's flagged as low quality but I can't downvote it, I have to open a new tab to downvote it which doesn't bother me, but I have to vote "looks ok" in the review queue
But I agree, I wanted to VtC initially and then saw the comments (now vanished) in which the OP asked why database client tools are on topic but SQLFiddle is considered off topic, then there was a whole discussion and the question was reopened because the answer was posted in the comments and Paul wanted to give the op the chance to self-answer
I don't really care if it ends up closed again, it's unlikely someone else will add a competing answer but I didn't cast the last vote because that would cause it to be reopened again to be closed again
It's a question, not a cat, it shouldn't resurrect twice
I had a look at their documentation, I think it's a valid question and an answer could be along the lines of "you can't use LDAP, but there is this trick that allows you to manage users externally or you should use this trick to create security groups"
@PaulWhite So had I closed it again by casting the last vote and the OP or you wanted to add an answer anyway it would have had to be reopened a second time for you or the OP to post an answer
and I assumed it would end up in the close queue at some point or another
first off you are making a mistake by using views with indexes...use the tables themselves and utilize their indexes...views themselves do not use the underlying indexes to the tables. No sense in looking in 2 places for what indexes to use.
I can just see max frantically trying several combinations in order to cheat the validation, he'll either be back in 5 minutes to proudly show the result or back in 20 to say it can't be done
@TomV presumably the latter since there appears to be not enough space in a user-name for the required characters to make it look good. I'll keep trying though!
Reading "IBM and the Holocaust" by Edwin Black. What an incredible book. Thanks @CadeRoux for the suggestion.
The CEO of Amazon AWS says they're dropping Oracle databases by end of 2019.
https://www.cnbc.com/2018/11/28/amazon-will-be-off-all-oracle-databases-by-end-of-2019-says-aws-chief.html
$AMZN Amazon will be off all Oracle databases by end of 2019, says AWS chief
AWS is kind of vulnerable to vendors tweaking their licenses to double prices on AWS v their own hosting platform. Wonder if MS will follow suit at some pointā¦
@MaxVernon Maybe I will continue on from the Kindle sample. I'm kind of vulnerable to losing all faith in humanity when reading stuff like that. Like I pulled up to the park the other day to go for a walk and there was a story on NPR about a woman surgeon who had done all kinds of great things, and then just as I got ready to turn off the ignition, they got to the part where she was shot and killed in front of her hospital by an abusive ex-boyfriend. If only I had driven a little faster...
We are replicating tables from SAP ECC 6.0 on HANA into an Oracle 10g warehouse, using SAP SLT.
Since starting this, we have noticed the NOT NULL column definitions from HANA are retained in the Oracle copies of the tables, but HANA stores many values as empty strings. Oracle stores empty (varcha...
But you still have these ID's in one table >>> same disk space, plus additional space for the new key. And keep in mind you'll need 2 reads or 2 writes to select/insert that table. You would save space if you had more than one table — McNets1 hour ago
@McNets I think the idea is sound and it will save space. Why do you think it isn't?
@ypercubeįµį“¹ because data is still there and then you add a int/bigint twice. I think it would help if that ID would exists as FK in many tables and you were able to change it by a surrogate key (i dont know if SK is correct in this context) But this field exists only once, and you'll add some extra work maintaining 2 tables. Maybe I'm not understanding correctly.
We stopped by my aunt's in Houston on our way to Austin to troubleshoot several issues - took 2 hours instead of 1 and ended up in traffic...: They needed AOL installed on a new laptop (yes), They had WiFi issues (due to a mirror in one spot and distance and walls in another - they'll need a repeater).
Lest assume that this (long ID) is repeated 10 times per average. We have 56 bytes * 10 = 560. If we split to 2 tables, we shave (56-4) * 10= 520 bytes and add 56+4+32 = 92 bytes.
@McNets I understood he wanted to keep them in a separate table
> My idea is to use one table that only contains the ID strings and the second table that contains all the other information and a foreign key on the first table.
@McNets I guess that's one situation where it would be nice to have database management systems that provide the option of preventing redundant physical storage of foreign key values, as mentioned in this interesting SO answer.
Anyone on 12.0.5600.1 aka Microsoft SQL Server 2014 (SP2-CU14) want to see if you can repro my index rebuild issue? https://gist.github.com/billinkc/49753a891722884b5b274afb449a0966
@ypercubeįµį“¹ As per my interpretation, the physical mechanisms in current SQL DBMSs entail storing the values of PK-FK pairs at least in (a) the physical structures supporting the row with the PK value and also in (b) the physical structures supporting the row with the FK value āthough sometimes the physical redundancy goes beyond this exampleā.
Ideally, one should have the option of storing the value only once, let's say in (1) the physical structure supporting the row with the PK value, and simply (2) setting up the physical structure supporting the row with the FK value so that it only makes a physical āas opposed to logicalā reference to (1), if convenient, e.g. to save disk space.
@ypercubeįµį“¹ The record key is generated from the mainframe and it assembles this unique key based on datetime + location + random factor and I believe that digit is the random bit.
Had I been here when we developed this partition strategy, we'd have just done integer division and modulus to get a "clean" value versus this stuff
Plus as Paul's article talks about (citation needed), the engine will ignore the persisted column and happily recalculate it every flipping time
At any rate, there's magic in having 100 rows in the table to cause this blow up
99 and the index rebuild works. 100 and boom
The partition key can be redefined as [PartitionKey] AS CAST((RECORD_KEY % 1000000) / 100000 AS smallint) PERSISTED NOT NULL and it'll still fail on the rebuild
But having a persisted computed column as part of the partitioning key is required. Reran it with providing explicit values for the column and it works great
@ypercubeįµį“¹ Yes, but all this handled at the physical layer, not touching the logical (relational) one. So e.g. when there's an UPDATE on a PK value, the physical layer only modifies the structure (e.g. an INDEX) supporting the row with the PK value, and the reference in the physical structure supporting the row with the FK value does not have to be touched, since it is only a physical reference (e.g. a pointer, as you mention), so that would be an example of a performance benefit, for instance.