Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
|---------------------------------------------------------------------------------------------------------------| | CREATE DATABASE electronic_bank | |---------------------------------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]CREATE DATABASE permission denied in database 'master'. | Solve this using ChatGPT! |------------------------------------------------------------------------------------------------------------------------------------------------| | USE electronic_bank | |------------------------------------------------------------------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Database 'electronic_bank' does not exist. Make sure that the name is entered correctly. | Solve this using ChatGPT! ✓ (1 query) |--------------------------------------------------------------------------------------------| | CREATE TABLE Accounts ( | | account_id INT PRIMARY KEY, | | customer_id INT NOT NULL, | | account_type ENUM('جاری', 'قرض‌الحسنه', 'سپرده کوتاه مدت', 'سپرده بلند مدت') NOT NULL, | | account_number CHAR(16) UNIQUE NOT NULL, | | balance DECIMAL(15, 2) DEFAULT 0.00, | | opening_date DATETIME DEFAULT CURRENT_TIMESTAMP, | | status ENUM('فعال', 'مسدود', 'بسته') DEFAULT 'فعال', | | FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) | | ) | |--------------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near 'جاری'. | Solve this using ChatGPT! |---------------------------------------------------------------------------------------| | CREATE TABLE Cards ( | | card_id INT PRIMARY KEY, | | account_id INT NOT NULL, | | card_number CHAR(16) UNIQUE NOT NULL, | | card_type ENUM('بدهکار', 'اعتباری', 'پیش‌پرداخت') NOT NULL, | | expiry_date CHAR(5) NOT NULL, | | cvv2 CHAR(4) NOT NULL, | | issue_date DATETIME DEFAULT CURRENT_TIMESTAMP, | | status ENUM('فعال', 'مسدود', 'منقضی') DEFAULT 'فعال', | | daily_limit DECIMAL(15, 2), | | FOREIGN KEY (account_id) REFERENCES Accounts(account_id) | | ) | |---------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near 'بدهکار'. | Solve this using ChatGPT! |--------------------------------------------------------------------------------------| | CREATE TABLE Transactions ( | | transaction_id INT PRIMARY KEY, | | source_account_id INT, | | destination_account_id INT, | | amount DECIMAL(15, 2) NOT NULL, | | transaction_type ENUM('واریز', 'برداشت', 'انتقال', 'پرداخت قبض') NOT NULL, | | transaction_date DATETIME DEFAULT CURRENT_TIMESTAMP, | | description TEXT, | | status ENUM('موفق', 'ناموفق', 'در انتظار') DEFAULT 'موفق', | | reference_id VARCHAR(50), | | FOREIGN KEY (source_account_id) REFERENCES Accounts(account_id), | | FOREIGN KEY (destination_account_id) REFERENCES Accounts(account_id) | | ) | |--------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near 'واریز'. | Solve this using ChatGPT! |------------------------------------------------------------------------------------| | CREATE TABLE BillPayments ( | | payment_id INT PRIMARY KEY, | | account_id INT NOT NULL, | | bill_type ENUM('برق', 'آب', 'گاز', 'تلفن', 'موبایل', 'اینترنت') NOT NULL, | | bill_id VARCHAR(50) NOT NULL, | | amount DECIMAL(15, 2) NOT NULL, | | payment_date DATETIME DEFAULT CURRENT_TIMESTAMP, | | reference_code VARCHAR(50) NOT NULL, | | FOREIGN KEY (account_id) REFERENCES Accounts(account_id) | | ) | |------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near 'برق'. | Solve this using ChatGPT! ✓ (1 query) |-----------------------------------------------------------------------------------------| | INSERT INTO Accounts VALUES | | (2001, 1001, 'جاری', '6037991234567890', 15000000.00, '2020-01-10', 'فعال'), | | (2002, 1001, 'قرض‌الحسنه', '6037991234567891', 5000000.00, '2020-01-10', 'فعال'), | | (2003, 1002, 'سپرده کوتاه مدت', '6037991234567892', 25000000.00, '2020-02-15', 'فعال'), | | (2004, 1003, 'جاری', '6037991234567893', 8000000.00, '2020-03-20', 'فعال') | |-----------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'Accounts'. | Solve this using ChatGPT! |--------------------------------------------------------------------------------------------------| | INSERT INTO Cards VALUES | | (3001, 2001, '6037997512345678', 'بدهکار', '05/28', '1234', '2020-01-15', 'فعال', 5000000.00), | | (3002, 2003, '6037997523456789', 'اعتباری', '08/29', '5678', '2020-02-20', 'فعال', 10000000.00), | | (3003, 2004, '6037997534567890', 'بدهکار', '11/30', '9012', '2020-03-25', 'فعال', 3000000.00) | |--------------------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'Cards'. | Solve this using ChatGPT! |-------------------------------------------------------------------------------------------------------------| | INSERT INTO Transactions VALUES | | (4001, NULL, 2001, 1000000.00, 'واریز', '2023-01-05 10:15:30', 'واریز حقوق', 'موفق', 'REF123456'), | | (4002, 2001, 2003, 500000.00, 'انتقال', '2023-01-10 14:20:45', 'انتقال به حساب دوست', 'موفق', 'REF654321'), | | (4003, 2001, NULL, 200000.00, 'برداشت', '2023-01-15 09:30:15', 'برداشت از عابربانک', 'موفق', 'REF789012') | |-------------------------------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'Transactions'. | Solve this using ChatGPT! |-------------------------------------------------------------------------------------------| | INSERT INTO BillPayments VALUES | | (5001, 2001, 'برق', '123456789', 150000.00, '2023-01-20 11:45:00', 'BP123456789') | |-------------------------------------------------------------------------------------------| | [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'BillPayments'. | Solve this using ChatGPT!

Stuck with a problem? Got Error? Ask AI support!

Copy Clear