Presentation is loading. Please wait.

Presentation is loading. Please wait.

Features of SQL SQL is an English-like language . It uses words such as select , insert , delete as part of its commend set. SQL is an a non-procedural.

Similar presentations


Presentation on theme: "Features of SQL SQL is an English-like language . It uses words such as select , insert , delete as part of its commend set. SQL is an a non-procedural."— Presentation transcript:

1 Features of SQL SQL is an English-like language . It uses words such as select , insert , delete as part of its commend set. SQL is an a non-procedural language : SQL processes sets of records rather than a single record at a time . The most common form of a set of records is a table. SQL can be used by a range of user including DBAs application programmers , management personal , and many other types of end users. SQL Provides command for a variety of tasks including: querying data Inserting, updating and deleting rows in a table Creating, modifying and deleting database objects controlling access to the database and database objects guaranteeing database consistency.

2 The American National Standards Institute (ANSI) adopted as the standard language for RDBMSs in The International Standards Organization (ISO) has also The SQL Commands Set Description This is the most commonly used command: it is used to retrieve data from the database These three commands are used to enter new rows. Change existing rows and remove unwanted rows form tables in the database respectively (They are sometimes collectively know as DML or Data Manipulation Language commands These three commands are used dynamically to set up. Change and remove any data structure for example, tables, views , indexes . (They are sometimes collectively know as DDL or Data Definition Language commands.) These two commands are used to save or remove access rights to both the Oracle database and the structures within it Commands SELECT INSERT UPDATE DELET CREATE ALTER DROP GRANT REVOKE

3 Writing SQL Commands When writing SQL commands , it is important to remember a few simple rules and guidelines in order to construct valid statements that are easy to read and edit: SQL commands may be on one or many lines. Clauses are usually placed on separate. Tabulation can be used. Command words cannot be split across lines. SQL commands are not case sensitive. An SQL command is entered at the SQL prompt, and subsequent lines are numbered. This is called the SQL buffer. Only one statement can be current at any time within the buffer and it can be run in a number of ways: -Place a semi-colon(:) at the end of last clause. - Place a semi-colon/forward slash on the last line in the buffer.

4 The data types that a cell can hold
CHAR VARCHAR (size) VARCHAR2 (size) LONG VARCHAR NUMBER DATE LONG RAW/ LONG RAW

5 The Create Table Command:
Syntax: CREATE TABLE table name (columname datatype(size) , columname datatype(size); Example: Create a client_master table who structure is: Column Name Data Type Size Client_no Name Address City State Pincode Remarks Bal_due varchar2 number varchar Number 6 20 30 15 60 10,2 CREATE TABLE client_master (client_no varchar2(6),name varchar2(20),address varchar2(30),city varchar2(15),state varchar2(15),pincode number(6),remarks varchar2(60),bal_due number(10,2));

6 Self review Questions:
Read the questions and write down appropriate SQL statements, as answer Fill the table below as your choice Describe where may be used your chosen table Gives the name of this table Create the table with appropriate SQL statements. Column Name Data Type Size Find the error from the following SQL statements: CREATE TABLE salesman_master (salesman_no varchar2(6)), salesman_name number(2) state varchar2(20),


Download ppt "Features of SQL SQL is an English-like language . It uses words such as select , insert , delete as part of its commend set. SQL is an a non-procedural."

Similar presentations


Ads by Google