Sunteți pe pagina 1din 2

SQL Statements

Select Statement
Select Statement allows the users to retrieve the specific information
they desire from an operational database.
Order By Clause
Order by Clause sorts data according to what the user desire. The
results are in ascending order in default.
And & Or Operators
And & Or operators are used to filter records based on more than one
condition. The and operator displays a record if all the condition are
met. The Or operator displays a record if any condition is met.
The select statement together with the order by clause and and & or
operators will be used to search and filter information in the database. This
will be mainly used for searching data in the sales table and customer table.
The sample format for this statement is Select * from tblSales where
Description=Credit
and
CustomerName=txtCustmerName.text
or
CustomerID=txtCustomerID.text.

Insert Into Statement


The insert into statement is used to insert a row of data in a table.
The insert into statement will be used to insert records in the
database tables such as customer record table and sales record table. Every
time a new customer registers, the information will be inserted in the
customer table; and every time a sales transaction occurs, the information
will be inserted to the sales table. The sample format for this statement is
Insert Into tblSales (CustomerID, Date&Time, Quantity, Price, ProductName,
Code, Amount, Mode, UserID, Status) Values (txtCustomerID.text,
lblDate&Time.Caption,
lblQuantity.Caption,
lblPrice.Caption,
lblProductName.Caption,
lblDescription.Caption,
lblAmount.Caption,
lblMode.Caption, lblUserID.caption, lblStatus.Caption).
Update Statement

The update statement is used to modify row of data in a table.


The update statement will be used to modify existing records.
This will be mainly used in updating customer information and
updating the status of delivery. The sample format for this statement is
Update
tblCustomers
Set
Address=txtAddress.Text
where

CustomerID=txtCustomerID.Text
CustomerName=txtCustomerName.Text.

or

S-ar putea să vă placă și