Results 1 to 7 of 7

Thread: What is SQL??????

  1. #1

    Thread Starter
    Hyperactive Member dflw's Avatar
    Join Date
    Apr 2001
    Location
    ct, usa
    Posts
    412

    What is SQL??????

    Hello m8s,

    I know this may sound stupid, but what is SQL and what can I do with it? I just installed it on my system.
    Visual Basic 6, HTML, JavaScript, learning C++

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    I am not an expert on SQL (structured query language), but i know it is a language for manupulating and creating databases. It is very very easy and can be used in VB.
    And what do you mean you've installed it. Have you installed MySQL or SQL Server.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    Cool I swear to god SQL is one of the easiest languages

    It is a 4th generation language, very similar to english, and easier to learn than HTML. You can pick it up and start using it with 2 nights.
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    hasn't got anything to do with API though

  5. #5
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    Hell on

    I think your getting confused. Say you have like a huge database of data. Now it has columns, and rows. In the columns, there are names, ages, and addresses. And down the sides you have say Bill, age 40, 25 smith st ect.. like this

    NAME AGE ADDRESS
    Bill 40 25 smith st
    Jane 36 80 Joshn st
    Luke 27 16 mary st
    --------------------------------------------------------------------

    Anyway, and you want to include that in your program.
    And people want to be able to ask questions to the database here which you have. Like how many people are over 30 and what is the average age? Or if the list was quite large, how many lukes are there. ect... u get my picture. We u do this using sql.
    For this sake, we want the average age. So we get our string and fill it.

    Code:
             strSQLstatement =  "Select sum(age)/3 FROM PersonalDetais"
    That simple. And then we have our data object, of which everything is linked to, so we go:

    Code:
          dataPersonalDetails.Recordset = strSQLstatement
    I'm not entirley sure about that last part, but it something similar, I'm to lazy to go and check inside the IDE. sorry.

    That's what you use SQL for.
    Last edited by Wak; Jul 10th, 2001 at 07:13 AM.
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

  6. #6
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Re: Hell on

    Originally posted by Wak
    I think your getting confused. Say you have like a huge database of data. Now it has columns, and rows. In the columns, there are names, ages, and addresses. And down the sides you have say Bill, age 40, 25 smith st ect.. like this

    NAME AGE ADDRESS
    Bill 40 25 smith st
    Jane 36 80 Joshn st
    Luke 27 16 mary st
    --------------------------------------------------------------------

    Anyway, and you want to include that in your program.
    And people want to be able to ask questions to the database here which you have. Like how many people are over 30 and what is the average age? Or if the list was quite large, how many lukes are there. ect... u get my picture. We u do this using sql.
    For this sake, we want the average age. So we get our string and fill it.

    Code:
             strSQLstatement =  "Select count(age)/3 FROM PersonalDetais"
    That simple.
    This proves that SQL isn't as easy as most people have said.
    Because databases can be pretty complex, the SQL to retrieve the requested information can be preety complex as well.

    Your SQL command will retrieve the number of ages in the table and devide it by three. If there are three records it will return the value 1, and if there are 6 records it will return 2.
    I think you meant to use
    strSQLstatement = "Select sum(age)/3 FROM PersonalDetais"
    but this will only return the average age if there are three records in the table.
    The correct way to get the average age is:
    strSQLstatement = "Select avg(age) FROM PersonalDetais"

  7. #7
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    lol, whoops.

    he he, tired. Yeah sum(). Thanx Frans C. But yeh, it is an easier language to learn.
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

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