Tuesday 3 December 2013

Important questions of C language BCA-1
Q. 1        Explain C Program structure.
Q. 2        Explain variable naming rules and scope of variable.
Q. 3        List out various operators available in C. Explain any three.
Q. 4        Explain data types available in C.
Q. 5        Explain pre-processor directives.
Q. 6        List out selective control structures. Explain any one with example.
Q. 7        What is loop ? How many loops are there in C? Explain any one with example.
Q. 8        Explain jumping statements. (break, continue, goto)
Q. 9        Explain any five string handling functions.
Q. 10      Explain I/O formatting functions.
Q. 11      Difference between malloc() and calloc().
Q. 12      What is UDF? Write down  its types. Explain any one with example.
Q. 13      What is array? List out its types. Explain any one with example.
Q. 14      Explain initialization and working with array.
Q. 15      Explain declaration and definition of structure.
Q. 16      Explain pointer to structure.
Q. 17      Difference between structure and union.
Q. 18      What is pointer? Explain pointer to array.

Q. 19      Explain following functions : fopen, fprintf, fscanf,  fseek, ftell, fclose.

Thursday 22 August 2013


Problem Solving Methodologies and Programming in C
MCQ and short questions of Chapter 4

1. What is the use of getchar()?
(A) Get one character from keyboard (B) Get many character from keyboard
(C) Get one digit from keyboard (D) Get many digits from keyboard
2. What is the use of putchar()?
(A) Display one character onto screen (B) Display many character onto screen
(C) Display one digit onto screen (D) display many digits onto screen
3. What is the use of pow()?
(A) x^y (B) x*x (C) x/y (D) x%y
4. What is the use of sqrt()?
(A) Square root of any number (B) Multiplication of any number
(C) Cube of any number (D) Modulo division of any number
5. Which function is used for taking float number remainder?
(A) fmod() (B) fabs() (C) floor() (D) ceil()
6. What is the use of gets() in program?
(A) get only one character (B) get only one line
(C) get only one word (D) get strings
7. What is the use of getch() in program?
(A) see output (B) get only one character
(C) get only one word (D) by default in program
8. What is the limitation of getch()?
(A) not echo the character (B) not get the character
(C) not get the word (D) not get the line
9. What is the use of getche() in program?
(A) get only one character (B) get only one line
(C) get only one word (D) None of these
10. What is the use of strcmp() in program?
(A) strings compare (B) strings copy (C) strings concatenatess (D) strings compile
11. What is the use of strncat() in program?
(A) no. of strings compare (B) no. of strings copy
(B) no. of strings concatenatess (D) no. of strings compile
12. Which header file is required for string handling function?
(A) string.h (B) stdlib.h (C) ctype.h (D) stdio.h
13. Which header file is required for character function?
(A) string.h (B) stdlib.h (C) ctype.h (D) stdio.h
14. Which header file is required for delay()?
(A) process.h (B) dos.h (C) stdio.h (D) conio.h
15. How many types of functions are available in C?
(A) 1 (B) 2 (C) 3 (D) 4
16. How many type of user defined function are in C ?
(A) 1 (B) 2 (C) 3 (D) 4
17. What is the other name of function header part?
(A) function signature (B) function name (C) function body (D) function arguments
18. When we make a mistake in function name in definition that time which error is generate?
(A) function name wrong (B) function header wrong
(C) function prototype (D) function signature wrong
19. In main(), when any function is call, that parameter is known as :
(A) formal argument (B) actual argument (C) not define (D) normal arguments
20. When one function is call itself that is known as:
(A) nested function (B) recursive (C) itself call (D) simple call
21. Which data type return by main function by default?
(A) char (B) int (C) float (D) double
22. How many values can return by function?
(A) 1 (B) 2 (C) 3 (D) 4
23. When function call other function that is known as :
(A) nested function (B) recursive (C) itself call (D) simple call
24. Which data type is used when function not return any value?
(A) char (B) int (C) float (D) void
25. What is the scope of global variable in program?
(A) Only one function (B) Within one function (C) Two functions (D) Entire program
26. When return statement is required in program?
(A) Function return data type void (B) Function should return value
(C) Function not return any value (D) None of these
27. What is optional in function prototype declaration?
(A) variable name (B) data type (C) semi colon (D) function name
28. What values are pass in call by reference technique?
(A) original values (B) formal values (C) address of variable (D) other
29. What is the name in function definition user gives the arguments?
(A) Actual arguments (B) Formal arguments (C) Simple arguments (D) Multi Arguments
30. When large program devide in more that sub program known as....
(A) sub program (B) sub function (C) multifunction (D) nested function
31. Every string terminates with which character?
(A) /0 (B) '0' (C) \0 (D) "0"

1. Write down types of functions.
2. What is the extension of header file?
3. What is the full form of UDF?
4. What is the use of strcpy()?
5. What is the use of strncpy()?
6. What is the use of strcat?
7. What is the use of strncat()?
8. What is the use of strlen()?
9. What is the use of strcmp()?
10. What is the use of strncmp()?
11. What is the use of strrev()?
12. To use printf() function which header file should be used?
13. To use scanf() function which header file should be used?
14. To use clrscr() function which header file should be used?
15. To use getch() function which header file should be used?
16. To use UDF in C program which components should be used?
17. How many ways we can call a function?
18. What is recursive function?
19. Write down types of UDF?
20. What is the other name of Library function or Built-in function?

     Best of Luck     

Wednesday 24 April 2013



IMPORTANT TOPICS TO BE PREPARED FOR FINAL EXAM
PHP

  • ·         Introduction to PHP
  • ·         PHP Static & Global Variable
  • ·         Get & Post method
  • ·         Conditional structure & looping structure
  • ·         Function : strlen, substr, sqrt, rand, getdate, include, require, fread, fopen, fseek
  • ·         What is Session ? Explain in detail.
  • ·         What is cookies ? Explain.
  • ·         Server variable
  • ·         Database connectivity with MySQL
  • ·         XML introduction
  • ·         AJAX introduction
  • ·         XMLHTTP request
  • ·         AJAX with MySQL database
  • ·         PHP Regular expression
  • ·         SMARTY introduction
  • ·         SMARTY variable

Monday 22 April 2013

Important questions for PG:
1. Explain SQL Command.
2. Explain GRANT and REVOKE command.
3. Deffrentiate SQL V/s. SQL *Plus
4. What is snapshot. Explain in detail.
5. Explain function of SQL.
6. Explain Operator.
7. What is normalization. Explain in detail.
8.What is cluster ? Explain in details.
9. Explain Group by and Having clause.
10.Explain transaction control command.
11. Explain Redo log file in detail.
12. What is table space? Explain its types.
13. What is backup and recovery?
14. What is trigger? Explain.
15. What is cursor? Explain its types.
16. Explain Instance Architecture.
17. What is stored procedure? Explain with example.
18. Explain import and export.
19. Write down Dr. E. F. Ted Codd Rule.
20. Justify Oracle as RDBMS.
Create following table
Table name : cust_master
Fields: cust_no (p), name, address, city

Table name : product_master
Fields: pro_no (p), p_name, qty, saleprice, costprice

Table name : purchase
Fields: cust_no (f), pro_no (f), p_qty, amount

and solve following queries:
(A) List the name of all customer who purchase "computer"
(B) List the p_name, p_qty and amount of all product purchase by "yash"
(C) List the non-moving product_name
(D) List the cust_name who purchase product of more thatn Rs. 1000
Solution:
create table cust_master
(cust_no varchar2(6) primary key,
name varchar2(25),
adderss varchar2(50),
city varchar2(15));

create table product_master
(pro_no varchar2(6) primary key,
p_name varchar2(15),
qty number(4),
saleprice number,
costprice number);

create table purchase
(cust_no varchar2(6) references cust_master(cust_no),
pro_no varchar2(6) references product_master(pro_no),
p_qty number(4),
amount number);


(A) List the name of all customer who purchase "computer"
      select name from cust_master where cust_no in (select cust_no from purchase where 
      pro_no in (select pro_no from product_master where     p_name="computer"))

(B) List the p_name, p_qty and amount of all product purchase by "yash"
      select d.p_name, p.p_qty, p.amount from product_master d, purchase p where
      p.pro_no=d.pro_no and p.cust_no in (select cust_no from cust_master where name="yash")

(C) List the non-moving product_name
      select p_name from product_master where pro_no not in (select distinct pro_no from 
      purchase)

(D) List the cust_name who purchase product of more thatn Rs. 1000

       select name from cust_master where cust_no in (select cust_no from purchase 
       where amount>1000)
Write an update trigger on client_master table. The system keep records are being updated. The old values of updated records should be added in the temp table.

Table :
temp
Fields: Client_no, name, operation, o_date, userid

SOLUTION:

CREATE OR REPLACE TRIGGER trg_client_master
BEFORE UPDATE ON client_master
FOR EACH ROW

BEGIN
   INSERT INTO TEMP VALUES(:old.Client_no, :old.name, 'UPDATE', sysdate, UID);
END;
/

Write a PL/SQL block to display following series

1 1 2 3 5 8 ..... N

DECLARE
term1 number;
term2 number;
term3 number;
n number;
BEGIN
  n:=&n;
  term1:=1;
  term2:=0;
  term3:=1;
  FOR i in 1..n
  LOOP
    dbms_output.put_line(term3||' ');
    term1:=term2;
    term2:=term3;
    term3:=term1+term2;
  END LOOP;
END;

Saturday 20 April 2013

Example of trigger:

There are three tables: studinfo, result and update_studinfo. If you insert data into studinfo then that data will be inserted into result with calculation automatically. If you update any data then new data will be inserted into result and old data will be inserted into update_studinfo. If you delete any data then old data will be inserted into update_studinfo table.

You can do that in following way:

create table studinfo
(studid varchar2(3),
name varchar2(15),
php number(3),
oracle number(3),
vb number(3));


create table result
(studid varchar2(3),
name varchar2(15),
php number(3),
oracle number(3),
vb number(3),
total number(3),
per number(6,2),
operation varchar2(7),
op_date date);


create table update_studinfo
(studid varchar2(3),
name varchar2(15),
php number(3),
oracle number(3),
vb number(3),
operation varchar2(7),
op_date date);


create or replace trigger trgstudinfo
before insert or update or delete
on studinfo
for each row
declare
total number;
per number(6,2);
begin
  if inserting then
    total:=:new.php+:new.oracle+:new.vb;
    per:=total/3;
    insert into result values(:new.studid,:new.name,:new.php,:new.oracle,:new.vb,total,per,'INSERT',sysdate);
  end if;

  if updating then
    total:=:new.php+:new.oracle+:new.vb;
    per:=total/3;
    insert into result values(:new.studid,:new.name,:new.php,:new.oracle,:new.vb,total,per,'UPDATE',sysdate);
    insert into update_studinfo values(:old.studid,:old.name,:old.php,:old.oracle,:old.vb,'UPDATE',sysdate);
  end if;

  if deleting then
     insert into update_studinfo values(:old.studid,:old.name,:old.php,:old.oracle,:old.vb,'DELETE',sysdate);   
  end if;

end;
/


Join

A join is a query that combines rows from two or more tables, views, or materialized views. Oracle Database performs a join whenever multiple tables appear in the FROM clause of the query.
Most join queries contain at least one join condition, either in the FROM clause or in the WHERE clause. The join condition compares two columns, each from a different table. To execute a join of three or more tables, Oracle first joins two of the tables based on the join condition comparing their columns and then joins the result to another table based on join conditions containing columns of the joined tables and the new table.
Equijoins:
An equijoin is a join with a join condition containing an equality operator(=). An equijoin combines rows that have equivalent values for the specified columns.
Ex. SELECT empno, ename, job, dname, loc FROM emp e, dept d WHERE e.deptno=d.deptno;

Non-Equijoins:
A join which contains an operator other than equal to ‘=’ in the joins condition.
Ex. SELECT empno, ename, job, dname, loc FROM emp e, dept d WHERE e.deptno>d.deptno;

Self Joins:
A self join is a join of a table to itself. This table appears twice in the FROM clause and is followed by the table aliases that qualify column names in the join condition.
Ex. SELECT e1.empno, e2.ename, e1.job, e2.deptno FROM emp e1, emp e2 WHERE e1.empno=e2.mgr;

Inner Joins:
An inner join (sometimes called a simple join) is a join of two or more tables that returns only those rows that satisfy the join condition.
Ex. SELECT empno, ename, job, dname, loc FROM emp INNER JOIN dept USING(deptno);

Outer Joins:
An outer join extends the result of a simple join. An outer join returns all rows that satisfy the join condition.
To write a query that performs an outer join of tables A and B and returns all rows from A (a left outer join), use the LEFT [OUTER] JOIN syntax in the FROM clause, or apply the outer join operator (+) to all columns of B in the join condition in the WHERE clause. For all rows in A that have no matching rows in B, Oracle Database returns null for any select list expressions containing columns of B.
Ex. SELECT empno, ename, job,dname,loc FROM emp e LEFT OUTER JOIN dept d
on(e.deptno=d.deptno);                  OR
SELECT empno, ename, job, dname, loc FROM emp e, dept d WHERE e.deptno=d.deptno(+);

To write a query that performs an outer join of tables A and B and returns all rows from B (a right outer join), use the RIGHT [OUTER] JOIN syntax in the FROM clause, or apply the outer join operator (+) to all columns of A in the join condition in the WHERE clause. For all rows in B that have no matching rows in A, Oracle returns null for any select list expressions containing columns of A.
Ex. SELECT empno, ename, job, dname, loc FROM emp e RIGHT OUTER JOIN dept d
ON(e.deptno=d.deptno);                                   OR
SELECT empno, ename, job, dname, loc FROM emp e, dept d WHERE e.deptno(+)=d.deptno;

To write a query that performs an outer join and returns all rows from A and B, extended with nulls if they do not satisfy the join condition (a full outer join), use the FULL [OUTER] JOIN syntax in the FROM clause.
Ex. SELECT empno, ename, job, dname, loc FROM emp e FULL OUTER JOIN dept d
ON(e.deptno=d.deptno);
Download or view topics : Initialization Parameters & Control files


Friday 19 April 2013

You can download a word file for redo log and change vector but it is just short description



Exception Handling
What is an exception?
In PL/SQL, errors and warnings are called as exceptions. Whenever a predefined error occurs in a program, Pl/SQL rises an exception.
There are two types of exception handlers:
1.       Predefined internal exceptions
2.       Userdefined exceptions.

PL/SQL has a collection of predefined exceptions. Each has a name. These exceptions are automatically raised by PL/SQL whenever the corresponding error occurs.
When PL/SQL rises a predefined exception, program is aborted by displaying error message. But if program is to handle exception raised by PL/SQL then we have to use Exception Handler part of the block.


When Exception Handler is given, control is transferred to exception handler whenever there is an exception. After the exception handler is executed, control is transferred to next statement in the enclosing block.

Example of Exception handling:
DECLARE
                X_studid student.studid%type;
BEGIN
                SELECT studid, name FROM students
                WHERE name=’BHARAT PARMAR’;

EXCEPTION
                WHEN NO_DATA_FOUND Then
                INSERT INTO errortable VALUES(‘BHARAT PARMAR Not Found’);
END;

In above example, if no row found with the name ‘BHARAT PARMAR’ then PL/SQL raises exception NO_DATA_FOUND. Then this exception is handled by exception handler and one row is inserted into ERRORTABLE table.

PREDFINED EXCEPTIONS
PL/SQL has defined certain common errors and given names to these errors, which are called as predefined exceptions.

The following is the list of predefined exceptions and the corresponding Oracle Errors:
EXCEPTION NAME                                               ORACLE ERROR
CURSOR_ALREADY_OPEN                                      ORA-06511
DUP_VAL_ON_INDEX                                               ORA-00001
INVALID_CURSOR                                                     ORA-01001
LOGIN_DENIED                                                          ORA-01722
NO_DATA_FOUND                                                     ORA-01017
NOT_LOGGED_ON                                                    ORA-01403
PROGRAM_ERROR                                                    ORA-01012
ROW_TYPE_MISMATCH                                           ORA-06501
STORAGE_ERROR                                                     ORA-06504
TIMEOUT_ON_RESOURCE                                      ORA-06500
TOO_MANY_ROWS                                                  ORA-01422
VALUE_ERROR                                                           ORA-06502
ZERO_DIVIDE                                                             ORA-01476

USER DEFINED EXCEPTION:
PL/SQL allows you to create exceptions of your own. Unlike predefined exceptions, user defined exceptions are to be raised explicitly using RAISE command.
Syntax:
RAISE exception;

Once a user defined exception is raised using RAISE command, it is to be handled just like a predefined exception. The following are the steps of userdefined exceptions:
·         Declare an excpetion in DECLARE section using keyword EXCEPTION.
·         Use RAISE command to raise the exception in the executable part.
·         Handle userdefined exception in exception handler.