Dbms Lab 2
Dbms Lab 2
Assignment-2
Objective:- To Manupulate the Operations on the table.
DML ( Data Manipulation Language) Data manipulation is
Deletion Operation:-
A delete reQuestionst is expressed in much the same way as Questionry. We can delete whole
tuple ( rows) we can delete values on only particulars attributes.
Syntax:
Delete from tablename :
+ Addition - Subtraction
* multiplication ** exponentiation
/ Division () Enclosed operation
- - 1
Renaming columns used with Expression Lists: - The default output column names can be
renamed by the user if required
Syntax:
Logical Operators:
The logical operators that can be used in SQL sentenced are
Pattern Searching:
The most commonly used operation on string is pattern matching using the operation ‘like’ we
describe patterns by using two special characters.
Percent (%) ; the % character matches any substring we consider the following examples.
‘Perry %’ matches any string beginning with perry
‘% idge % matches any string containing’ idge as substring.
‘ - - - ‘ matches any string exactly three characters.
‘ - - - % matches any string of at least of three characters.
Oracle functions:
Functions are used to manipulate data items and return result. function follow the format of
function _name (argument1, argument2 ..) .An arrangement is user defined variable or constant.
The structure of function is such that it accepts zero or more arguments.
Examples:
Avg return average value of n
Syntax:
Avg ([distinct/all]n)
Min return minimum value of expr.
Syntax:
MIN((distict/all )expr)
Count Returns the no of rows where expr is not null
- - 2
Syntax:
Count ([distinct/all)expr]
Count (*) Returns the no rows in the table, including duplicates and those with nulls.
Max Return max value of expr
Syntax:
Max ([distinct/all]expr)
Sum Returns sum of values of n
Syntax:
Sum ([distinct/all]n)
Syntax:
Select columnname, columnname
From table
Order by columnname;
- - 3
Assignment No. # 2
Question.1 Using the table client master and product master answer the following
Questionries.
- - 4