Sybase ASE Complete Command Reference Guide
Part 1: DDL and DML Commands
■ Data Definition Language (DDL)
Command Description Example
CREATE DATABASE Creates a new database. CREATE DATABASE payroll_db;
CREATE TABLE Creates a table in the current database. CREATE TABLE employees (emp_id INT, name VAR
ALTER TABLE Modifies an existing table. ALTER TABLE employees ADD department_id INT;
DROP TABLE Removes a table from the database. DROP TABLE employees;
TRUNCATE TABLE Deletes all rows from a table instantly (no logging). TRUNCATE TABLE employees;
CREATE VIEW Creates a virtual table using a SELECT query. CREATE VIEW v_high_salary AS SELECT name, sal
DROP VIEW Deletes an existing view. DROP VIEW v_high_salary;
CREATE INDEX Creates an index on one or more columns. CREATE INDEX idx_emp_name ON employees(nam
DROP INDEX Deletes an index from a table. DROP INDEX employees.idx_emp_name;
CREATE PROCEDURE Defines a stored procedure. CREATE PROCEDURE get_employee AS SELECT *
DROP PROCEDURE Deletes a stored procedure. DROP PROCEDURE get_employee;
CREATE TRIGGER Defines a trigger that executes on a table action. CREATE TRIGGER trg_salary_update ON employee
DROP TRIGGER Removes a trigger. DROP TRIGGER trg_salary_update;
■ Data Manipulation Language (DML)
Command Description Example
SELECT Retrieves data from one or more tables. SELECT name, salary FROM employees WHERE de
INSERT Adds new records to a table. INSERT INTO employees VALUES (101, 'Ravi', 4500
UPDATE Modifies existing records. UPDATE employees SET salary = salary * 1.1 WHER
DELETE Deletes specific records from a table. DELETE FROM employees WHERE emp_id = 101;
MERGE Performs insert or update based on condition. MERGE employees AS e USING new_data AS n ON
BULK INSERT Loads data from an external file. BULK INSERT employees FROM '/tmp/empdata.txt';