The document outlines the SQL schema for a database with four tables: countries, numbers, tariffs, and selections. Each table includes primary keys and relevant fields, with foreign key relationships established between selections and the other tables. This structure is designed to manage country data, associated numbers, tariff information, and selections made by users.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
8 views1 page
BD
The document outlines the SQL schema for a database with four tables: countries, numbers, tariffs, and selections. Each table includes primary keys and relevant fields, with foreign key relationships established between selections and the other tables. This structure is designed to manage country data, associated numbers, tariff information, and selections made by users.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
CREATE TABLE countries (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50) NOT NULL );
CREATE TABLE numbers (
id INT PRIMARY KEY AUTO_INCREMENT, country_id INT NOT NULL, number VARCHAR(20) NOT NULL, FOREIGN KEY (country_id) REFERENCES countries(id) );
CREATE TABLE tariffs (
id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50) NOT NULL, price DECIMAL(10,2) NOT NULL, link1 VARCHAR(255) NOT NULL, link2 VARCHAR(255) NOT NULL, link3 VARCHAR(255) NOT NULL );
CREATE TABLE selections (
id INT PRIMARY KEY AUTO_INCREMENT, country INT NOT NULL, number INT NOT NULL, tariff INT NOT NULL, statut VARCHAR(50), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (country) REFERENCES countries(id), FOREIGN KEY (number) REFERENCES numbers(id), FOREIGN KEY (tariff) REFERENCES tariffs(id) );