Skip to content

TheJakeWalker/SQLAddressBook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

SQLAddressBook

To better understand SQL and how to make a GUI in python, I created a virtual address book. My SQL based address book provides a GUI to perform CRUD operations as well as visually traverse the entries within the address book. This was hosted on a Raspberry Pi, but the general workflow is replicable on other playforms and operating systems.

Steps:

  1. Download MariaDB
  2. Open Terminal
  3. Enter this to download MariaDB:
sudo apt-get update
sudo apt-get install mariadb-server
  1. When prompted, enter Y (yes) to continue
  2. Enter:
sudo mysqld --console
  1. Open up a new terminal
  2. Enter this to become a super/root user with all permissions:
sudo mysql
  1. Enter:
create user ‘jake’@’localhost’ identified by ‘xxxx’;
grant all on *.* to ‘jake’@’localhost’;
quit
mysql -u jake -p
xxxx
  1. To download python driver, enter:
sudo apt-get install python3-pymysql

Example commands to create and manipulate data in a database

  1. To show databases, enter:
show databases;
  1. To enter database, enter:
use [DATABASE NAME];

Now that we are in a database, we will create and change data of a table. In this example, we will use the table entitled, "addressBook". 3. To show tables, enter: (this may be empty if no tables have been made)

show tables;
  1. To create a table to store data for an address book, enter:
create table addressBook (name varchar(50), street varchar(50), city varchar(50), state varchar(50), state varchar(50), zip int(5));
  1. To describe a table's structure and parameters for each attribute and its datatype, enter:
describe addressBook;
  1. To insert values to the addressBook table, enter:
insert into addressBook values (‘Jake Walker’, 123 Old Town Road’, ‘San Jose’, ‘CA’, 95120);
  1. To delete entries from the addressBook with a specified string assigned to an attribute of the table, enter:
Delete from addressBook where [TABLE ATTRIBUTE NAME] = [STRING]

About

SQL based address book that provides a GUI to perform CRUD operations as well as visually traverse the entries within the address book.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages