sql - commands
In previous chapter i have explained What is the Structure of SQL now i am gonna eplain you How To Use SQL Commands
SQL commands are declarative sentences or 'orders' executed against a SQL database. The typical command is comprised of several different components including clauses, functions, expressions, or objects but the only required components are a SQL Clause and the data object (a database or a database table).
sql - clauses
A SQL clause is the word or phrase that begins each SQL command statement and the single most important component to any SQL command. Looking at the clause of any given SQL command usually tells the SQL programmer what that particular command intends to do to the database. For instance, a SELECT command begins with the SELECT clause and any level of SQL programmer will recognize the SELECT query as a command selecting data from the database.
Other SQL clauses include:
- Add
- Drop
- Create
- Insert
- Select
- Update
- Replace
- Delete
sql - sample commands
SQL Code:
SELECT getdate(); -- Selects the current (server) date and time.
CREATE DATABASE MyDatabase; -- Creates a database named Mydatabase;
INSERT INTO orders
-- Inserts data into a database table
VALUES('A+Maintenance','8/16/08','Hanging Files',12);
No comments:
Post a Comment