Classof1 logo
Fax: 1- 425- 458- 9358 | Toll free: 1- 877- 252 - 7763
Bookmark and Share
Forgot Password? Click Here
Register  |  Account

Need help with Computer Science assignment?

Get customized homework help now!

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.

  • Select – select clause corresponds to the projection operation of the relational algebra. It is used to list the attributes desired in the result of a query.
  • From – This clause corresponds to the Cartesian product operation of the relation algebra.
  • Where – The where clause corresponds to the selection predicate of the relational algebra.

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:

  • Schema for each relation.
  • Integrity constraints.
  • Domain of values associated with each attribute.
  • Security and authorization information for each relation.
  • Physical storage structure of each relation on disk.

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.

Computer Science Homework Help
Name* :
Email* :
Country* :
Phone* :
Subject* :
Upload Homework :
Upload another homework (upto 5 uploads max.)
Due Date
Time
AM/PM
Timezone
Instructions
(Type Security Code - case sensitive)