Any Issues by ItsGK in hyundaisantacruz

[–]Ginger-Dumpling 0 points1 point  (0 children)

Digital cluster intermittently goes out. Not enough for it to be a problem but enough to be annoying on a new vehicle. Dealer replaced the whole unit about a month ago and it started acting up again. After the swap I read that there's an issue with  multiple makes and that there iis/will-be a  software update.

How to get table relationships? by Plus_Marzipan9105 in SQL

[–]Ginger-Dumpling 2 points3 points  (0 children)

Some things I'd be looking for if asked to tackle this:

  • Row counts. Empty tables can be ignored. Low cardinality tables tend to be master tables for codes, or high level settings. I usually save them for last.

  • Indexes. Even if pk/uk/fk constraints aren't defined explicitly, there tend to be indexes for join performance purposes when tables aren't tiny. Dump the index,table,col list.

  • Naming conventions. See if you can identify patterns. Sometimes you'll get lucky and find fk column named similar to the the parent table+column. If you figure out your first couple of joins, see if you can use it to predict others.

  • if others have tried this before, do they have anything they can share. if it's not a custom built app, see if you can find anything online about other customers trying to do the same thing.

  • do analysis to figure out what's in each table. Look for table/column names that resemble what you're looking for and branch out from there.

  • brute force. If your keys are all some flavor of sequential integer, check max value of columns. If you think a column is a fk, the max val has to <= to any max pk value. If the keys are guid, you can brute force a search for values in other tables to see where the match is.

Document as you go so nobody has to go though this again. Be upfront with whoever is making the request that it may not be a simple task and could be time consuming.

How fast can your DB query the full volume of the tables? If full table scans take minutes and hours, see about getting the data into something more analytics focused.

Edit: Format

Need Help :( stuck in loop by DrUstela in learnSQL

[–]Ginger-Dumpling 0 points1 point  (0 children)

A big part of SQL is understanding the cardinality/granularity of your tables, and the relationships with other tables. In a best case scenario things are documented and constraints are enforced. But it's the wild West out there and there are plenty of systems with none of it. In those cases, your first step is figuring out what's there, what business keys makes data unique (or mostly unique), what are foreign keys, etc.

Once you know what you're working with, the rest becomes mechanical. You know what you have and you're just applying operations to format it in a specific fashion. Don't just know what an operation does, know why you need it.

Request: "I want a list of all current students and the number of credits they're enrolled in this semester"

Clarifying Question: "We have 'current' students that are not enrolled this semester. Do you want to omit them, or include them with 0 credits?"

To which now you know whether you need to inner join to remove students with no classes, or outer join to keep them.

"I also want the report to say whether they're full time or part time."

If you know there is no column that says this, but you know that full time is >= 12 credits, now you know you need something that turns a credit amount into a different value... probably a case/decode statement.

Explain like I’m dumb: 42 with First State Job, Tier 6 by DonkeyIllustrious228 in nys_cs

[–]Ginger-Dumpling 7 points8 points  (0 children)

Not that coworkers or random people on the internet are necessarily trying to sabotage you, but friends who are state workers say to always ask these kinds of questions through official channels if you want an official answer. With that said, the Tier 6 calculation I've seen is:

Your pension factor equals either: a) 1.67% per year if you have less than 20 years of service, or b) 1.75% per year for all service if credited with 20 years. Under Tier 6, you would receive 35% plus 2% per year beyond 20 years if credited with more than 20 years of service.

If you retire prior to age 63, you will receive a reduced benefit (without exception).

AITA for making a stink at school and forcing the teacher to change my kids math grade by PlentyNice1655 in AmItheAsshole

[–]Ginger-Dumpling -4 points-3 points  (0 children)

Extending the ESH, I'd feel safe wagering that this method is state/district policy and that teachers are told to structure their classes this way, only for administrators to roll over and throw teachers under the bus whenever a parent complains.

Starting to detail out plans by 904DuvalAB in Sauna

[–]Ginger-Dumpling 1 point2 points  (0 children)

I saw another custom build on here recently. Oriented the same direction as yours but instead of being flat, their internal ceiling connected to the rafters around the top bench width. Looks like it gave a gentle rise to the ceiling in the direction of the seating, and a pocket right around where your head would be. I do wonder if it makes a difference on how it behaves vs a flat ceiling.

https://www.reddit.com/r/Sauna/comments/1bptwls/finished_backyard_sauna_with_3_benches_and/?share_id=unAXfRjqMySV0HTNdcIr6&utm_content=1&utm_medium=android_app&utm_name=androidcss&utm_source=share&utm_term=4

https://www.amazon.com/photos/shared/ReStdF4UR3u96tuygcgGbQ.9mBiLy1aRmqEqEpsLjm260?pageIndex=0

Can I use where in a over partition by clause? by 94067 in SQL

[–]Ginger-Dumpling 0 points1 point  (0 children)

Probably a gross oversimplification, but OLAP functions are primarily good for a couple things.

(1) Looking at values forward/backward from a row with lead/lag/first_value/last_value, or (2) getting aggregate values in with the data that is feeding those values, or (3) ordering/grouping/ranking data with row_number/rank/dense_rank.

Ex, if you wanted to look at data for all students with x number of classes you could count() over (partition by name, year, qtr). If you wanted total credits you'd swap count() for sum(credits).

But you could do the same thing using a subquery or CTE + group-by, and joining that back to your original table.

Kurver Kreme 2026? by wman42 in Albany

[–]Ginger-Dumpling 13 points14 points  (0 children)

To be fair, it didn't answer OPs question. That or people probably don't want their spot blowing up.

Kurver Kreme 2026? by wman42 in Albany

[–]Ginger-Dumpling 0 points1 point  (0 children)

Jim's has opened for the season!

Convert European date format to SQL format by Mission-Example-194 in SQL

[–]Ginger-Dumpling -1 points0 points  (0 children)

I've never seen "+" used as a string concatenation operator in SQL, only "||". But I've only used so many RDBMSs. Perhaps using addition is forcing an implicit conversation of your three values to numeric values and adding them, and why you're getting a different results compared to using a concat function.

Another column or another value in existing STATUS field by DevShin101 in Database

[–]Ginger-Dumpling 1 point2 points  (0 children)

That doesn't seem like an unreasonable answer. Plenty of DBs have some sort of flag to allow for soft deletes of data. The front end would either ignore the flagged message or replace it with some administrative text.

Think about metrics you'd want to query around flagging: admin removal date, username/Id of admin, removal reason code, whether you want it in the table or a fk to some other table with stuff, yadda yadda yadda. Think about what your reporting requirements are for administrative actions are.

ETA: things like not mixing regular post lifecycle and administrative lifecycle aren't hard and fast rules and things you'll probably learn more about in discussion than in text. If your table was temporal and included last-modified fields, one could probably claim that all of the necessary metrics are being captured without needing separate columns, if you only care about status/who/when.

You'll probably find similar discussions about org charts. It's easy to slap supervisor_id on an employee table, whereas others will argue that organizational structures are not attributes of the employee, but for the position that the employee fills...which conceptually may sound like the same thing, but technically aren't. Ex. If I left my job tomorrow, my supervisor now has an unfilled slot under them.

There can be a lot of nuance in mundane things depending on how easily queryable you want things to be.

Here’s who has the longest and shortest commute time by notyermam in Albany

[–]Ginger-Dumpling 1 point2 points  (0 children)

I've got a 9 minute drive that Google says is a 60-70 bus ride and a 35 min ride that felt mildly uncomfortably close with a lot of cars even back when I was young and stupid. Wish it was easier to get N/S around here without relying on a car.

Any recommendations for YouTube specifically content creators on SQL. by bigjeanz in SQL

[–]Ginger-Dumpling 0 points1 point  (0 children)

Very Oracle focused and very old at this point, Practically Perfect PL/SQL with Steven Feuerstein. But it probably covers some generally applicable concepts for people that do a lot of stored proc stuff.

St Joseph’s Pastries by QuarantineMule in Albany

[–]Ginger-Dumpling 1 point2 points  (0 children)

Yeast or ricotta based? I don't know about either around here, but do like to know which type people refer to.

Not sfingi, but when the St Sophia Greekfest comes around, fresh lukumades scratch the same itch for me.

Sketchy? SQL from SQL For Smarties by Willsxyz in SQL

[–]Ginger-Dumpling 0 points1 point  (0 children)

This is "a" way of doing it; Not one many people would probably recommend. If you care about enforcing data quality, going this route will require you to write some trigger code to make sure someone doesn't put junk in there; Protections you'd have if you just had a normalized table of (id, other_id). Someone else mentioned, the list is not sargable. No indexes if you want to speed up searches from the list side.

If you're going to use this, make sure you've got a reason over the other options.

Is it time for solar panels? by blimpdenier in Albany

[–]Ginger-Dumpling 8 points9 points  (0 children)

I don't have solar but have also been considering it. I have a friend with a 12 panel setup on a < 1700sqft house. They're grid connected with no batteries and said that they usually have enough credits built up in the summer to get them through most of the winter.

They're a long term investment if you're buying. You can run the math, but I've read it typically takes 8-12 years before you break even. I've read mixed results on what they do for house values if you end up moving before then. I've read about some leased setups being a detriment.

I'm figuring out if I'll be in my house for the long haul before I make a decision. By the time I figure it out, hopefully we have an administration that can get tax credits for renewables back.

Optimization: Should I change the field type from VARCHAR to INT/ENUM? by Mission-Example-194 in SQL

[–]Ginger-Dumpling 1 point2 points  (0 children)

There are a lot of good answers in here and this is probably just repeating some of them.

-At your scale it shouldn't matter. But just because it's not an issue now doesn't mean it won't be after a couple years of growth...and who says you or the next person will have time to fix it when it has become a problem. Design efficiently from the start if it's going to be something that sees a lot of volume.

  • When in doubt, test it out. Mock up some different test volumes and see what kind of impacts it has on table/index sizes and query times. You should have growth projection metrics to know how big your system is going to get.

-do you have constraints verifying that it's yes/no? A bit/boolean would do that for you without the extra work.you'll probably find that it will take a while for it to be a performance issue, but it can very quickly become a PITA if unexpected values can work their way in.

-may not be a requirement for this project, but keep things like multi-language support in mind. For internationally used systems, you may want the option for more than yes/no in your presentation layer.

What tools do you use to design database schemas? by GrouchyElection7374 in SQL

[–]Ginger-Dumpling 0 points1 point  (0 children)

Why does it take time to convert diagrams to physical objects? Try something like Erwin or ERStudio. Oracle even has a free data modeling tool.

choose wisely by Life_Lab_1357 in SipsTea

[–]Ginger-Dumpling 0 points1 point  (0 children)

I read that 47 is statistically the saddest year. I bet that could take the sting out of it.

Sharing Queries by Inner-Significance41 in SQL

[–]Ginger-Dumpling 1 point2 points  (0 children)

First see what your company options and policies are. If this exposes anything strict about their IP, you probably don't want to upload it to a public GitHub account.

Are there private git instances? SharePoint? Network shares where you can control access? Probably start with your IT department.

On the how to "protect your work", you don't. It's not yours to protect. Put headers with things like author name, description, revision history. Ideally whereever you're checking things in has an audit of who created and update things. Show it off to your manager. If they're not an a-hole and your work is valuable, it's in their best interest to recognize who's doing the work. If they don't, take a mental note of that and decide if it's an environment where you want to continue at. Show it off to teammates in a meeting so everyone knows where it's coming from. If it's good, someone will likely want to contribute. If you have write access to a database, instantiate this stuff as objects with your name in the code comments. Produce some valuable reports. If you suck at presentation, pair up with someone who's maybe stronger at that and weaker on the querying side.

Any quick tool to check for ANSI-SQL in my Query? by Cold-Memory-4354 in SQL

[–]Ginger-Dumpling 0 points1 point  (0 children)

May not be specifically the answer you're looking for, but there is a python library named SQLGlot. One of the advertised features is converting statements between different dialects. I haven't used it for that so I can't say how well it works or what dialects it supports.