Questions
1. What will be the output of following query.
select top 2 1 '5'
2. Update the salary from 0 to 30000 by using join.
3. Insert all data from table a into table b without using & insert command.
4. Select emp_name & city without using like operator where emp_name starts with ‘R’ & city with ‘Pune’ in country table.
5. Most widely used conceptual model is:
- ER
- External
- Chen
- Attribute
6. What is surrogate key?
7. Global view of data.
- Master
- Model
- tempdb
8. Table store inforamtion about database or system is:
- Sql
- Master
- Nested
9. Write a query to select distinct records from table.
10. Where is table space located.
11. What is memory leak & how can we avoid it.
12. Which of the following is used to delete entire MYSQL database.
- Mysql_drop_database
- mysql_drop_entiredb
- Mysql_drop_db
- mysql_drop_dbase
13. The USE command ?
- It used to load code from another file.
- Has been deprecated & should be avoided for security reasons.
- Is a pseudonym for the SELECT command.
- Should be used to choose the databaseyou want to use once you have connected.
14. Select names which are not in ‘L’ ‘n’ ( these are the starting letters of names).
15. Replace “Ajit” with “sam” from employee table.
16. Which of the following are not a member of server object.
- Execute
- Transfer
- Open
- HTML Decode
17. Which of the following is not a keyword.
- if
- delegate
- private
- implements
18. What will be the output:
- public unsafe static void Main(string[] args) {
- int a = 45;
- int * p = & a; * p = 666;
- Console.WriteLine(a);
- Console.Readkey();
- }
- 45
- 666
- Garbage value
- Compile time error
19.
- string str = null;
- var abcd = str.ToString();
- Compile time error
- Run time error
20. Namespace can shared between two different solutions / projects.
- True
- False
21. What will be the output:
- class apple {
- enum Demo_enum {
- a, b, c, d, e, f
- };
- public static void Main() {
- Demo_enum i;
- for (i = Demo_enum.a; i < Demo_enum.f; i++)
- Console.WriteLine(i + " has value of: " + (int) i);
- Console.WriteLine();
- Console.ReadKey();
- }
- }
- Compile time error
- 0
- 0,1,2,3,4,5
- Run time error
22. What will be the output:
- class Divide_by_zero {
- static void Main(string[] args) {
- int[] my_array = {
- 4, 5, 16, 80, 60, 900, 2000, 5555
- };
- int[] division = {
- 2, 0, 4, 5, 0, 10
- };
- for (int i = 0; i < my_array.Length; i++) {
- try {
- Console.WriteLine(" {0} ", +my_array[i] + " / " + division[i] + " is: " + my_array[i] / division[i]);
- } catch (Exception ex) {
- Console.WriteLine(" {0} ", ex.Message);
- }
- Console.WriteLine();
- }
- Console.WriteLine(" thank you for doing code");
- Console.ReadLine();
- }
- }
23. What is the return type of constructors? - int
- float
- void
- None of the mentioned
24. Correct statement about run time polymorphism is?
- The overridden base method should be virtual,abstract or override.
- An abstract method is implicitly a virtual method.
- An abstract inherited property cannot be overridden in a derived class.
- Both override method and virtual method must have same access level modifier.
25. What will be the output:
- public class Program {
- abstract class CBaseClass {
- public int iCount;
- public CBaseClass() {
- Console.WriteLine("Base class created");
- iCount = 20;
- }
- public virtual void add() {
- iCount += 10;
- }
- public virtual void add(int iAdd) {
- iCount += iAdd;
- }
- public void sub() {
- iCount -= 10;
- }
- public abstract void sub(int iSub);
- public override string ToString() {
- return base.ToString() + " -- Method of CBaseClass";
- }~CBaseClass() {
- Console.WriteLine("CBaseClass Deleted");
- }
- };
- class CDerived: CBaseClass {
- public CDerived() {
- Console.WriteLine("In CDerived Class");
- iCount = 30;
- }
- public override void add() {
- iCount += 20;
- }
- public void add(int iAdd) {
- iCount += iAdd;
- }
- public void sub() {
- iCount -= 50;
- }
- public sealed override void sub(int iSub) {
- iCount -= 30;
- }~CDerived() {
- Console.WriteLine("CDerived Class Deleted");
- }
- };
- static void Main(string[] args) {
- CDerived derivedObj = new CDerived();
- CBaseClass basePtr = new CDerived();
- CDerived notUsed;
- Console.WriteLine("1:" + derivedObj.iCount);
- derivedObj.add();
- Console.WriteLine("2:" + derivedObj.iCount);
- basePtr.add(30);
- Console.WriteLine("3:" + basePtr.iCount);
- basePtr.sub();
- Console.WriteLine("4:" + basePtr.iCount);
- basePtr.sub(20);
- Console.WriteLine("5:" + basePtr.iCount);
- Console.WriteLine("6: {0}", basePtr);
- Console.ReadKey();
- }
- }
Summary
This blog helps to fresher as well as experience candidates to crack the technical test rounds.