|
-
Jul 4th, 2001, 04:55 PM
#1
Thread Starter
Hyperactive Member
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++
-
Jul 5th, 2001, 05:07 AM
#2
Frenzied Member
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.
-
Jul 7th, 2001, 07:31 PM
#3
Hyperactive Member
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 
-
Jul 8th, 2001, 04:37 PM
#4
PowerPoster
hasn't got anything to do with API though
-
Jul 8th, 2001, 05:54 PM
#5
Hyperactive Member
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 
-
Jul 9th, 2001, 09:40 AM
#6
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"
-
Jul 10th, 2001, 07:12 AM
#7
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|