- Replies:
- 0
- Words:
- 5309

isql or from a Java app with JDBC. Example SQL to create a simple table:
CREATE TABLE employees (
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name VARCHAR(100),
department VARCHAR(50),
salary DECIMAL(10,2)
);
This creates a table similar to what you might use in MySQL or PostgreSQL.
INSERT INTO employees (name, department, salary)
VALUES ('Alice', 'HR', 5500.00);
Retrieve data with a simple query:
SELECT * FROM employees;
Firebird supports standard SQL syntax and can handle complex queries efficiently.
To update existing data:
PDATE employees SET salary = 6000.00 WHERE name = 'Alice';
To delete a record:
DELETE FROM employees WHERE name = 'Alice';
Firebird enforces transactions, so you can wrap updates in BEGIN TRANSACTION and COMMIT.
SELECT e.name, d.name AS dept_name
FROM employees e
JOIN departments d ON e.department = d.id
WHERE e.salary >5000;
This helps in combining and filtering data easily for reporting or analytics.
Connectionconn = DriverManager.getConnection(
"jdbc:firebirdsql://localhost:3050/yourdb",
"sysdba", "masterkey"
);
execute SQL using PreparedStatement for secure and efficient data access.
image quote pre code