erstelle SQL Kommandos, ein Script oder ein Programm in einer geeigneten…
- User
erstelle SQL Kommandos, ein Script oder ein Programm in einer geeigneten Programmiersprache, dass aus der MySQL Tabelle Contracts die fälligen LineItems in die Tabelle LineItems schreibt und die Tabelle Contracts aktualisiert. Hierbei muss beachtet werden, dass bei Rechnungen im Voraus ('in_advance') der Abrechnungszeitraum mit NextBillingOn beginnt, beim 'in_arrears' damit endet.
CREATE TABLE Contracts ( Id CHAR(36) NOT NULL PRIMARY KEY, ContractNumber VARCHAR(10) NOT NULL, Project VARCHAR(255), Status ENUM('active', 'inactive',‘cancelled‘) NOT NULL, BillingType ENUM('fixed', 'effort_based') NOT NULL DEFAULT 'fixed', ArtId VARCHAR(255) NOT NULL, Quantity DECIMAL(10, 2), Price DECIMAL(10, 2), Currency CHAR(3), PricingModel VARCHAR(36), InvoiceText TEXT, ContractText TEXT, ContractStart DATE, ContractEnd DATE, BillingPeriod ENUM('calendar_month', 'month', '30-day_period', 'quarter', 'half_year', 'year', 'twoyear') NOT NULL DEFAULT 'month', BillingMethod ENUM('in_advance', 'in_arrears') NOT NULL DEFAULT 'in_advance', OmitIfZero ENUM('yes', 'no') NOT NULL DEFAULT 'no', NextBillingOn DATE, CreationDate DATE, LastUpdate TIMESTAMP );
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.