SQL any bods on here?



Get yourself on Oracle cloud and sign up for a free account. Build yourself an oracle server and use sql against the database on there. Try and pick up PL/SQL as you can do so much more, the O'Reilly books are good.
 
Get yourself on Oracle cloud and sign up for a free account. Build yourself an oracle server and use sql against the database on there. Try and pick up PL/SQL as you can do so much more, the O'Reilly books are good.
There are quite a few Oracle APEX jobs being advertised. I mainly used the now (almost) defunct Forms and Reports development tools.

I still do a lot of work with PL/SQL for processing data.
 
Make sure your tables are normalised. Boyce Codd is the boyo. Or at least it was when I learnt.

Heaven forfend you’d want to write readable, maintainable code.

Readable and maintainable in my mind is using the full path to the table, i simply can’t read it when everything has an alias

Am I in a weird minority on this?
 
Readable and maintainable in my mind is using the full path to the table, i simply can’t read it when everything has an alias

Am I in a weird minority on this?
I would say so. Short descriptive names for variables are much better than both long names and one letter names in coding. Table names aliases of one or two letters are common and really help readability. A pithy example:

Select s.firstName, s.lastName, s.emailAddress from shard_1.studentpersonaldetails as s

The above is way more readable than below:

Select shard_1.studentpersonaldetails.firstName, shard_1.studentpersonaldetails.lastName, shard_1.studentpersonaldetails.emailAddress from shard_1.studentpersonaldetails
 
Readable and maintainable in my mind is using the full path to the table, i simply can’t read it when everything has an alias

Am I in a weird minority on this?
I've always aliased mine but I suppose it's what you get used to. It also, depends what your 'shop' has as a standard.

A former team leader of mine used to go apeshit if everything wasn't capitalised or 'Camel Case' in your DDL code ( creating tables, naming columns, stored procs/views etc.)

Funny folk us techies :/
 
Off on a slight tangent but what are people's views on how to pronounce SQL? I've always been an S.Q.L person but the nerds at work are all firmly in the SEQUEL camp.
The hours fly by in our office. :lol:
At Uni, they told us the language is Ess - Que - Ell

But I've heard that the Microsoft Product is pronounced See Quell.
 
Any SQL legends able to help me get to grips with this.

im trying to find results where 'column1' is null or blank in all instances OR where 'column 2' is null or blank EXCEPT where the 'column 1' status is either "abc" or "123"

as part of a bigger code i've got;

OR (COLUMN1 IS NULL
OR COLUMN1 = ' ')

OR (COLUMN2 IS NULL AND COLUMN1 NOT IN ANY ('ABC','123')
OR (COLUMN2= ' ' AND COLUMN1 NOT IN ANY ('ABC','123')
 
Last edited:
Any SQL legends able to help me get to grips with this.

im trying to find results where 'column1' is null or blank in all instances OR where 'column 2' is null or blank EXCEPT where the 'column 1' status is either "abc" or "123"

as part of a bigger code i've got;

OR (COLUMN1 IS NULL
OR COLUMN1 = ' ')

OR (COLUMN2 IS NULL AND COLUMN1 NOT IN ANY ('ABC','123')
OR (COLUMN2= ' ' AND COLUMN1 NOT IN ANY ('ABC','123')

ChatGPT mate! Whack your code in and tweak as needed.

For yours it states:

Your query looks mostly correct, but there are a couple of adjustments needed for your second condition.

Try this:

OR ( COLUMN2 IS NULL AND COLUMN1 NOT IN ('ABC', '123') ) OR ( COLUMN2 = ' ' AND COLUMN1 NOT IN ('ABC', '123') )

This should properly handle the case where 'column2' is null or blank except when 'column1' status is either "abc" or "123".
 
ChatGPT mate! Whack your code in and tweak as needed.

For yours it states:

Your query looks mostly correct, but there are a couple of adjustments needed for your second condition.

Try this:

OR ( COLUMN2 IS NULL AND COLUMN1 NOT IN ('ABC', '123') ) OR ( COLUMN2 = ' ' AND COLUMN1 NOT IN ('ABC', '123') )

This should properly handle the case where 'column2' is null or blank except when 'column1' status is either "abc" or "123".
Ha! I was doing the same, but got this response:

Certainly! Let's break down your requirement:

You want to retrieve results where:

1. 'Column1' is null or blank in all instances.

2. 'Column2' is null or blank, except when the status of 'Column1' is either "abc" or "123".

Based on your provided code snippet, it seems like you're on the right track, but there might be a syntax issue. Here's the corrected version:

OR (

(COLUMN1 IS NULL OR COLUMN1 = '')

OR

(

(COLUMN2 IS NULL OR COLUMN2 = '')

AND

COLUMN1 NOT IN ('ABC', '123')

)

)

Nee idea which is right. But I’ve become reliant on ChatGPT now. It does help a lot.
 

Back
Top