Question: Python Questions QUESTION 1 A table has 3 columns. For the ListCtrl, which statement inserts data into the first (top) row in the third column?

Python Questions

QUESTION 1

A table has 3 columns. For the ListCtrl, which statement inserts data into the first (top) row in the third column?

self.list.SetStringItem(0, 2, ""yellow"")

self.list.InsertStringItem(1, 3, ""yellow"}

self.list.SetStringItem(1, 3, ""yellow"")

self.list.InsertStringItem(0, 1, ""yellow"")

QUESTION 2

Which of the following would correctly create a new table?

CREATE TABLE toppings (FirstTopping text, SecondTopping text)

either a or b would work

CREATE TABLE toppings (FirstTopping, SecondTopping) TYPES ( text, text)

QUESTION 3

"With a modal dialog box, you can still use other parts of the program without having to close the dialog."

True

False

QUESTION 4

If you want to retrive records from a table using the field names in a dictionary-like way, use ____.

a column-factory

field-list

a row-factory

QUESTION 5

In the Python version of sqlite3 to execute sql statements against your database you need ____.

a cursor

a primary key

a srow maker

a collector

QUESTION 6

A table has 5 fields. Which of the following would successfully insert data into that table?

INSERT INTO colors (color2, color3) VALUES ('red', 'orange')

INSERT INTO colors VALUES ('red', 'orange')

INSERT INTO colors (color2 = 'red', color3 = 'orange')

INSERT INTO colors ('red', 'orange') WHERE field1=color2 AND field2=color3

QUESTION 8

What statement inserts this list into a table with 3 fields?

stripes = [ (brown, black, red) , (red, red, red), (gray, green blue) ]

cur.executemany("INSERT INTO codes VALUES ( ?, ?, ?)", stripes)

cur.execute("INSERT stripes INTO codes VALUES ( ?, ?, ?)")

cur.executemany("INSERT INTO codes VALUES ('brown', 'black', 'red')")

QUESTION 9

If you are inserting a record in a SQLITE table you need to execute the commit method to insure the changes are made in the table itself.

True

False

QUESTION 10

You have a table of mailing addresses. You want to change all of the existing values of the field named 'state' to be KY (two capital letters), rather than Ky, or ky, or whatever they might be. Which SQL statement would accomplish this?

INSERT INTO addresses VALUES('KY')

UPDATE addresses SET state = 'KY' WHERE state = 'ky' AND state = 'Ky'

UPDATE addresses SET state = 'KY'

INSERT INTO addresses (state) VALUES('KY')

QUESTION 11

For the ListCtrl, which statement sets up the left-most column title?

self.list.InsertColumn(0, 'Date')

self.list.InsertStringColumn(0, 'Date')

self.list.SetColumn(1, 'Date')

self.list.InsertColumn(1, 'Date')

QUESTION 12

To bring the layout into existance you need to execute the _____.

COMMIT() method

ADD() method

SetSizer() method

QUESTION 13

Box sizers cannot be nested.

True

False

QUESTION 14

For an instance of a class that inherits from wx.Dialog, when the dialog is closed ____.

the ShowModal() method returns the id of the button used to close the window.

the OnClose() method returns the id of the button used to close the window.

the GetButtonId() method returns the id of the button used to close the window.

QUESTION 15

To have a SQL statement implemented you must _____.

have the SQL string be an argument of the execute method of the cursor variable

have the SQL string be an argument of the SELECT method of the cursor variable

have the SQL string be an argument of the execute method of the connection variable

QUESTION 16

Which of the following are official SQLITE data types? Choose all that apply.

Text

Integer

Not

Real

QUESTION 17

You have a SpinCtrl named age in an instance that inherits from wx.Dialog that uses the variable named dataDlg. dataDlg is opened from an instance inheriting from wx.Frame. How would you retrieve the number entered by the user in the SpinCtrl when the dialog is closed and execution returns to the MyFrame instance?

userAge = MyFrame.age.GetValue()

userAge = age.GetValue()

userAge = dataDlg.age.GetValue()

userAge = dataDlg.GetValue()

QUESTION 18

A SQL ____ statement allows you to remove one or several records from a table

erase

remove

cut

delete

QUESTION 19

Which of the following removes all records from a table?

REMOVE FROM colors *

DELETE FROM colors WHERE color2 = *

FROM colors REMOVE *

DELETE FROM colors

QUESTION 20

You cannot execute the same create-table instruction twice.

True

False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!