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

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Table creation/Postal addresses step by step in the Oracle 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 Oracle programming language

Source code in the oracle programming language

CREATE SEQUENCE seq_address_pk START BY 100 INCREMENT BY 1
/
CREATE TABLE address (
    addrID   NUMBER DEFAULT seq_address_pk.nextval,
    street   VARCHAR2( 50 ) NOT NULL,
    city     VARCHAR2( 25 ) NOT NULL,
    state    VARCHAR2( 2 ) NOT NULL,
    zip      VARCHAR2( 20 ) NOT NULL,
    CONSTRAINT address_pk1 PRIMARY KEY ( addrID )
)
/


  

You may also check:How to resolve the algorithm JortSort step by step in the Elixir programming language
You may also check:How to resolve the algorithm Fibonacci sequence step by step in the Chapel programming language
You may also check:How to resolve the algorithm Call a foreign-language function step by step in the REXX programming language
You may also check:How to resolve the algorithm Equilibrium index step by step in the NetRexx programming language
You may also check:How to resolve the algorithm Reduced row echelon form step by step in the Perl programming language