SQL validation

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

SQL validation

Post by Reason7194 on Tue Apr 05, 2011 11:50 pm
([msg=56014]see SQL validation[/msg])

Hey everyone, would anyone like to share a good resource for learning about sql validation? Validation is my next project that is why I am asking.
I study Gotafu.
Reason7194
Poster
Poster
 
Posts: 215
Joined: Fri Jan 07, 2011 5:01 pm
Blog: View Blog (0)


Re: SQL validation

Post by thetan on Thu Apr 07, 2011 9:13 pm
([msg=56106]see Re: SQL validation[/msg])

Validation can mean any number of things. You're going to have to be more concise with what you're looking for.

As for as validating an actual SQL statement, if it runs, it's valid in terms of syntactical validity. If you want to see some insight into what that query is doing under the hood (seeing if it's using the indexes you set up for it, or doing full table scans etc) then you would pass the SQL statement through the EXPLAIN command.

Determining the validity of the outcome of a SQL statement, you could run it against a test data set in a typical unit testing scenario.

However, like i said, your question is vague, please clarify.
"If art interprets our dreams, the computer executes them in the guise of programs!" - SICP

Image

“If at first, the idea is not absurd, then there is no hope for it” - Albert Einstein
User avatar
thetan
Contributor
Contributor
 
Posts: 653
Joined: Thu Dec 17, 2009 6:58 pm
Location: Various Bay Area Cities, California
Blog: View Blog (0)


Re: SQL validation

Post by Reason7194 on Fri Apr 08, 2011 8:10 am
([msg=56142]see Re: SQL validation[/msg])

Ah sorry, what I meant was checking if a variable was true with the database. I'm not sure if I explained it any better, but in any case I figured out what I was originally asking.

Thanks
I study Gotafu.
Reason7194
Poster
Poster
 
Posts: 215
Joined: Fri Jan 07, 2011 5:01 pm
Blog: View Blog (0)


Re: SQL validation

Post by thetan on Fri Apr 08, 2011 11:28 am
([msg=56145]see Re: SQL validation[/msg])

Code: Select all
SELECT * FROM some_table AS t1 WHERE t1.someCol = 'someVal'


The very nature of this question makes me question the approach you're taking in learning SQL.
"If art interprets our dreams, the computer executes them in the guise of programs!" - SICP

Image

“If at first, the idea is not absurd, then there is no hope for it” - Albert Einstein
User avatar
thetan
Contributor
Contributor
 
Posts: 653
Joined: Thu Dec 17, 2009 6:58 pm
Location: Various Bay Area Cities, California
Blog: View Blog (0)


Re: SQL validation

Post by Reason7194 on Fri Apr 08, 2011 12:17 pm
([msg=56148]see Re: SQL validation[/msg])

Well, the way I am learning is just by finding what I need on the website I use for my projects. If I don't know how to do something, I usually go to w3schools, phpacademy channel, google, or the local library until I can figure out the problem I am having.
I study Gotafu.
Reason7194
Poster
Poster
 
Posts: 215
Joined: Fri Jan 07, 2011 5:01 pm
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests