What are some useful SQL statements that should be known by all developers who may touch the Back end side of the project?
(Update: just like in algorithm, we know there are sorting problems, shuffling problems, and we know some solutions to them. This question is aiming at the same thing).
For example, one I can think of are:
Get a list of Classes that are not
registered by any students. (Outer
join and check whether the match is
NULL, or by Get from Classes table,
all ClassIDs which are NOT IN (a
subquery to get all ClassIDs from the
Registrations table))
Are there some SQL statements that should be under the sleeve of all developers that might touch back end data?
Hmm generalizing what types of queries you should be able to write.
joins (and no select *)
or more tables and get records that
are in all the tables
or more tables and get records that
are in all the tables but return
only one record from the table with
the many side of the one-to-many
relationship
records in one table but not in an
associated table
for a report
record to a table
record in a table
record in a table
of records to a table without a
cursor
group of records in a table without
a cursor
group of records in a table without
a cursor
multiple actions in one transaction
and handle error trapping
of records and know when to use
UNION vice UNION ALL
for one field based on some
criteria (using CASE)
Statement.
Well that’s what springs to mind immedaitely. This is for a beginner SQL developer of course. This includes nothing I would consider advanced.