Results 1 to 6 of 6

Thread: question about SQL

  1. #1

    Thread Starter
    Addicted Member GenocideOwl's Avatar
    Join Date
    Jul 2006
    Location
    Ohio
    Posts
    144

    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

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    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

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    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.

  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width