Tuesday, December 21, 2010

Two commands.

I was practicing the commands on  SQLite and wondering how to view the tables of my database, I found a way to do it which is (sqlite3 example12.db ".table"). The example12.db is my database and .table is to view the tables in the database.  You will get something similar to this (Actors        ActorsMovies  Cars          cars2   ) depending on what is in your database.

Today also I learn this other command that is  (sqlite3 example12.db "dump"). This command will give you something like this:

CREATE TABLE Actors(AId integer primary key autoincrement, Name text);
INSERT INTO "Actors" VALUES(1,'Philip Seymour Hofman');
INSERT INTO "Actors" VALUES(2,'Kate Shindle');
INSERT INTO "Actors" VALUES(3,'Kelci Stephenson');
INSERT INTO "Actors" VALUES(4,'Al Pacino');
INSERT INTO "Actors" VALUES(5,'Gabrielle Anwar');
INSERT INTO "Actors" VALUES(6,'Patricia Arquette');
INSERT INTO "Actors" VALUES(7,'Gabriel Byrne');
INSERT INTO "Actors" VALUES(8,'Max von Sydow');
INSERT INTO "Actors" VALUES(9,'Ellen Burstyn');
INSERT INTO "Actors" VALUES(10,'Jason Miller');

this will varies depending what is in your database and it could be even longer if you  have more tables in the same database.


I am following this tutorial  and I think that is more useful than this one.

1 comment:

  1. You now have a good beginning foundation in SQL. When we return from the break, we can begin looking at Python cgi scripts to extract data from XHTML forms. After that, you'll be ready to build a full web application.

    ReplyDelete