« first day (3951 days earlier)      last day (87 days later) » 

4:45 AM
Hey people!
I have a doubt regarding JOIN.. I hope you can help..
I have 3 tables.
this is the table structure:
mysql> DESC exam;DESC student;DESC subject;
+----------+------------+------+-----+---------+-------+
| Field    | Type       | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+-------+
| sub_code | varchar(3) | NO   |     | NULL    |       |
| roll_no  | int        | NO   |     | NULL    |       |
| marks    | int        | YES  |     | NULL    |       |
| test     | varchar(3) | NO   |     | NULL    |       |
+----------+------------+------+-----+---------+-------+
I want to have an output like this:
12 hours ago, by Random Person
+------+-----------------------+--------------+-------+
| Test | Subject               | Subject Code | Marks |
+------+-----------------------+--------------+-------+
| MT1  | Maths                 | 041          |    29 |
| MT1  | Physics               | 042          |    36 |
| MT1  | Chemistry             | 043          |    42 |
| MT1  | Informatics Practices | 065          |    46 |
| MT1  | English               | 301          |    38 |
| MT2  | Maths                 | 041          |    37 |
Is this the correct query for doing it:
SELECT exam.test "Test", subject.name "Subject", exam.sub_code "Subject Code", exam.marks "Marks"
FROM exam
INNER JOIN subject ON exam.sub_code = subject.sub_code
WHERE roll_no=1
ORDER BY exam.test,exam.sub_code;
or should I use LEFT JOIN?
 
5:20 AM
There is no indicator that any of your desired output is null.
so inner join is fine.
but you're only joining two tables.
Try something like SELECT * FROM exam JOIN student USING (roll_no) JOIN subject USING (sub_code)
 
 
1 hour later…
6:31 AM
A chairde - Morning all!
@RandomPerson - Hi, but this is not to forum for asking new questions! One of the things it is for is asking meta-questions - questions about the questions themselves - "Is this question on-topic? Why? Why not? Would using x here be a better approach? Should we Vote to Close (VtC) this question? God, how did this guy get in charge of a server?..."
This forum is also home to all sorts of stuff unrelated to databases, computers, IT (or anything really). It's a chat-room, not a forum for asking questions - that's what the main site is for! Databases here - Programming StackOverflow. Your question would be very much on-topic on the main site!
 
6:53 AM
Morning
 
7:13 AM
Morning
 
@EvanCarroll - I'm not normally a reader of Texan publications, but this article touches on my own homeland and I'm just wondering is this a publication worth reading? Despite its name (Texas National Security Review) it appears to be more Obama than Trump - more blue than red? I'm relying on you to give me the 411 on this!
@McNets Hi and bon dia to you too! Your input above looks great - do you plan on trying to answer the question itself? Or I could write it up and answer it as a community wiki?
Oh, and thanks for the compliment! :-)
 
@Vérace please, feel free to add it to your answer
 
I'm only really starting to get to grips with PL/pgSQL - how would you do a procedure (as opposed to the TRIGGER approach that you have opted for above) - just a skeleton outline - I'll do the leg-work!
 
I have a meeting in 5 min.
 
Whenever you have a moment and are so inclined, that would be great - I'll Google meantime!
 
8:05 AM
@Vérace The publication, no idea. However, that's certainly not my politics on Brexit.
I'll be honest, it's better for Labour that she resigns anyway. Lol.
The Left needs to pull its head out of its ass. Can you imagine being right the topic of Brexit for like 30 years and calling for the dismantling of the EU, all the way up until the point of a meaningful referendum?
 
@EvanCarroll She's an ex-civil servant saying why she resigned over her government's lying - at least AFAICS. She's possibly restricted in how much she can reveal? Anyone who goes to the length of resigning must have some principles?
I can read what she wrote - as far as someone who appears to be from an "establishment" background, it's pretty "out there".
What are your "politics" on Brexit? I think it's obviously a question for the British people, but there is the massive complication of Ireland! In the North, they voted against Brexit and Unionists appear to refuse to want to accept this (my own politics are republican/nationalist when it comes to the six counties).
In one way I'm glad - the British were always "blockers" - but in another it's bad in the sense that it complicates matters in re. Irish State/north matters. However, with an Irish sea border (protocol), this should have been OK, but the brits are reneging like crazy. Brexit can hardly have much of an effect in Texas? Another good thing about Brexit is that it's increased Ireland/Continental trade and reduced Ire/GB trade.
 
Because government isn't about telling the truth. That's what the news does. Politics is about power and material conditions, not fable. If you're in that game you don't leave because someone "lies." That's expected. Grow up, ffs.
So this woman -- working in government which is literally full of lies -- looks at Brexit and can't understand why people want it because she is fundamentally too disconnected to understand their anger and frustration (which is why she didn't say a single word about the people who voted), and pretends she left because the government lied. False. And then she seals the case for being disconnected by publishing in a liberal Austin journal of like minded loser idiots.
 
8:30 AM
We're also slowly eliminating the "landbridge" - the route that truckers take (normally from Dublin to Wales) then through England on to France/rest of Continent - more ships leaving from Dublin/Rosslare (port in south-east) to French ports.
 
I hope Ireland gets united and leaves the UK.
 
Some element of subterfuge has always been considered de bonne guerre - it's when it goes beyond the Pale that it becomes problematic. You appear to think that I'm wearing rose-tinted glasses - I'm not FFS! Can we at least keep this civil please?
 
Sinn Fein dominating the elections is looking good. ;)
 
Ireland (State) is very united and has left the UK. If there was a vote tomorrow in a referendum to join the UK, you'd get (at most) 3% - the usual malcontents. If there was a leave the EU, maybe a max of ~ 12.5%.
 
@Vérace Rose tinted glasses?
 
8:35 AM
If Sinn Féin had run more candidates last time, they would not be in opposition now! They got close to/bang on/or more than 2 quotas in many seats where they only ran 1 candidate! STVPR! The fairest system there is (apart from pure list maybe).
@EvanCarroll "That's expected. Grow up, ffs." - "Grow up" implies naïveté implies glasses!
 
That was directed at the woman who resigned because she found a lie in the government.
 
@EvanCarroll - ah, OK, fair enough!
 
(which kills people, steals from them, starts wars, destroys families, and maintains an empire)
but yeah, lying -- that's where I draw the line!
China needs to sell their hypersonic missiles to Argentina so they can invade the Falklands again.
 
"Maintains an empire" - not if the Chinese want bits of it back - different ball game for the Spanish though... let me see - who's army is the biggest? China/UK/Spain? China gets HK back, Spain doesn't get Gibraltar back - I wonder why? Didn't even bother asking the residents of HK their views on the matter!
If China backed Argentina, the Malvinas islands would be handed back in a heartbeat!
 
=)
They're about to elect a nutso right winger.
Another Trump.
 
8:45 AM
An please don't say that HK was a "lease" - the New Territories were leased - HK island and parts of the Kowloon peninsula were ceded in perpetuity just like Gibraltar!
 
You can apply the same logic to all territories in an empire that seek independence. The only reason why HK/Taiwan are an issue today is because the USA is so dominant with the news.
 
"eliminating the "landbridge"" - the reason why that's a good thing is that if (as is looking increasingly likely now) there's a trade war between France and GB over fishing, our truck drivers will get caught up in any delays crossing the channel!
 
alright. I'm going to bed.
good night all
 
Night! Keep up the C code - I'd be interested in the approach! :-)
 
@Vérace Thanks for the guidance. But the on-topic help center article makes me feel like my question should be posted in Stack Overflow... but if I do that, I feel that the chances of getting an answer is slim..
 
8:55 AM
@RandomPerson - not at all - I'll answer it myself if you put it on dba.se - or provide a link here to your question on SO. Just a small word of advice - go to dbfiddle.uk - choose your version of MySQL (always include that in any question - can make a big difference) - put in your tables' DDL, then add some sample data and your desired result - copy all of that into the question - you might even get a few upvotes for a well-constructed question! :-)
 
Sure. Will do it.
 
Help us to help you! :-)
 
I actually had an account previously in DBA. I later on deleted it. So no more association bonus reputation :(
 
Rejoin! You'd be more than welcome!
 
@Vérace 😃
I joined! and I don't know how.. I got the association bonus 😁
 
9:01 AM
Fáilte romhat - welcome!
 
9:22 AM
Upgraded to Windows 11
Good luck mate
 
:)
I don't know Irish 😅
 
10:01 AM
@RandomPerson You have 1275 rep on Ask Ubuntu
> If you are an experienced Stack Exchange network user with 200 or more reputation on at least one site, you will receive a starting +100 reputation bonus to get you past basic new user restrictions. This will happen automatically on all current Stack Exchange sites where you have an account, and on any other Stack Exchange sites at the time you log in.
 
This:
"This applies even after you delete all your site profiles and your network account: if you later rejoin the network using the same credentials you earned the bonus on, you'll have it again." Source
 
@RandomPerson Right, but I don't think that applies to you, unless you deleted all your profiles across the network? As I say, you have 1275 rep right now on AU so that's enough to get the association bonus everywhere.
 
1 hour ago, by Random Person
I actually had an account previously in DBA. I later on deleted it. So no more association bonus reputation :(
 
10:16 AM
@RandomPerson Yes I saw that. It's irrelevant. Your rep on AU is enough to get you the bonus on any other site in the network.
 
hmm.. OK.
 
So you could join e.g. Server Fault today and get the bonus there too.
 
10:35 AM
ok..
 
11:38 AM
Can someone suggest me some good article regarding parameterized query in MySQL (I am using Python to take input from user and using that input I will form a query)?
 
 
4 hours later…
3:48 PM
IT IS I, EVAN THE GREAT.
I have lots of experience. I'll give you some if swear allegiance.
Free unicorn points to all who serve in the great armies of Evan.
I need my own guild on StackExchange.
 
 
3 hours later…
7:38 PM
I surmised that this morning. Seems like most of the old hands at Stack Overflow have taken exits. I assume they have some equity. And I assume it's no longer keeping them as happy, given all teh changes.
 
You'll never believe who her replacement is
 
Evan, right?
 
Got it in one
 
I wondered where he was gonna get all the free unicorn points from
Just interviewed someone for a BI position. We mainly use Tableau right now, but are also planning to ship some PowerBI versions of the dashboards as we get more customers upgraded. But holy cow, $5000/month is a lot. I think we pay less than that every year for our Tableau maintenance - server with two designer licenses so we can build and deploy internally and test before bundling them in our installer. Is there not just an on-premise server you can run?
 
7:55 PM
@CadeRoux I assume it's because someone at the top woke up and was like WTF is this shit.
 
@PaulWhite I can't wait
not because I'm happy she's gone, I'm just happy for her replacement.
 
zomfg, is it Paul?!
NOOOOOOOO
Don't join the dark side.
 
Not likely
 
You think the Heap would be cooler if it was in the metaverse?
 
@PaulWhite who is it?
 
8:17 PM
@CadeRoux I guess we'll find out. I was as surprised as anyone when SO bought Facebook
 

« first day (3951 days earlier)      last day (87 days later) »