Library tutorials & articles
SQL In Simple English
Lets get started
What is SQL?
SQL stands for 'Structured Query Language'
What does that mean?
There are a lot of Databases available in the market such as MS Access, Oracle
and many others. For you to write programs that interact with these databases
easily, there has to be a way where you could get information from all these
databases using the same method. For this purpose SQL was developed. It is a
kind of language (simple when compared to the likes of C or C++) which enables
you to ask all your queries to a database without bothering about the exact type
of database.
What the heck is SQL??!!!
Ok lets get straight to the point. Suppose you have a database which has a table
called people. (I hope you know what tables are). And you want the details
of all persons whose firstname is 'Reena'. So you could use a SQL statement
as followsSELECT * FROM people WHERE firstname = 'Reena'
When you use this Query the database engine would first find the table called
people. Then it would find a column called firstname. Next it would
compare all the values in that column with 'Reena'. Finally it would return all
the details wherever it finds a match for the firstname.
Tell me something more of the bigger picture..
When you write a database program in VC++ or Java or any other language for that
matter, you would make a database connection to your database and then you would
query the database using SQL queries. When you query the database with any SQL
query the database returns a recordset. A recordset is basically a set of records
(all the entries that your query returns). This recordset is received in your
program and all languages have a data structure which represents a recordset.
Once this data structure (in your program) gets populated with the results from
the database query, your could use a for loop to loop through all the entries.
Hey guys.. this is a tutorial on SQL.. so I wouldn't be focussing on those aspects in this series
What was that thing about recordsets?
When you connect to a database and execute SQL Queries,the results of the Query are returned back to your program. This returned data has to be stored in some Object or Data Structure within your program to be used by your program. Once you store the results in this Object you no longer have to be connected to the Database. For a more detailed explanation please refer to a book on Database programming.
Related articles
Related discussion
-
How to receive data in web server sending from GPRS modem
by AshokSingh (1 replies)
-
how to make smtp in vb.net
by konikula (1 replies)
-
copying access DB to SQL DB
by konikula (1 replies)
-
MS Access in 3 different language
by konikula (2 replies)
-
How do I update a table that has an ID from a table that does not have an ID but has a PIDM?
by konikula (1 replies)
Related podcasts
-
Stack Overflow: Podcast #31
This is the thirty-first episode of the StackOverflow podcast, where Joel and Jeff discuss.. stuff! Based on some comments from Podcast #30, we now know that “Learning about NP-Completeness from Jeff is like learning about irony from Alanis Morissette”. It’s funny b...
Related jobs
-
Microsoft .Net Architect
in AMSTERDAM (€50K-€90K per annum) -
Oracle Apps Database Administrator - Standplaats: Utrecht
in AMSTERDAM (€50K-€90K per annum) -
Business Analist BI/Datawarehousing
in Amsterdam (€50K-€90K per annum) -
Oracle Ontwikkelaar
in Amsterdam (€50K-€90K per annum)
Events coming up
-
Jun
16
Code Generation 2009
Cambridge, United Kingdom
A developer event with a practical focus on helping people get to grips with code generation tools and technologies.
Hi I would first like to say your site has been really helpful to me.
When using ASP to display database information in a web page you might use
[courier new]
Set adoConnect = Server.CreateObject("ADODB.Connection")
adoConnect.Open "Reports"
Set onIndex = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM index WHERE number=10"
onIndex.Open strSQL, adoConnect
[/courier new]
Then if you wanted to display the recordset you could use
[courier new]
<% onIndex=("Number") %>
[/courier new]
but what I can't work out is if your select statement uses COUNT how do you display the result
[courier new]
Set adoConnect = Server.CreateObject("ADODB.Connection")
adoConnect.Open "Reports"
Set onIndex = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT COUNT(*) FROM index WHERE number=10"
onIndex.Open strSQL, adoConnect
[/courier new]
sorry probably it has been too long and may be you've got the answer but try this
select * from table where date> #2/2/1979#
hi..
check this ... should work
select * from tablename where DateOfBirth<TODATE('10/9/1976','mm/dd/yyyy')
try using TO_DATE with the date you want.. i have used this before in this manner..
hope it helps
bye
Thanks, very helpful.
What about dates though? What is the code for finding dates using the SELECT statement eg 'SELECT from * WHERE DateOfBirth < 10/9/76 10:01:10', I can't get it to work.
This thread is for discussions of SQL In Simple English.