CREATE TABLE Country ( country_id SERIAL PRIMARY KEY, country_code CHAR(2) UNIQUE NOT NULL, -- ISO alpha-2 dialing_prefix VARCHAR(4) NOT NULL, country_name VARCHAR(100) NOT NULL ); CREATE TABLE Number ( number_id BIGSERIAL PRIMARY KEY, e164_number VARCHAR(15) UNIQUE NOT NULL, -- e.g., 995322123456 country_id INTEGER NOT NULL REFERENCES Country(country_id), number_type VARCHAR(20) CHECK (number_type IN ('mobile', 'landline', 'voip', 'tollfree', 'emergency')), is_active BOOLEAN DEFAULT TRUE, first_assigned_date DATE, last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
Author: [Your Name/Institution] Date: April 18, 2026 Abstract The increasing volume of telephone-based communications in personal, commercial, and emergency response contexts necessitates robust systems for storing, retrieving, and managing telephone number data. This paper presents the design and implementation of a Telephone Number Database ( Telefonis Nomrebis Baza ). We discuss the logical data model, indexing strategies for fast lookup, data integrity constraints, and security considerations. A relational database schema using SQL is proposed, along with performance analysis for typical queries such as number lookup, prefix searches, and spam detection. The results demonstrate that a well-structured telephone number database can achieve sub-millisecond query times for up to 10 million records. telefonis nomrebis baza
CREATE TABLE Call_Log ( call_id BIGSERIAL PRIMARY KEY, source_number_id BIGINT NOT NULL REFERENCES Number(number_id), destination_number_id BIGINT NOT NULL REFERENCES Number(number_id), call_timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, duration_sec INTEGER CHECK (duration_sec >= 0), spam_flag BOOLEAN DEFAULT FALSE ); CREATE TABLE Country ( country_id SERIAL PRIMARY KEY,