Introduction To SQL:: Experiment - 1 Objective: To Study Theory and Concepts About Structured Query Language (SQL)
Introduction To SQL:: Experiment - 1 Objective: To Study Theory and Concepts About Structured Query Language (SQL)
EXPERIMENT 1
Objective : To study theory and concepts about Structured Query Language
(SQL) :
Introduction to SQL :
SQL is a special-purpose programming language designed for managing data held in a relational
database management system (RDBMS), or for stream processing in a relational data stream
management system (RDSMS).
Originally based upon relational algebra and tuple relational calculus, SQL consists of a data
definition language and a data manipulation language. The scope of SQL includes data insert,
query, update and delete, schema creation and modification, and data access control. Although
SQL is often described as, and to a great extent is, a declarative language (4GL), it also includes
procedural elements.SQL was one of the first commercial languages for Edgar F. Codd's
relational model, as described in his influential 1970 paper, "A Relational Model of Data for
Large Shared Data Banks." Despite not entirely adhering to the relational model as described by
Codd, it became the most widely used database language
SQL (pronounced SEQUEL) is the programming language that defines and manipulates the
database. SQL databases are relational databases, which means that data is stored in a set of
simple relations.
SQL Statements :
All operations on the information in an Oracle database are performed using SQL statements. A
SQL statement is a string of SQL text. A statement must be the equivalent of a complete SQL
sentence, as in:
SELECT last_name, department_id FROM employees;
Only a complete SQL statement can run successfully. A sentence fragment, such as the
following, generates an error indicating that more text is required:
SELECT last_name
A SQL statement can be thought of as a very simple, but powerful, computer program or
instruction. SQL statements are divided into the following categories:
Data Definition Language (DDL) Statements
Data Manipulation Language (DML) Statements
Transaction Control Statements
Session Control Statements
System Control Statements
Page 1
Page 3
Page 5
Page 6
Creating a table
Insertion of values in the table
Viewing the table contents
Describing the table
Create table
Create table <tablename>
(
<Columnname1> datatype(size) constraint,
<Columnname2> datatype(size) constraint,
.) ;
Insert content
Insert into <tablename> values(value1,value2.);
Insert into <tablename> values(value1,value2..);
View contents
Select * from <tablename> ;
Describe table
Desc <tablename> ;
Page 7