Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
If you want to test a calculation or a function in SQL, you don't need to test on real data.
SELECT 2 + 3 AS [Answer]
The SQL shown above will return just one result (I aliased the column for clarity).
The Results grid
I didn't use a FROM clause as I am not using table data.
Here I am testing the built-in MONTH function. I am not expecting any surprises!
SELECT MONTH('04/03/1964')
The surprising (to anyone apart from Americans) result is below.
I did not use an alias so we see (No column name).
SQL reads the date as 'MM/dd/yyyy' so '04/03/1964' is the 3rd of April not the 4th of March.
Because you are not limited to the contents of a table of test data you can use any data you want, including data you know would be invalid.
You can learn more about this topic on the following Wise Owl courses:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.