Sunteți pe pagina 1din 3

1. Final year project 2. Summer Training project 3. 4. 5. 6. 7. 8.

Computer Networks Operating system DBMS Software Engineering Computer Organisation C/C++

Compiler - is a computer prog. that transfors source code written in a programmi ng language into a computer language known as object code Translates source code from high level programming language into a low level pro gramming language Cross compiler - if the compiled prog can run on a computer whose OS is differen t from the one on which the compiler runs. Decompiler - low level language to high level language A program that translates between high-level languages is usually called a lang uage translator, source to source translator, or language converter. Q: What is a dangling pointer? A: A dangling pointer arises when you use the address of an object after its lif etime is over. This may occur in situations like returning addresses of the automatic variables from a function or using the address of the memory block after it is freed Q: What is Memory Leak? A: Memory which has no pointer pointing to it and there is no way to delete or r euse this memory(object), it causes Memory leak. { Base *b = new base(); } Out of this scope b no longer exists, but the memory it was pointing to was not deleted. Pointer b itself was destroyed when it went out of scope. Q: Is there anything you can do in C++ that you cannot do in C? A: No. There is nothing you can do in C++ that you cannot do in C. After all you can write a C++ compiler in C Question: What the difference between UNION and UNIONALL? Answer: union will return the distinct rows in two select s, while union all ret urn all rows. Question: What is the difference between TRUNCATE and DELETE commands? Answer: TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE. Question: Cursor Syntax brief history Answer: To retrieve data with SQL one row at a time you need to use cursor proce ssing. Not all relational databases support this, but many do. Here I show this in Oracle with PL/SQL, which is Procedural Language SQL .Cursor processing is do ne in several steps:1. Define the rows you want to retrieve. This is called decl aring the cursor.2. Open the cursor. This activates the cursor and loads the dat

a. Note that declaring the cursor doesn't load data, opening the cursor does.3. Fetch the data into variables.4. Close the cursor. Question: What is the data type of the surrogate key? Answer: Data type of the surrogate key is either integer or numeric or number Question: How to find second maximum value from a table? Answer: select max (field1) from tname1 where field1= (select max (field1) from tname1 where field1<(select max(field1) from tname1); Question: What is the main difference between the IN and EXISTS clause in sub qu eries?? Answer: The main difference between the IN and EXISTS predicate in sub query is the way in which the query gets executed. IN -- The inner query is executed first and the list of values obtained as its r esult is used by the outer query. The inner query is executed for only once. EXISTS -- The first row from the outer query is selected, then the inner query i s executed and, the outer query output uses this result for checking. This proce ss of inner query execution repeats as many no .of times as there are outer quer y rows. That is, if there are ten rows that can result from outer query, the inn er query is executed that many no. of times. Question: How to find out the 10th highest salary in SQL query? Answer: Table - Tbl_Test_Salary Column - int_salary select max (int_salary) from Tbl_Test_Salary where int_salary in (select top 10 int_Salary from Tbl_Test_Salary order by int_salary) Question: I have a table with duplicate names in it. Write me a query which retu rns only duplicate rows with number of times they are repeated. Answer: SELECT COL1 FROM TAB1 WHERE COL1 IN (SELECT MAX (COL1) FROM TAB1 GROUP BY COL1 HAVING COUNT (COL1) > 1) Question: How to find out the database name from SQL*PLUS command prompt? Answer: Select * from global_name; This will give the data base name which u r currently connected to..... Question: How to display duplicate rows in a table? Answer: select * from emp group by (empid) having count (empid)>1 3. What is lock granularity? There are many locks available for the database system to have like Intent Shared, Shared, Intent exclusive, exclusive and Shared Intent exclusive. Locking granularity refers to the size and hence the number of locks used to ens ure the consistency of a database during multiple concurrent updates. What is a view? How it is related to data independence? ANSWER:

A view may be thought of as a virtual table, that is, a table that does not real ly exist in its own right but is instead derived from one or more underlying bas e table. In other words, there is no stored file that direct represents the view instead a definition of view is stored in data dictionary. Growth and restructuring of base tables is not reflected in views. Thus the view can insulate users from the effects of restructuring and growth in the database . Hence accounts for logical data independence. .

S-ar putea să vă placă și