Lexical conventions defined in SQL are
1. SQL statements must consist of alphanumeric
characters , white space and the following special
characters,
 @ ! < > ‘ , ‘ ? = / $ # ( ) + - “
2. In SQL, the white space characters, tabs and
carriage returns can be interchanged and repeated.
3. Space of any type can be allowed anywhere
without any limit.
4. Comments can also be interchanged with a single
space character and can be placed anywhere.
5. String literals are enclosed in single quotes. It is
possible to put a single quote inside string literal just
by putting two quotes next to each other. Double
quotes contain equivalent of string literals inside the
string literals that has bveen passed to functions.
They must be used with column aliases containing
spaces or special characters.
FUNCTIONAL DEPENDENCIES
Functional dependency:
A functional dependency is defined as the
relationship between the attributes that
correspond to a single relation. In a given table, if
X and Y are two attributes of a relation and Y value
of X is used to determine the value of Y then the
attributes of a relation and the Y is used to
determine the value of Y then the attribute Y is
said to be functionally dependent on the attribute
X.Diagrammatically, a functional dependency
between X and Y attributes can be shown as,
X->Y
Example
Consider the relation EMPLOYEE in which
Emp_Id and social_security_Number are the two
attribuites. Here, if the value of
Social_Security_Number
Functional dependency is used in DBMS in the
following ways,
1. To determine whether the relations are legal.
2. To define a set of constraints on the relations.
3. To normalize the relations so as to convert the
relations into standard form.
1. Full Functional Dependency
If x and y are attributes of an entity set in a table
such that y is functionally dependent only on x,
but not on any proper subset of x, then this type
of dependency is called full functional
dependency.
i.e., Roll Number, Subject Name -> Marks
2. Partial Functional Dependency
If x and y are attributes of an entity set in a table
and y is functionally dependent on x such that
elimination of some attributes from x does not
effect the dependency, then this type of
dependency is called partial functional
dependency. That is, y is partially dependent on x.
Example
During examinations, any subject can be
randomly held in any examination hall. Therefore,
hall number depends on subject name as well as
roll numbers. In this case, hall number’s
dependency on subject is partial because it also
depends on roll number as well.
SubjectName-> HallNumber
3.Transistent or Transitive Functional
Dependency
If x,y,z are attributes of an entity set in a table
such that x is functionally dependent on y and y
is functionally dependent on z, then z will be
transitively dependent on x through y.
Example
For examinations to be held, if students are
dependent on teachers and teachers are
dependent on management. Then management
will be transitively dependent on students
through teachers.
Students-> Teachers
Teachers->Management
Management->Students.

Dbms.....SQL statemets

  • 1.
    Lexical conventions definedin SQL are 1. SQL statements must consist of alphanumeric characters , white space and the following special characters,  @ ! < > ‘ , ‘ ? = / $ # ( ) + - “ 2. In SQL, the white space characters, tabs and carriage returns can be interchanged and repeated. 3. Space of any type can be allowed anywhere without any limit. 4. Comments can also be interchanged with a single space character and can be placed anywhere. 5. String literals are enclosed in single quotes. It is possible to put a single quote inside string literal just by putting two quotes next to each other. Double quotes contain equivalent of string literals inside the string literals that has bveen passed to functions. They must be used with column aliases containing spaces or special characters. FUNCTIONAL DEPENDENCIES Functional dependency:
  • 2.
    A functional dependencyis defined as the relationship between the attributes that correspond to a single relation. In a given table, if X and Y are two attributes of a relation and Y value of X is used to determine the value of Y then the attributes of a relation and the Y is used to determine the value of Y then the attribute Y is said to be functionally dependent on the attribute X.Diagrammatically, a functional dependency between X and Y attributes can be shown as, X->Y Example Consider the relation EMPLOYEE in which Emp_Id and social_security_Number are the two attribuites. Here, if the value of Social_Security_Number Functional dependency is used in DBMS in the following ways, 1. To determine whether the relations are legal. 2. To define a set of constraints on the relations. 3. To normalize the relations so as to convert the relations into standard form. 1. Full Functional Dependency
  • 3.
    If x andy are attributes of an entity set in a table such that y is functionally dependent only on x, but not on any proper subset of x, then this type of dependency is called full functional dependency. i.e., Roll Number, Subject Name -> Marks 2. Partial Functional Dependency If x and y are attributes of an entity set in a table and y is functionally dependent on x such that elimination of some attributes from x does not effect the dependency, then this type of dependency is called partial functional dependency. That is, y is partially dependent on x. Example During examinations, any subject can be randomly held in any examination hall. Therefore, hall number depends on subject name as well as roll numbers. In this case, hall number’s dependency on subject is partial because it also depends on roll number as well. SubjectName-> HallNumber
  • 4.
    3.Transistent or TransitiveFunctional Dependency If x,y,z are attributes of an entity set in a table such that x is functionally dependent on y and y is functionally dependent on z, then z will be transitively dependent on x through y. Example For examinations to be held, if students are dependent on teachers and teachers are dependent on management. Then management will be transitively dependent on students through teachers. Students-> Teachers Teachers->Management Management->Students.