0% found this document useful (0 votes)
7 views1 page

Sybase ASE Command Reference Part1

The Sybase ASE Complete Command Reference Guide provides a comprehensive overview of Data Definition Language (DDL) and Data Manipulation Language (DML) commands. It includes commands for creating, altering, and deleting databases, tables, views, indexes, procedures, and triggers, as well as commands for retrieving, inserting, updating, and deleting records. Each command is accompanied by a brief description and an example for clarity.

Uploaded by

Rajkumar Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Sybase ASE Command Reference Part1

The Sybase ASE Complete Command Reference Guide provides a comprehensive overview of Data Definition Language (DDL) and Data Manipulation Language (DML) commands. It includes commands for creating, altering, and deleting databases, tables, views, indexes, procedures, and triggers, as well as commands for retrieving, inserting, updating, and deleting records. Each command is accompanied by a brief description and an example for clarity.

Uploaded by

Rajkumar Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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';

You might also like