How to resolve the algorithm Table creation/Postal addresses step by step in the Run BASIC programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Table creation/Postal addresses step by step in the Run BASIC programming language

Table of Contents

Problem Statement

Create a table to store addresses. You may assume that all the addresses to be stored will be located in the USA.   As such, you will need (in addition to a field holding a unique identifier) a field holding the street address, a field holding the city, a field holding the state code, and a field holding the zipcode.   Choose appropriate types for each field. For non-database languages, show how you would open a connection to a database (your choice of which) and create an address table in it. You should follow the existing models here for how you would structure the table.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Table creation/Postal addresses step by step in the Run BASIC programming language

Source code in the run programming language

sqliteconnect #mem, ":memory:"  ' make handle #mem
mem$ = "
CREATE TABLE address (
  addrID     INTEGER PRIMARY KEY AUTOINCREMENT,
  addrStreet TEXT NOT NULL,
  addrCity   TEXT NOT NULL,
  addrState  TEXT NOT NULL,
  addrZIP    TEXT NOT NULL
)"
#mem execute(mem$)

  

You may also check:How to resolve the algorithm Strip control codes and extended characters from a string step by step in the REXX programming language
You may also check:How to resolve the algorithm Sorting algorithms/Bogosort step by step in the Phix programming language
You may also check:How to resolve the algorithm Pangram checker step by step in the Phix programming language
You may also check:How to resolve the algorithm Ulam spiral (for primes) step by step in the Raku programming language
You may also check:How to resolve the algorithm 100 doors step by step in the Eero programming language