On Fri, Jul 2, 2010 at 9:28 PM, Peng Yu <pengyu...@gmail.com> wrote:
> On Fri, Jul 2, 2010 at 8:58 PM, P Kishor <punk.k...@gmail.com> wrote:
>> On Fri, Jul 2, 2010 at 8:52 PM, Pavel Ivanov <paiva...@gmail.com> wrote:
>>>> I tried the following two commands. Neither of them work. Would
>>>> you please let me know what is the command to insert a record with the
>>>> default value?
>>>
>>> Try this:
>>> insert into test default values;
>>>
>>>
>>
>>
>> Peng, Now that Pavel has shown you the correct syntax, you can also
>> look at the syntax diagram at http://www.sqlite.org/lang_insert.html
>> and familiarize yourself with how to figure out the syntax for common
>> SQL commands.
>>
>> Also, since you noted that you don't have much SQL experience, look
>> for free tutorials on the web. There are many SQL tutorials that you
>> can benefit from.
>
> I'm learning from the book The Definitive Guide to SQLite. It seems to
> me that the sql command are quite different from common programming
> languages, such as C++ and Java, which are use functions and member
> functions. It takes me a while to learn sql's syntax well.


Yes. SQL *is* very different from most programming languages. Many
things are easy to do in SQL, while other in other programming
languages. Like any language, using SQL well also will take time and
patience, and lots of questions and answers.

>
> Thank you for point me these diagrams. And I'm actually aware of them.
> Only if I understand something, I can check it from the syntax
> diagrams. But these diagrams are too concise for me to learn from
> them.

The diagrams actually list the legal syntax for any command as far as
sqlite is concerned. By following the arrows (and the various paths
that they can take), you can figure out what is allowable and what is
not. Other than for those who might be vision-impaired (and thus, may
need spoken text), the diagrams are actually quite fantastic.

> I hope you understand that I have trying to learn as much as I
> can from the book that I have. But occasionally, I may ask some simple
> questions (to experienced users) more frequently in a short period of
> time.

Absolutely not a problem. Hopefully soon you will be able to help
others on the list.

>
> Also, I am wondering what books or resources you used when you first
> learned sql. I have tried to learn sql from the document and tutorial
> mysql (I was trying to use mysql). But in general, I feel these
> tutorials are not complete and not organized well. I feel that the
> book that I have may be the best starting point for a new user.

I personally think that many of the tutorials are quite good. For
example, see http://sqlzoo.net which also allows you to choose
different db programs and see the syntax difference. SQLite is pretty
faithful to the sql standard, so for most of your needs, plain,
vanilla sql should be pretty good. Another great resource is the
documentation for Postgres (probably the best documentation of all...
for every version of Pg released, all you have to do is change the
version number in the URI to get the specific docs).

>
> --
> Regards,
> Peng
>



-- 
Puneet Kishor
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to