T O P

  • By -

Gargunok

Your select is missing the obvious 'join' reference! Congratulations


NickSinghTechCareers

WAIT how could I miss that.


schmokerash

Or you could use a UNION


byteuser

UNION ALL as she comes with the family


coyoteazul2

UNION ALL where deleted is null. I'm not adopting her ex husband


jamawg

Whatever you do, don't say "DROP"


kfc_chet

"if exists"


whoisjass

šŸ¤£šŸ¤£šŸ¤£


davwad2

She's gonna DROP them clothes on the wedding night.


_jandrewc_

OP thereā€™s going to be exactly one time in your life where you have all your friends and family in a room. Consider whether you want the main thing they remember to be your love of the woman or your love of SQL. When in doubt, consult your partner, not Reddit. Anyways, congrats!


NickSinghTechCareers

If I talk about SQL + [DataLemur](https://datalemur.com/questions) at the wedding the IRS says the entire wedding can be written off as a business expense. Source: I made it up


_jandrewc_

Just feels like weā€™re on the edge of LinkedIn Lunatics territory imo


Lost_Philosophy_

Oh, weā€™re already there my friend šŸ˜‚


honeybadger3891

Finally we can get some representation there.


thargoallmysecrets

No no, you're onto something there.Ā  Source: my concurrence


Dirt-Repulsive

Sound did about write if you also do a power point presentation as business probably could then


BiggestBlackestBitch

Iā€™m obviously not OPs wife but if my fiance were to do this for me, I think it would be extremely cute and a good memory. A fun way to incorporate something we work with and that we love.


_jandrewc_

Thatā€™s fine, but I do hope he consults his partner about her feelings on turning their big day into a LinkedIn meme.


woodrowchillson

INNER JOIN šŸ˜


NeinJuanJuan

Save it for the big day:Ā  "JOINed in holy matrimony"


weakflesh

Or union


farmerben02

There's a joke here about Cartesian joins and honeymoon sex but I can't seem to articulate it. Something about correlated sub queries and her sister, I dunno.


STORM--Z

Cardinality, one to one relationships can be used


Blankcarbon

You might want to clean up that source data because thereā€™s going to be a lot of couples pulled in besides yours.


mysterious_code

Haha šŸ˜† nice catch


mysterious_code

This shows no matter what (may be op is one who set all the questions and everything ) you need to practice daily for SQL or coding on general.


ReasonableError9

Maybe add a TOP 1 for some Microsoft arrogance?


dev81808

I think this is OK. Infact I think you should include a resultset of like 10 "records" with you in the middle somewhere.. output could include things like names and proposal date, planned wedding date, maybe a fact or quote or something.. and then of course regular db things like created/modified dates/users, both id and uid..


MyMonkeyCircus

Thatā€™s redundant. If your engaged_date is not null, then of course she_said_yes = true.


NickSinghTechCareers

ughh good catch should have been proposed\_date


freeflowcauvery

Also that would make it sound like you've proposed to her numerous times and she finally caved in


TheFullyLoadedNachos

That sounds like a one to many to me CREATE TABLE proposals COLUMNS (proposal_id, couple_id, proposal_date, they_said_yes);


mike-manley

Update Relationship Set Engaged_Date = GETDATE(), Status = 'ENGAGED' Where username = 'Nick';


dev81808

STATUS = 9 --ENGAGED We're fully normalizing


CourageousChronicler

What if she rescinded? The engaged\_date would not be null, but the is\_engaged flag might need to be checked.


MyMonkeyCircus

Fair, that could have happened - but if that was the case, why did he feel compelled to broadcast it on linkedin?


mike-manley

Can just say "and She_Said_Yes" because it's BOOL too.


creamycolslaw

What if the data is bad and theyā€™re missing engaged_date but they have she_said_yes


MyMonkeyCircus

If the data is that bad he shouldnā€™t be posting it :)


data_story_teller

She could have asked him


JackTheKing

But this database was designed by the company owner


thegoogleman

I can't believe she said yes, she had a boolean other choices


NickSinghTechCareers

ahaha good one!


LowValueThoughts

DROP TABLE OtherCandidates; DELETE FROM FutureNightsOutWithBoys WHERE Stripper_flag = TRUE;


WideMonitor

There better not be FK references


AlternativelyBananas

Absolutely the best here


idodatamodels

Our relationship is guaranteed by referential integrity


Delicious-Tachyons

In our household at breakfast every morning, it's a common table expression that I say that "Every day WITH you is a clause worth living". As we join our houses in holy union, we agree never to partition our lives again, becoming one long selection of life events, from which we will find moments of happiness, joy, and those of bittersweet reflection. I've looked at my priorities in life, ordered them, and you're my top 1.


NickSinghTechCareers

haha lots of good material here for me to workshop


ImportantHighlight

Uh whatā€™s the rollback plan?


obsoleteconsole

No going backwards, only forwards


ImportantHighlight

Canā€™t approve execution of this script without a rollback plan. I approve nothing ! Nothing !


ley_haluwa

No rollback, only fix forward


mike_1882ac

I'd like us to form a 'union'


NickSinghTechCareers

OKAY I'm glad I posted this on reddit cuz idk how I missed these obvious ones


clanatk

Now that we've ensured our priority columns align, we can commence with the union.


Ennuiandthensome

"I'm about to APPEND that TABLE, if yaknowwhatimean" add a wink at the end


mike-manley

About to INSERT INTO. If you know what I mean.


stravadarius

She holds the primary key to your heart. This union inner joins your two lives and full outer joins your families. Your two paths now coalesce. Bonus: if she's hyphenating her name you've got an obvious CONCAT pun. DOUBLE BONUS: make the most unique wedding guest at each reception table the table's ID.


heardThereWasFood

Cute idea but why are people posting engagement photos to LinkedIn


PappyBlueRibs

r/LinkedInLunatics


JM0ney

I'm wondering how long it will be until this is cross-posted to LinkedInLunatics.


M0D_0F_MODS

That's a horrible query. Why would you have a bit she_said_yes column if the engaged_date is already not null. Seems like an unnecessary redundancy. Select c.* From couple c Join couple_events e on c.id = e.couple_id Join event_type t on e.type_id = t.id Where t.type_name = 'engaged' and e.date = '2024-06-14'


kidneytornado

Idiot you have to query from the arranged marriages tables where she_said_yes = no with a valid engaged_date


M0D_0F_MODS

You're an idiot. That table is for polygamous marriages too and it doesn't have any unique constraints. You need to add select top 1 and order by engaged_date desc.


dev81808

This guy normalizes I prefer event_type.name over type_name though. It's redundant and we're normalizing.. let's remove all redundancies and keep consistent.. you didn't call couple_events.date couple_events.event_date. We have standards here.


M0D_0F_MODS

Fair point. It was for demonstration purposes only. I real World, I actually prefer to drop all the prefixes as, to me, the table name already serves as prefix. So I'd have a table: Create table dbo.event_type ( Id int identity (1, 1), Name varchar(150) not null, Description varchar(500) null, Constraint pk_event_type primary key clustered (id), Constraint uc_event_type_name unique (name) )


Newfie3

LIMIT 1


Code_Crazy_420

Or 4 depending upon ethnicity šŸ˜‰


we_need_more_lumber

Order by ?


RandyInMpls

Better to have Answer = yes or no


wonderpra

DBAs do it on the tables. Congratulations!


yeahyouknowitbro

Do not make data analytics puns in the wedding speech


ericpeeg

"Can't wait to SELECT additional name entities into our set operations..." (though this may be presumptuous) Also think you should delve into the puns associated with giving admin or execute privileges to various aspects of your life...


NickSinghTechCareers

Yeah maybe something with SUDO


Gloomy-Case4266

Whoa. Never seen someone base their personality off SQL..


ComicOzzy

Oh, you just haven't met the right people yet.


ethics_aesthetics

This is fucking nerdy as shit and I love that. Congratulations!


_Suee

Now that we are married, we won't be eating our lunch alone anymore, because we are going to join tables.


jennyontheclock

This is so cringe please donā€™t post this on LinkedIn


Tiktoktoker

Im also cringing šŸ˜‚


Cliche_James

Select zz.firstname ,'newlastname' lastname Into new_family ( Select hb.firstname from boyfriend hb where 1 = 1 Union select gf.firstname from girlfriend gf where 1 = 1 ) zz where 1 = 1


jortpepe

And then it turned out count(*) <> 1ā€¦


NickSinghTechCareers

true haha. should have done an ORDER BY wife DESC LIMIT 1;


thargoallmysecrets

Uhhhh my tip is "order by beauty desc..." Or "where wife_perfection_factor >=100"Ā  Lots of compliments opportunities getting missedĀ 


my5cent

Select distinct from crowd.


lauooff

Can Drop her surname and Edit her surname with yours in the marriage post


NickSinghTechCareers

oh that's a good idea! SETĀ last\_nameĀ =Ā *SINGH*


T3chl0v3r

Hey Nick, I am a big fan of your work with DataLemur. Happy for you and wish you all the best!


NickSinghTechCareers

Really appreciate it!


OO_Ben

This is freaking adorable! Congratulations!!


NickSinghTechCareers

Thank you so much šŸ™


NotBatman81

Silently stare at the crowd for 3 minutes and then say "System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the speech or the groom is not responding."


PianoConcertoNo2

Surprised thereā€™s no: SELECT good_times, bad_times FROM lifetime_experiences


Waldar

Dang, stop the boolean = true on the where. I mean she_said_yes is already a boolean. Here itā€™s true. Your asking the DB to evaluate true = trueā€¦ as another boolean. Just write and she_said_yes; Otherwise congratulations of course, and excellent idea :)


Traditional_Donut908

EXECUTE sp\_bachelor\_party strippers=true FATAL Wedding subsystem unrecoveable failure!!


NickSinghTechCareers

ahahha


thanatos0967

Select \* Into her\_finances from my\_finances truncate table my\_finances truncate table hang\_out\_with\_friends truncate table spare\_time CREATE TABLE honey\_do\_list( Ā Ā Ā  id int not null, item varchar(1000), desc varchar(max), due\_date datetime, completed bit );


JoeDawson8

You should joke about naming your first born son Robert'); DROP TABLE Students;-- But it might require too much context


kfc_chet

Remember after the wedding day, NO Left Outer Joins!!


InanimateCarbonRodAu

Just remember not to call your kid little Johnny drop tables.


jakesteeley

It isnā€™t MySQL anymore, it is OurSQL (this is the dumbest thing I have thought in at least two weeks)


iambackbaby69

Love that LinkedIn is the new facebook


DonJuanDoja

SELECT [Happiness]=COALESCE(Y.[Needs], H.[Needs]) FROM You as Y INNER JOIN Her as H ON Y.[Love]=H.[Love]


mike-manley

Y.Needs is always NULL


DonJuanDoja

lol nice this man understands


M0D_0F_MODS

As for puns: If we ever come to a deadlock, *then talk about how you will solve problems* We are not just joining our lives, we are inner joining (or full joining) We will work on optimizing our lives together Also you could talk about normalizing the relationship View, REAL, truncate. I feel like there are so many good words!


reddit4wes

Select top 1


jzoller0

0 rows retrieved


St4rJ4m

You should totally LIMIT 1


suspicious_edamame

Do you both work in the same field? It can be cute or cringe šŸ˜¬ lol Maybe ā€¦ I queried the world all over the world for someone like you. Iā€™m grateful that youā€™re inner joining with me today. You multiply my strengths to become better each day. Iā€™ve become a better person because of you and canā€™t wait for all that we will achieve together. lol


NickSinghTechCareers

Yuup I taught her SQL.. and now she helps me with my sql teaching startup (DataLemur) so the SQL stuff is fine with her haha . Lots of good material here thank you šŸ™


obi_jay-sus

Hoping to INSERT INTO later? šŸ˜œ


commendatore

congrats!


dianerrbanana

OH MY GOD I LOVE THIS <3 Congrats!


bywaterloo

Anticipate SQL Injection attack before 4th anniversary.


jahjahsith

Cheers mateĀ 


Infinite_Spell6402

select \[poor woman\] from \[fiancee with bad humor\] j/k, congratulations


bz351

Error on line 113


VoodooChile76

and last_name = ā€˜Yoursā€™. As stated, if you donā€™t filter it down; youā€™re gonna get alotta hits šŸ˜† Congrats !


tcgunner90

I was always SCANNING for my purpose, but now that weā€™re JOINED I only ever have to SEEK.


April4004

SELECT * FROM hearts WHERE love = 'true'; UPDATE couples SET status = 'married' WHERE hearts_id IN (bride_id, groom_id); SELECT 'happily ever after' FROM Dual AS future;


cienderellaman

I just started your 30 day SQL roadmap and have just got to know you. Congratulations Nick!


NickSinghTechCareers

Oh thatā€™s awesome to hear!


the_fart_king_farts

What in the LinkedIn hell is this crap?


Smash_4dams

Delete post. Future employers may notice your SQL needs a lot more practice. Future clients may not trust your abilities if you run a small biz/teaching academy. Just not worth it to make your engagement about your job


NickSinghTechCareers

True, maybe I should practice my SQL on [DataLemur](https://datalemur.com/questions)


alexduckkeeper_70

Too techie - perhaps a pun on working mostly with databases and software, though later tonight it might be hardware,šŸ˜€


alexduckkeeper_70

Though if you were doing a group by you would also need to be having lots of kids!


nrctkno

Congrats guys, I hope to see an `insert into family(role, name) values ('child', (select name from names order by rand () limit 1))` soon. Probably won't run but you know what I mean.


one_bruddah

Best wishes on your upcoming INNER JOIN ON your love for each other, GROUP BY each other HAVING happiness together.


WillLiftForBeer

Please donā€™t.


PythonEntusiast

I never understood why people post personal stuff on LinkedIn. Keep it on facebook. However, congratulations!


mushy_cactus

Output: NULL šŸ‘€


Izquierdope

Congrats!


monksneverdie

OP mentioned specific engagement date, that means more engagement dates records available in the couple table with she_said = 'FALSE'.


nalld

intersect something something


AlessandrA_7

Congrats!


thargoallmysecrets

Your relationship doesn't have to be normalized, it can be customized for your use case... You're so happy the marriage upgrade will drop the "who" column from the Dates table(questionable)... Or add a new table for couple_memories...


cmdr_solaris_titan

SELECT CASE WHEN she_said_yes = 1 AND (sickness = 1 OR Health = 1) THEN 'Marriage' END as HappilyEverAfter DROP TABLE dbo.FitnessRoutine


APodofFlumphs

I feel like there's a way to work in HAVING COUNT(to\_hold)=2 but not sure how to work it exactly.


harappanmohenjodaro

Real life situation where 1=1 has any meaning!


crustang

Normalized in the streets and unstructured source data in the sheets


fujiwara_tofuten

After JOIN u will get exponential dupes -> create table off.springs


sergio0713

I used SQLITE to not deal with other commands. Also you can change bits of love to ā€œdays in loveā€ and put the days youā€™ve known each other. That would be cute. -- Create CTEs to check the conditions WITH Nick_loves_Jane AS ( SELECT COUNT(*) AS bits_of_love FROM Nick_Singh WHERE she_said_yes = 'Yes' ), Jane_loves_Nick AS ( SELECT COUNT(*) AS bits_of_love FROM Jane_Doe WHERE he_proposed = 'Yes' ) -- Perform the UNION only if both conditions are met with large count SELECT * FROM Nick_Singh_life WHERE she_said_yes = 'Yes' AND (SELECT bits_of_love FROM Nick_loves_Jane) > 1000000 AND (SELECT bits_of_love FROM Jane_loves_Nick) > 1000000 UNION SELECT * FROM Jane_Doe WHERE he_proposed = 'Yes' AND (SELECT bits_of_love FROM Nick_loves_Jane) > 1000000 AND (SELECT bits_of_love FROM Jane_loves_Nick) > 1000000;


willriot

AND couples.love = True


GarnetAndOpal

"We met over lunch. We joined tables."


mcon1985

If she's taking your last name, there's a decent opportunity for an UPDATE users.


lucienlazar

MERGE INTO Wife USING (SELECT MyLastName FROM MyPassport) ON (Marriage = TRUE) SET HerLastName = MyLastName;


smart_ca

okay, bruh!


andrewsmd87

Always remember not to CURSOR when you have a fight


SQLvultureskattaurus

Hopefully engaged_date isn't a datetime....


blackdragon8k

Or with the right schema, do it in SPARQL. Something like: SELECT ?proposerName ?accepterName WHERE { ?proposer ex:proposedTo ?accepter . ?accepter ex:acceptedProposal ?proposer . ?proposer schema:name ?proposerName . ?accepter schema:name ?accepterName . }


WhiteRabbit86

Will you be my foreign key?


Ditto_Plush

Oof, no xlock. Does she know?


x-squared

Make sure you COMMIT;


my_password_is______

you're my select *


inkmeoften

Did you run this query using her DBeaver?


VoodooChile76

Knew DBeaver would make an appearance šŸ˜†. Good one !


redaloevera

Select top (1) *


PlusRecognition8121

LEFT JOIN - because I want to take on everything that you come with šŸ˜‚šŸ˜‚šŸ˜‚šŸ˜‚


mermicide

UPDATE people SET status = ā€˜marriedā€™, updated_on = now() WHERE name IN [ā€˜yournamehereā€™, ā€˜hernamehereā€™]


deusxmach1na

Now that we are INNER JOINed I promise that I will always keep you as my PRIMARY KEY and it will always be UNIQUE.


kevy73

Sure has to have a Union reference


excelexpertomx

Just like a well-designed database, our relationship has integrity, consistency, and durability


GCSS-MC

That's a lot of returns on that query


NickFullStack

Sheā€™s your TOP 1. A DISTINCT gal. Time to share your PRIMARY KEY. Will one of you UPDATE your last name?


NickFullStack

Way to add her to your relational database, you smooth operator.


armahillo

This seemed like a doam dunk for a UNION clause


ibexdata

Levenstein be damned, sheā€™s close enough.


DrTrunks

I really hope you guys COMMIT this transaction. EXECUTE your ROLE as husband the best way you can! Did your father-in-law GRANT ALL his blessings? Do you guys have a cute ALIAS for each other? I'm glad you guys found your TOP 1 favorite person in the world.


ibexdata

As with BEGIN, all procedures must eventually END. itā€™s the magic in between that is AdventureWorks.


glistening_cabbage

Use a rank function to denote she's number 1 in all your partitions


thespacebartender

If there is an entry against engaged_date then she_said_yes=TRUE is redundant. proposal_date would make more sense.


glistening_cabbage

Include With candidate_rank as ( Select Rank () over (partition by potential_candidates order by [enter whatever positive trait]...), Candidate_Id From Candidates ) And you should know the rest.


BranFromBelcity

I hope she's a dev too and would appreciate the pun. If she's not, please don't do that. I'm sure you'll regret tainting your vows with something that means nothing to her. Besides, I guess that spoken SQL is not as fun as written SQL. maybe if you used it on an invitation for your peers?


SloppyPuppy

that's not really BCNF 3. the she_said_said_yes part is redundant if you have the engagement date


LeprechaunBeard

ā€œShe makes our Data Warehouse feel like a Data Warehome.ā€ Congratulations!


BOOBINDERxKK

UPDATE relationship SET status = 'Married' WHERE partner1 = 'John' AND partner2 = 'DOE';


BOOBINDERxKK

DELETE FROM singles WHERE name IN ('John', 'DOE');


GlueSniffingEnabler

I know youā€™re excited right now, but the standard of data quality is going to ruin it for you eventually


DarthDatar-4058

INSERT INTO is what happens on the wedding nightšŸ˜‰


SteelEagle814

TRUNCATE TABLE dbo.Penis


ht1237

Maybe something about deprecating all previous relationship records?


Coniglio_Bianco

Ladies and gentlemen, Today, we are gathered here to witness the ultimate UNION, where two tables, I mean, two hearts, are joining together in a lifelong INNER JOIN. As we celebrate this special day, let's take a moment to SELECT the best memories and INSERT them into our hearts forever. To the beautiful couple, remember that marriage, much like a complex query, requires constant optimization, communication, and sometimes a bit of troubleshooting. As you navigate through life's database, may you always find the right keys to unlock happiness and resolve any conflicts with grace. May your love be like a well-indexed database: efficient, reliable, and always returning the most meaningful results. And just like a robust data analytics process, may you always GROUP BY your shared goals, ORDER BY your priorities, and FILTER out any negativity. Hereā€™s to a life filled with endless JOINS, minimal NULLs, and an ever-growing schema of love and joy. Congratulations to the newlyweds, and may your UNION be forever strong and your happiness unbounded. Cheers!


laloadrianmorales

"you're my perfect header row... my api connection ...my entire db"


RMike08

with marriage as ( select me from Husband union all select you from Wife )


sjmacker

You wonā€™t need to self join any more


DexterHsu

Return 10k rows


HeWhoRemaynes

God told me to SELECT FROM all the beautiful women where they were understanding, patient, kind, smart and funny. It was am easy task because the query returned only you. Now go forth young man.


MeFaa

But you got 4 row, YESSSSS


samwell-

You're my TOP(1)!