-
Jul 11th, 2006, 11:54 AM
#1
Thread Starter
Addicted Member
question about SQL
what exactly IS SQL and what does it do. I don't have much experience with database work except some access. I am currently trying to write a VB6 program for a company that hired me for summer work and I may also later be making a web site for them so that their customers can check their inventory. So my question is what does SQL do that would make it better to use than say access. Also is it easy to program SQL into VB6 or is that a VB.net thing? I know this is kind of broad but thanks in advance
-
Jul 11th, 2006, 12:04 PM
#2
Re: question about SQL
The first word that comes to my mind in a situation like this is "tutorial".
SQL is a backronym for Structured Query Language and is used as the primary language for manipulating databases. SQL is not better than Access because Access uses SQL behind the scenes, you can verify this by creating a Report and then using the View SQL option (somewhere - I forget exactly where).
SQL queries can be made through any programming language that supports connecting to a database. The DB connection interface that you use will provide its own methods for executing queries.
For more general information I suggest you read the article in Wikipedia.
-
Jul 11th, 2006, 01:19 PM
#3
Re: question about SQL
look for si_the_geek, jmcilhinney - their tutorials (in their sigs) and mind should be more than enough to get you going. Also check out the many tutorials that have been stickied in the VB forums.
-tg
-
Jul 11th, 2006, 03:03 PM
#4
Frenzied Member
Re: question about SQL
SQL is used to find, change, add to, or delete data in a database. There are different, but similar versions used by various databases. As far as I know, every relational database (which are the vast majority of the ones most people use) uses SQL to work with data, as well as create/delete tables, indexes, etc. No matter what the SQL statement does, it's usually called a query (there are stored procedures as well, but you likely won't be working with them at this stage).
Some databases, like Access, also have more visual type designers and wizards for queries, tables, etc., more of a drag & drop type thing, but SQL is behind them. If you have a saved query, right click it and select Design View, then SQL view to see the SQL behind it.
So it's not a question of either SQL, or something else, or what programming language you use. If you work with a relational database, you'll be working with SQL regardless of language or specific database.
The programming language will have specific methods for executing, or carrying out, the SQL statements, and for dealing with the results. The SQL, however, will be mostly the same, with some minor variation between SQL versions in different types of databases.
Last edited by salvelinus; Jul 11th, 2006 at 03:07 PM.
Tengo mas preguntas que contestas
-
Jul 11th, 2006, 04:28 PM
#5
Re: question about SQL
www.w3schools.com/sql
The real kicker for SQL comes when you're working with huge databases and huge sets of data, and you realize how this query language is so useful in searching for that data.
-
Jul 11th, 2006, 05:09 PM
#6
Re: question about SQL
What everyone has said so far is true...
But there is one major point that needs to be made.
SQL is all about using SET BASED logic to arrive at a goal.
In a language like VB you might open a file, read through records and based on some IF/conditions write out those records to a new file with possibly some data being changed. That iterative and conditional logic is what a language like VB is all about.
But that same operation in SQL - using SET based logic - can be done in a single ACTION QUERY.
UPDATE SET SOMECOL='SOMEVAL' WHERE SOMEOTHERCOL='abc'
That simple syntax does so much - it identifies the table to update - the value to put it (which could just as easily have been a CASE/statement or IIF() function) - the WHERE clause (taking the place of IF/conditions in VB).
If you continue down this path you might eventually find out there are CURSORS and the ability to loop through records of data for processing. You will also find that they are considered bad practice - because they are simply dropping back to iterative-based logic and forgetting that SQL is all about set-based logic.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|