-
Maybe I should know this question. But...I don't :(.
What is SQL? What can you do? Share some information with me. I think I may be interested in learning. I'm learning COM right now, thanks to Karl's excellent and easy-to-understand tutorials :), than finish learning C++, DB, and maybe ASP, and then SQL?
At this rate, by next life, I'll be king of the Vb-World! :rolleyes:
-
You are kidding, right?
Structured Query Language - started off as S English Q L.
SQL is simply a standardised way to retrieve data from a data store. SQL variants are more or less compliant to the ANSI standard. It is good for normalised (orthogonal) data but not so good for heterogeneous data.
OK?
P.
-
Here is a short quote from MSDN.
What Is Structured Query Language?
SQL stands for Structured Query Language and is sometimes pronounced as "sequel." At its simplest, it is the language that is used to extract, manipulate, and structure data that resides in a relational database management system (RDBMS). In other words, to get an answer from your database, you must ask the question in SQL.
Why and Where Would You Use SQL?
You may not know it, but if you've been using Access, you've also been using SQL. "No!" you may say. "I've never used anything called SQL." That's because Access does such a great job of using it for you. The thing to remember is that for every data-oriented request you make, Access converts it to SQL under the covers.
SQL is used in a variety of places in Access. It is used of course for queries, but it is also used to build reports, populate list and combo boxes, and drive data-entry forms. Because SQL is so prevalent throughout Access, understanding it will greatly improve your ability to take control of all of the programmatic power that Access gives you.
I use SQL to retrieve data from SQL Server 7.0, DB2 tables on our mainframe, and FoxPro tables.
-
Can you show me a little sample coding of SQL?
How would you use it? Is it some control that you add as a Custom Control (or Reference) ?
(By the way, I'm at school right now, so that's why I asked. I know SQL would be listed in the MSDN Library).
-
Commercial Enterprise
I think this is a classic example of non-commercial development knowledge . . . In commercial coding sql is not just a bit to add to your CV but a much used tool capable of doing many wondrous things . . . OK so the last bit may be an exageration.
-
Get hold of a copy of Access and look up 'SELECT' in the help and follow the links. There are also plenty of sites out on the wider net. It is too big a topic for a thread. A basic SQL statement would be of the form
SELECT field(s) FROM table WHERE clause
You can use GROUP BY, HAVING, JOIN, INSERT, UPDATE and all sorts of other predicates. Check out Access.
Cheers,
P.
-
Code:
SQLStatement = "SELECT * FROM MyTable WHERE ID > 20"
guess what that does :)
-
SQL statements can be simple:
Code:
Select * from user
' Select all fields from a table named user.
or a little more complex (from Visual FoxPro)
Code:
SELECT recomend.rec_desc, recomend.rsource, STATUS.comp_dt,;
STATUS.proj_no, STATUS.rec_no, STATUS.div1 AS dv_seq, STATUS.sec1 AS sec_seq,;
STATUS.impl_by, STATUS.dis_report, STATUS.dropped,;
STATUS.div_act, STATUS.statusdiv, STATUS.status_ia, STATUS.statiaflag,;
STATUS.dt_impl, STATUS.amend_dt1, STATUS.amend_dt2, STATUS.amend_dt3,;
STATUS.divname AS div_desc, STATUS.secname AS sec_desc, STATUS.man_act;
FROM audit!recomend LEFT OUTER JOIN audit!STATUS ;
ON recomend.proj_no = STATUS.proj_no;
AND recomend.rec_no = STATUS.rec_no;
ORDER BY STATUS.proj_no, STATUS.rec_no;
INTO DBF merge1
With SQL, you can join tables together, specify columns/records to be retrieved into a VB recordset, etc.
I use ADO in my VB projects, so a reference to ADO is needed to create the recordsets and pass the SQL statements to the data source.