DMS Question Bank Answers
DMS Question Bank Answers
4 marks
1. Count () –
1) It returns number of rows from the given table if no
attribute is mentioned.
2) If some attribute is mentioned, it gives total number of not
null values for that attribute.
Eg :Select count(*) from emp;
Returns total number of records from emp table.
1) Select count(telephone) from emp;
Returns total number of employees having telephone
numbers.
2. Sum() –
It gives total of all values from a numeric attribute of the given
table.
Eg: Select sum(salary) from emp;
Returns total salary drawn of all employees from the emp
table.
3. Avg () –
It gives average of all the numeric values of the given attribute
from the table.
Eg: Select Avg(salary) from emp;
Returns average salary of employees from emp table.
4. Min () –
It gives minimum of all the values of the numeric given
attribute from the table.
Eg: Select Min(salary) from emp;
Returns minimum salary value from emp table.
5. Max () –
It gives maximum of all the values of the numeric given
attribute from the table.
Eg: Select Max(salary) from emp;
retunes maximum salary value from emp table.
where view_name is the name of the SQL VIEW that you wish
to create.
For e.g.
For e.g.
Update stud_vu set name=’ABC’ where rno=5;
Dropping Views
1.Deletes a view from the database.
2.Views can be dropped or destroyed using drop view
command.
Syntax: Drop View Viewname;
For e.g. Drop View stud_vu;
2 marks
1. Draw the block structure of PL-SQL.
2. State syntax of while loop command
Syntax:
WHILE<condition>
Loop statements;
END loop;
1.Naive Users
2. Sophisticated Users
3. Application Programmers
Object Privileges:
SELECT
INSERT
UPDATE
DELETE
EXECUTE
REFERENCES
INDEX
9. Write a syntax of function in pl/sql
Syntax:
sql > Create Function Function_name [(Parameter1 [mode1]
data type, ...)]
Return data type is
Variable Declarations;
Begin
Executable code;
[Exception
Exception section]
End;
/