13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Working with databaseshttp://www.zetcode.com/wxpython/databases/sqlite> .tablessqlite> create table neighbours(name text, age numeric, remark text);sqlite> .tablesneighbours<strong>The</strong> .tables command shows all available tables in the database. Wecreate a table called neighbours. Our table will have three columns.We will use text and numeric data types. Notice that each SQLcommand is followed by a semicolon ";".Now it is time to insert some real data.sqlite> insert into neighbours values('sandy', 7, 'stubborn');sqlite> insert into neighbours values('jane', 18, 'beautiful');sqlite> insert into neighbours values('mark', 28, 'lazy');sqlite> insert into neighbours values('steven', 34, 'friendly');sqlite> insert into neighbours values('alice', 17, 'slick');sqlite> insert into neighbours values('tom', 25, 'clever');sqlite> insert into neighbours values('jack', 89, 'wise');sqlite> insert into neighbours values('lucy', 18, 'cute');<strong>The</strong> SQL select command is probably the most widely used DML(data manipulation language) command.sqlite> select * from neighbours;sandy|7|stubbornjane|18|beautifulmark|28|lazysteven|34|friendlyalice|17|slicktom|25|cleverjack|89|wiselucy|18|cute<strong>The</strong> sqlite3 has several modes to display data. Namely:ModecsvcolumnhtmlinsertlinelisttabsDescriptioncomma separated valuesleft aligned columnshtml table codeSQL insert statements for tableone value per linevalues delimited by .separator stringtab separated values<strong>The</strong> default mode is the list mode. We can see the current settings ifwe type the .show command.4 de 12 27/04/2008 1:06

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!