Upwork Test

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 22

1

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

You are creating an ASP.NET application that is hosted on your companys Web server. You want to access a database
Answers

1. Begin a transaction
2. Create a connection to the database
3. Create a data set using an adapter object
4. Use the data set to display data or to change items in the database
5. Update the database from the data set
6. Close the database connection
7. Check for transaction errors
Which of the following are aggregate functions in SQL?

Answers:
1. Avg
2. Select
3. Order By
4. Sum
5. Union
6. Group by
7. Having

You create an ASP.NET application for an online insurance site PremiumInsurance. A page named PersonalDetails.asp

<%@ Page Language=VB CodeBehind=PersonalDetails.aspx.vb AutoEventWireup=false inherits=InsApp.Perso

PersonalDetails.aspx had a TextBox control named MemberID in which the user can enter a Personal MemberID. The H
<asp:TextBox ID=MemberID Columns=20 Runat=server/>

You need to implement a TextChanged event handler for MemberID. You want this event handler to retrieve information
will then be redisplayed with additional information about the vehicle obtained from the XML Web service.

You are implementing the TextChanged event handler. Which two courses of action should you take? (Each correct an
Answers

1. In the Page directive for PersonalDetails.aspx, ensure that the AutoEventWireup attributes is set to true.
2. In the Page directive for PersonalDetails.aspx, ensure that the EnableViewState attribute is set to true.
3. In the MemberID HTML element, ensure that the AutoPostback attribute is set to false. Include code for the

4. In the MemberID HTML element, ensure that the AutoPostback attribute is set to true. Include code in the Te
The simplest query must include at least________ and _________.

Answers:
1. A select clause
2. A where clause
3. A from clause

4. A group by clause
5. A having clause
6. An order by clause

You are the software engineer for Premium Corp.. One of the pages in an ASP.NET application contains the following d

<%@ Register Tagprefix=WoodySideBankControls Namespace=WoodySideBankNameSpace Assembly=MyAssem

The assembly named MyAssembly contains a custom server control named CSC1. Which of the following code sample

Answers:
1. <WoodySideBankControls:CSC1 id=Control1 runat=server />
2. <WoodySideBankNameSpace:CSC1 id=Control1 runat=server />
3. <WoodySideBankControls:Control1 id=CSC1 runat=server />
4. <WoodySideBankNameSpace:Control1 id=CSC1 runat=server />
LAST_NAME DEPARTMENT_ID SALARY
ALLEN 10 3000
MILLER 20 1500
King 20 2200
Davis 30 5000
Which of the following Subqueries will execute without any error?

Answers:

1. SELECT distinct department_id FROM employees Where salary = (SELECT AVG(salary) FROM employees G
2. SELECT distinct department_id FROM employees Where salary > (SELECT AVG(salary) FROM employees G
3. SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employ
4. SELECT distinct department_id FROM employees Where salary > ALL (SELECT AVG(salary) FROM employe
5. SELECT distinct department_id FROM employees Where salary < (SELECT AVG(salary) FROM employees G
What will happen if you query the emp table as shown below:
select empno, DISTINCT ename, Salary from emp;
Answers:

1. EMPNO, unique value of ENAME and then SALARY are displayed


2. EMPNO, unique value ENAME and unique value of SALARY are displayed
3. DISTINCT is not a valid keyword in SQL
4. No values will be displayed because the statement will return an error
You are debugging an ASP.NET application for Premium Corp.. Users will use the application to produce reports. Your
.NET should you use to inspect output from the Debug.WriteLine statements?

Answers:
1.
2.
3.
4.

Command
Locals
Output
Breakpoints

Examine the query:select (2/2/4) from tab1;


where tab1 is a table with one row. This would give a result of:
Answers:

1. 4
2. 2
3. 1
4. .5
5. .25
6. 0
7. 8
8. 24
Is it possible to insert several rows into a table with a single INSERT statement?
Answers:

1. No
2. Yes

You use a Command object to retrieve employee names from the employee table in the database. Which of the followin
Answers:

1. DataRow
2. DataSet
3. DataTable
4. DataReader
Which of the following are the valid methods of the SqlTransaction class?
Answers:

1. Commit
2. Terminate
3. Save
4. Close
5. Rollback
Which of the two statements is true?
(a)MSIL code is platform independent
(b)CLR is platform dependent
Answers:

1. Only (a) is true, (b) is false


2. Only (b) is true, (a) is false
3. Both (a) and (b) are true
4. Both (a) and (b) are false

Consider the following two statements relating to ASP.NET and choose the most appropriate option:
Statement 1: Value types are allocated on a stack
Statement 2: Reference types are allocated on a managed CLR Heap
Answers:

1. Statement 1 is true and statement 2 is false


2. Statement 2 is true and statement 1 is false
3. Both statements 1 and 2 are true
4. Both statements 1 and 2 are false
You are debugging a Visual Basic.NET application. You add a variable to the watch window. When Visual Basic enters
the problem?
Answers:

1. The variable is not currently in scope.


2. The variable has been defined as public.
3. The variable has been defined as private.
4. The variable has not been defined in this project.
Check the following code:
Public Shared Sub UpdateData(ByVal sql As String,ByVal connectionString As String, ByVal dataTable As DataTable)
Dim da As New OleDb.OleDbDataAdapter()
Dim cnn As New OleDb.OleDbConnection(connectionString)
dataTable.AcceptChanges()
da.UpdateCommand.CommandText = sql
da.UpdateCommand.Connection = cnn
da.Update(dataTable)
da.Dispose()
End Sub

You are creating an ASP.NET application that will be used by companies to quickly create information portals customiz
variables for use by the page in your application. You need your application to initialize these text strings only when th
Answers:

1. Add code to the Application_OnStart event handler in the Global.asax file to set the values of the text strings.
2. Add code to the Application_BeginRequest event handler in the Global.asax file to set the values of the text st
3. Add code to the Session_OnStart event handler in the Global.asax file to set the values of the text strings.
4. Include code in the Page.Load event handler for the default application page that sets the values if the text str
5. IsPostback property of the Page object is False.

6. Include code in the Page.Load event handler for the default application page that sets the values of the text st
Examine the code given below:
SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000

Which of the following statements is correct with regard to this code?


Answers:

1. It returns employees whose salary is 50% more than $23,000


2. It returns employees who have 50% commission rate or salary greater than $23,000
3. It returns employees whose salary is 50% less than $23,000
4. None of the above

Evaluate the following SQL statement:


SELECT e.employee_id,( (.15* e.salary) + (.5 * e.commission_pct) + (s.sales_amount * (.35 * e.bonus
s.emp_id;
What will happen if all the parentheses are removed from the calculation?
Answers:
1. The value displayed in the CALC_VALUE column will be lower
2. The value displayed in the CALC_VALUE column will be higher
3. There will be no difference in the value displayed in the CALC_VALUE column
4. An error will be reported

You are creating an ASP.NET page for Premium Consultants. You create a GridView control that displays past purchase
the page is created. The page contains TextBox controls that allow users to update their personal information, such as
as possible when users update their contact information.
What should you do?
Answers:

1. Set the Enabled property of the GridView control to false.


2. Set the EnableViewState property of the GridView to false.
3. Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack prop
4. Write code in the Page.Load event handler that populates the GridView control only when the IsPostBack prop

Sam is developing an application that enables the users to perform read and write operations on text files. He uses str
files that were opened in the Finally block. Which of the following is true regarding the Finally block?
Answers:

1. Finally block will be executed only if an error occurs


2. Finally block is executed after Catch block when no error occurs
3. Finally block is executed after Try block regardless of whether an error occurs
4. Finally block is executed only when no error occurs

You are creating an ASP.NET application that will record each customers entry. It is possible that thousands of entries
servers. As customers enter information into your application, maintaining state information will be important. This inf
that a Web server is restarted. Customers will enter data into three separate pages in your application. Which of the fo
Answers:

1. View State
2. Hidden fields

3. State Server
4. Application state
5. SQL Server

You are creating an ASP.net application to enter timesheet data intuitively. Users will enter data using a DataGrid. You h
to allow users to initiate some calculations on the data in the grid. Which event does the DataGrid control raise when t
Answers:

1. EditCommand
2. OnClick
3. ButtonClicked
4. ItemCommand

Which line of code should you use to copy the edited rows from dataset productInfo into another dataset productChan
Answers:

1. productChanges = productInfo.GetChanges(DataRowState.Detached)
2. productChanges = productInfo.GetChanges()
3. productChanges.Merge(productInfo, true)
4. productChanges.Merge(productInfo, false)

You are maintaining data for its products in the Products table, and you want to see those products, which are 50 item
The structure of the Products table is:
ProductID
ProductName
CurrentStock
MinimumStock
Two possible queries are:
(a)select * from products where currentStock > MinimumStock + 50
(b)select * from products where currentStock 50 > MinimumStock
Choose the appropriate option with regard to the above queries.
Answers:

1. (a) is correct
2. (b) is correct

3. (a) and (b) both are correct


4. (a) and (b) both are incorrect
How you will generate a report with minimum network traffic?
Answers:

1. Use Microsoft SQL Server indexes to optimize the data calculations


2. Implement the calculations in a business layer class
3. Implement the calculations in a data layer class

4. Use Microsoft SQL Server stored procedures for the data calculations

You are creating an ASP.NET Web site for your company. The Web site will use both Microsoft(R) .NET Framework serv
create a Setup and Deployment project to package the ActiveX controls. Which project type should you create?

Answers:

1. Cab

2. Merge Module
3. Web Setup
4. Setup

In SQL Server, you should avoid the use of cursors because:


Answers:
1. They are very difficult to implement
2. Programs with cursors take more time to run, hence performance degrades
3. Programs with cursors are more lengthy, hence they consume more space/memory
4. No, you must maximize the use of cursors because they improve performance

Which one of the following correctly selects rows from the table myTable that have null in column c
Answers:
1. SELECT * FROM myTable WHERE column1 is null
2. SELECT * FROM myTable WHERE column1 = null
3. SELECT * FROM myTable WHERE column1 EQUALS null
4. SELECT * FROM myTable WHERE column1 NOT null
5. SELECT * FROM myTable WHERE column1 CONTAINS null

Consider the following queries:


1. select * from employee where department LIKE [^F-M]%;
2. select * from employee where department = [^F-M]%;
Select the correct option:
Answers:
1. Query 2 will return an error
2. Both the queries will return the same set of records
3. Query 2 is perfectly correct
4. Query 2 would return one record less than Query 1

You need to install an online parcel tracking application and its supporting assemblies so that the a
Programs Control Panel applet. What should you do?
Answers:

1. Use a Web installation package for the Web application. Use the Global Application Cache (GAc)utility, GACU

2. Use Xcopy deployment for the Web application and its supporting assemblies.
3. Use Xcopy deployment to deploy the Web application. Use merge modules to install the supporting assemblie
4. Use a Web installation package to install the Web application and the supporting assemblies.
Which of the following is not a valid SQL operator?
Answers:

1. Between..and..
2. Like
3. In

4. Is null
5. Having
6. Not in
7. All of the above are valid.

You create an ASP.NET page that allows a user to enter a requested delivery date in a TextBox control named txtDelDa
that 60 business days after the order date. You add a CustomValidator control to your page. In the Properties window,
entered in the txtDelDate TextBox control falls within the acceptable range of values. In addition, you need to minimize
Answers:

1. Set the AutoPostBack property of txtDelDate to False. Write code in the ServerValidate event handler to valida
2. Set the AutoPostBack property of txtDelDate to True. Write code in the ServerValidate event handler to valida

3. Set the AutoPostBack property of txtDelDate to False. Set the ClientValidationFunction property to the name o

4. Set the AutoPostBack property of txtDelDate to True. Set the ClientValidationFunction property to the name of

33. In ASP.NET, the exception handling should be used:


Answers:
1. to signal the occurrence of unusual or unanticipated program events
2. to redirect the programs normal flow of control
3. in cases of potential logic or user input errors
4. in case of overflow of an array boundary

34. How can you view the results of Trace.Write() statements?


Answers:
1. By enabling page tracing
2. By enabling application tracing
3. By enabling server tracing
4. By looking up the system.log file

35. Which of the following are false for ASP.NET events?


Answers:
1. Events are specialized forms of delegates
2. Events are used to support the callback event notification model
3. The signature of any event handler is fixed
4. All of the above are true

36. What will happen if the Server configuration file and the Application configuration file have diffe
Answers:

1. The Server configuration will always override the Application configuration


2. The Application configuration will always override the Server configuration
3. The Server configuration will override the Application configuration if allowOverride is set to false in the settin
4. The Application configuration will override the Server configuration if allowOverride is set to false in the settin
37. A company has the following departments:
Marketing, Designing, production, Packing
What will be the result of the following query?
select * from table where department < marketing;
Answers:

1. The query will return Designing, Packing


2. The query will return Designing, production, Packing
3. The query will return packing
4. Strings cannot be compared using < operator
5. The query will return Designing

Your company, StoreIt Inc has stored the text of several journals in a Microsoft SQL Server 7.0 database. Each sentenc
granularity. Several of these works are many thousands of printed pages in length. You are building a Web application
Web application requests large amounts of text, your application must return it in the most efficient manner possible. H
response to the user?

Answers:
1. Use a RichTextBox object to hold the data as it is being concatenated.
2. Use the Append method of the String class.
3. Use the String class and the & operator.
4. Use the StringBuilder class.

The sales database contains a customer table and an order table. For each order there is one and only one customer, a
key fields be placed into the design of this database?
Answers:

1. A primary key should be created for the customer_id field in the customer table and also for the
2. A primary key should be created for the order_id field in the customer table and also for the cus

3. A primary key should be created for the customer_id field in the customer table and a foreign ke

4. A primary key should be created for the customer_id field in the customer table and a foreign ke
5. None of these

You want to access data from the Customer table in the database. You generate a DataSet named MyDataSet by ad
the data from the database into MyDataSet which has been loaded with multiple tables, using a SqlDataAdapter nam

Answers:

1. MyAdapter.Fill(MyDataSet,Customer)
2. MyAdapter.Fill(MyDataSet,Customer)
3. MyAdapter.Fill(MyDataSet)
4. MyAdapter.Fill(MyDataSet)
What is the order of precedence among the following operators?
1 IN
2 NOT
3 AND
4 OR
Answers:

1. 1,2,3,4
2. 2,3,4,1
3. 1,2,4,3
4. 1,4,3,2
5. 4,3,2,1
6. 4,1,2,3
7. 4,2,1,3
8. 3,2,1,4

Which query will display data from the Pers table relating to Analysts, clerks and Salesmen who joined between 1/1/20
Answers:

1. select * from Pers where joining_date from 1/1/2005 to 1/2/2005, job= Analyst or clerk or salesman
2. select * from Pers where joining_date between 1/1/2005 to 1/2/2005, job= Analyst or job= clerk or job= sa
3. select * from Pers where joining_date between 1/1/2005 and 1/2/2005 and (job= Analyst or clerk or salesm
4. None of the above
43. What is the correct order of clauses in the select statement?
1 select
2 order by
3 where
4 having
5 group by
Answers:

1. 1,2,3,4,5
2. 1,3,5,4,2
3. 1,3,5,2,4
4. 1,3,2,5,4
5. 1,3,2,4,5
6. 1,5,2,3,4
7. 1,4,2,3,5
8. 1,4,3,2,5
Which of the following queries is valid?
Answers:

1. Select * from students where marks > avg(marks);


2. Select * from students order by marks where subject = SQL;
3. Select * from students having subject =SQL;
4. Select name from students group by subject, name;
5. Select group(*) from students;
6. Select name,avg(marks) from students;
7. None of the above

You might also like