Skip to content

How do I do nested if statements in SQL?

Write a program that will check the answers for the latest test. The program will be given a table answers with the following columns: id – the unique ID of the question; correct_answer – the correct answer to the question, given as a string; given_answer – the answer given to the question, …

Compare two tables via the three tables SQL

I plan to compare two tables via the three table. my query is as the following if the count is zore, then the tableA and TableC match, otherwise, these two tables do not match It takes a long time to run the query. Do we have a way to compare tableA and tableC fast? Question: How to compare tableA and

Converting string to a date but date not formatted properly

I am having issues with converting a string into a date. The issue is that the format of the string does not easily convert to a date. For example, all the dates are set up like APR-19, or JAN-21. I am not sure how to properly cast this. Here is the SQL I am using. Answer in PostgreSQL it is

Getting values from 3 tables where two of those are self-joined

Problem Introduction: I’m working on a faker e-banking system as a side project for practicing my SQL skills (which are super bad), and I’m now stuck at a point where I want to pull data from two tables but cannot do that with joins So, basically I have a users table which looks like this: And I h…

Invalid reference to FROM-clause entry for table “mc”

I’m trying to get an item “manufacturer” with an array of contacts and each contact contains an array of translations using this query but I get this error this is the ER diagram dummy data example: I tried to change the structure of the query to solve it but I wasn’t able to fix it. S…