SQL
Structured Query Language. The SQL language has several parts:
DDL – Data definition language: The SQL DDL provides commands for defining
Relation schemas, defining relations, and modifying relation schema.
View definition: The SQL DDL includes commands for defining views.
DML-Data Manipulation Language. The SQL DML includes a query language based on both the relational algebra and the tuple relational calculus.
Transaction control: To specify begin and end of transactions, SQL commands is used.
Integrity: The SQL DDL includes commands for specifying integrity constraints that the stored in the database must satisfy. Updates that violate integrity constraints are disallowed.
Authorization: The SQL DDL includes commands for specifying access rights to relations and views.
Basic structure:
The Basic structure of an SQL expression consists of three clauses: select, from and where.
SQL Query has the form
Select A1, A2…..An
From r1, r2,……..rm
Where p
A- Attribute, r- relation, p-predicate.
DDL: SQL DDL allows specification of not only a set of relations but also information about each relation including:
Domain Types in SQL:
It supports a variety of built-in domain types:
int: An integer. The full form integer is equivalent.
Smallint: A small integer
Char(n) : A fixed length character string with user specified length n.
Varchar(n): A variable length character string with user specified maximum length n.
Float(n): A floating point number,with precision of atleast n digits.
Date: A calendar date containing a year, month and day of the month.
Time: time of day, in hours, minutes and seconds.
| Name* : |
|||||
| Email* : |
|||||
| Country* : |
|||||
| Phone* : |
|||||
| Subject* : |
|||||
| Upload Homework : Upload another homework (upto 5 uploads max.)
|
|||||
| Due Date |
Time |
AM/PM |
Timezone |
||
| Instructions |
|||||
|
|||||