The program - GEO POINTS DATABASE - changes the MlengelaPD8 so that instead of reading in a list of five or more points from a file, the project will read the points in from a database. Here's what the program does:
- The created program creates a database and inserts at least five points. The following are the points to be used:
- 35.0714,106.6289, Main Campus
- 35.0998,104.0639, Montoya
- 35.2328,106.6630, Rio Rancho
- 35.0856,106.6493, STEMULUS Center
- 35.1836,106.5939, ATC
- Run the database to initialize the code to create the database.
- Modify the GUI program from MlengelaPD10 so that it reads points from my database instead of a file.
The Program manipulates the database with the following applications:
- SQLite3 Library, which is included with my Python installation. A programmer can also pipping install it whenever necessary.
- import sqlite3
- There must be a connection to a database to be able to write to it.
- conn=sqlite3.connect('Mlengeladabase.db')
- If 'Mlengeladabase.db' does not exist, then it will create it.
- 'Mlengeladabase.db' will then appear in the same directory as the program (Unless you provide a path, then it will appear there instead)
- A cursor must be used to execute SQL queries
- curs=conn.cursor()
- Once all changes are done, you must commit them to the database
- conn.commit()
- You can and should commit each time you've modified the database, not just when you're ready to close it.
- When you no longer need access to the database, use the close method to close it.
- conn.close()
- This is important when multiple users are using the database, since most databases can only support a limited number of simultaneous connections.
- Language designed to provide commands to databases.
- Provides capabilities to:
- Create rows of data in tables
- Read data from tables
- Update data in tables
- Delete data from tables
- CRUD is a common acronym to refer to data functions
- SQL also provides you the capability to Create and Delete tables from databases.
- In SQLite, table rows normally have a 64-bit signed integer ROWID, which is unique among all rows in the same table.
- WITHOUT ROWID addition to tables is the exception.
- Execute SQL statements on a database
- Pass a SQL command to the cursor.execute method as a string:
- curs.execute('..SQL command...')
- Sqlite3
- Connections
- Commit
- Close
- Basic Process
- SQL
- Initializing a Database
- CRUD


