Skip to Content
Python GUI Programming with Tkinter
book

Python GUI Programming with Tkinter

by Alan D. Moore
May 2018
Beginner to intermediate content levelBeginner to intermediate
452 pages
11h 26m
English
Packt Publishing
Content preview from Python GUI Programming with Tkinter

Retrieving data from tables

To retrieve data from tables, we use the SELECT statement as follows:

SELECT name FROM musicians;

The SELECT command takes a column or comma-separated list of columns followed by a FROM clause, which specifies the table or tables containing the specified columns. This query asks for the name column from the musicians table.

Its output is as follows:

name
Bill Bruford
Keith Emerson
Greg Lake
Robert Fripp
David Gilmour

 

Instead of a list of columns, we can also specify an asterisk, which means all columns as shown in the following query:

SELECT * FROM musicians;

The  preceding SQL query returns a following table of data:

ID name born died main_instrument
4 Bill Bruford 1949-05-17
2 Keith ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python GUI Programming with Tkinter - Second Edition

Python GUI Programming with Tkinter - Second Edition

Alan D. Moore

Publisher Resources

ISBN: 9781788835886Supplemental Content