CodeGroundAI

CREATE TABLE Area ( id SERIAL PRIMARY KEY, code VARCHAR(10), name VARCHAR(100), description TEXT ); CREATE TABLE Role ( id SERIAL PRIMARY KEY, name VARCHAR(30), description TEXT ); CREATE TABLE Shift ( id SERIAL PRIMARY KEY, code VARCHAR(10), name VARCHAR(50), starts TIME, ends TIME ); CREATE TABLE Plant ( id SERIAL PRIMARY KEY, code VARCHAR(10) UNIQUE NOT NULL, name VARCHAR(100) NOT NULL, country VARCHAR(30) NOT NULL, city VARCHAR(50) NOT NULL, address VARCHAR(250), foundation DATE, status BOOLEAN DEFAULT TRUE, cover UUID, DG VARCHAR(50), photo UUID ); CREATE TABLE Customer ( id SERIAL PRIMARY KEY, name VARCHAR(50) NOT NULL, plant_id INTEGER NOT NULL, starts DATE NOT NULL, ends DATE, nationality VARCHAR(50), photo UUID, CONSTRAINT fk_customer_plant FOREIGN KEY (plant_id) REFERENCES Plant(id) ); CREATE TABLE Project ( id SERIAL PRIMARY KEY, name VARCHAR(20) NOT NULL, customer_id INTEGER NOT NULL, starts DATE NOT NULL, ends DATE, dev BOOLEAN DEFAULT FALSE, origin VARCHAR(50), photo UUID, CONSTRAINT fk_project_customer FOREIGN KEY (customer_id) REFERENCES Customer(id) ); CREATE TABLE Family ( id SERIAL PRIMARY KEY, name VARCHAR(50), workcenter VARCHAR(20), project_id INTEGER, starts DATE, ends DATE, photo UUID, CONSTRAINT fk_family_project FOREIGN KEY (project_id) REFERENCES Project(id) ); CREATE TABLE Employee ( id SERIAL PRIMARY KEY, matricule INTEGER, firstname VARCHAR(50), lastname VARCHAR(50), gender BOOLEAN DEFAULT FALSE, join_date DATE, plant_id INTEGER, role_id INTEGER, CONSTRAINT FOREIGN KEY (plant_id) REFERENCES Plant(id), CONSTRAINT FOREIGN KEY (role_id) REFERENCES Role(id) ); CREATE TABLE User ( -- Core Identifiers id SERIAL PRIMARY KEY, matricule INTEGER, firstname VARCHAR(50), lastname VARCHAR(50), phone VARCHAR(30) CHECK (phone ~ '^\+?[0-9]{8,15}$'), email VARCHAR(200) CHECK (email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$'), join_date DATE, reports_to INTEGER REFERENCES User(id), -- Authentication password_hash TEXT, is_active BOOLEAN DEFAULT TRUE, is_verified BOOLEAN DEFAULT FALSE, is_blocked BOOLEAN DEFAULT FALSE, blocked_until TIMESTAMPTZ, security_code TEXT, -- Security Infos created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), last_auth TIMESTAMPTZ, pwd__changed_at TIMESTAMPTZ, failed_attempts INTEGER DEFAULT 0, refresh_token TEXT, refresh_token_expires_at TIMESTAMPTZ, pwd_reset_token TEXT, pwd_reset_expires TIMESTAMPTZ, -- Session Infos device VARCHAR(20), browser VARCHAR(50), geo_location VARCHAR(50), ip_address VARCHAR(50), -- Additional Details avatar UUID, lang VARCHAR(5) DEFAULT 'EN' CHECK(lang IN ('EN', 'FR', 'AR', 'ES')), dept_id INTEGER, team_id INTEGER, role_id INTEGER, -- Constraints CONSTRAINT fk_user_dept FOREIGN KEY (dept_id) REFERENCES Department(id), CONSTRAINT fk_user_team FOREIGN KEY (team_id) REFERENCES Team(id), CONSTRAINT fk_user_role FOREIGN KEY (role_id) REFERENCES Role(id), CONSTRAINT max_failed_attempts CHECK (failed_attempts <= 3) ); CREATE TABLE Department ( id SERIAL PRIMARY KEY, code VARCHAR(10), title VARCHAR(50), description TEXT, manager_id INTEGER, team_manager_id INTEGER, photo UUID ); CREATE TABLE Team ( id SERIAL PRIMARY KEY, name VARCHAR(50), description TEXT, coordinator_id INTEGER REFERENCES User(id), supervisor_id INTEGER REFERENCES User(id) ); CREATE TABLE Connector ( id SERIAL PRIMARY KEY, ref BIGINT, code VARCHAR(10), name VARCHAR(20), description TEXT, P1 UUID, P2 UUID ); CREATE TABLE Catalogue ( id SERIAL PRIMARY KEY, code VARCHAR(10), category VARCHAR(100), description TEXT, reworkable INTEGER, detectable INTEGER ); CREATE TABLE Action ( id SERIAL PRIMARY KEY, title VARCHAR(100), category BOOLEAN, content TEXT, score FLOAT CHECK(score >= 0 AND score <= 10), attachment_key UUID, has_attachment BOOLEAN, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), defect_id INTEGER REFERENCES Catalogue(id) ); CREATE INDEX idx_actions_attachtment ON Action(attachment_key); CREATE TABLE Root_Cause ( id SERIAL PRIMARY KEY, title VARCHAR(100), content TEXT, score FLOAT CHECK(score >= 0 AND score <= 10), attachment_key UUID, has_attachment BOOLEAN, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), defect_id INTEGER REFERENCES Catalogue(id) ); CREATE TABLE Process ( id SERIAL PRIMARY KEY, code VARCHAR(10), name VARCHAR(50), description TEXT, photo UUID, category VARCHAR(50) ); CREATE TABLE Production_Team ( id SERIAL PRIMARY KEY, title VARCHAR(200), LL1 INTEGER, LL2 INTEGER DEFAULT NULL, descirption TEXT ); CREATE TABLE Line_Type ( id SERIAL PRIMARY KEY, name VARCHAR(50), descirption TEXT ); CREATE TABLE Production ( id SERIAL PRIMARY KEY, family_id INTEGER, shift_id INTEGER, target INTEGER, quantity INTEGER, datetime TIMESTAMP, directs INTEGER, indirects INTEGER, absence_directs INTEGER, absence_indirects INTEGER, support INTEGER, uptime FLOAT, downtime FLOAT, CT FLOAT ); CREATE TABLE Claim ( id SERIAL PRIMARY KEY, ); CREATE TABLE Claim_Category ( id SERIAL PRIMARY KEY ); CREATE TABLE Claim_Action ( id SERIAL PRIMARY KEY, title VARCHAR(100), family_id INTEGER REFERENCES Family(id), description TEXT, appearance_date DATE, D8 UUID, PPT UUID, OK UUID, NOK UUID, attachment UUID, actions_id );
Hint: Remember to include output statements in your code, such as print, console.log, printf, fmt.Println() or System.out.println.

Benefits of CodeGroundAI Online IDE

Multi-Language Support

CodeGroundAI Online IDE supports C++, Java, Node.js, Python, and more, making it an incredibly versatile tool for diverse coding needs. This extensive language support allows developers to work on different projects within a single platform.

Real-Time Collaboration

Our real-time collaboration feature enables multiple developers to work on the same project simultaneously, enhancing teamwork and productivity. This feature is particularly beneficial for remote teams and pair programming sessions.

User-Friendly Interface

Designed with a clean and intuitive interface, CodeGroundAI Online IDE simplifies coding and debugging processes, making it accessible for users of all skill levels. The ease of use and clear navigation ensure a smooth coding experience.

Instant Code Execution

Experience fast and efficient code execution with immediate feedback in the integrated terminal. This feature helps streamline the development process, allowing developers to quickly test and debug their code.

Free to Use

Enjoy the full range of features at no cost. CodeGroundAI Online IDE is completely free, providing a valuable resource for developers without any subscription fees. This makes it an ideal choice for students, hobbyists, and professionals alike.

Cloud-Based Platform

As a cloud-based IDE, CodeGroundAI allows you to access your projects from anywhere, at any time. This flexibility ensures that you can continue coding without being tied to a specific device or location.

Customizable Environment

Tailor the IDE to your preferences with customizable themes, layouts, and extensions. This personalization ensures a comfortable and productive coding environment.

Why Choose CodeGroundAI Over Other Online IDEs?

CodeGroundAI Online IDE stands out from the competition with its comprehensive feature set, ease of use, and cost-effectiveness. Unlike many other online IDEs that require subscriptions or offer limited free plans, CodeGroundAI provides all its features for free. Our multi-language support, real-time collaboration, and advanced debugging tools ensure that you have everything you need for effective development. Additionally, our user-friendly interface and customizable environment make coding a pleasant experience, regardless of your expertise level. Choose CodeGroundAI Online IDE for a seamless, efficient, and enjoyable coding experience.

×
Ground visible to everyone?
No
Yes
Ground editable by everyone?
No
Yes
Get a new ground?