Professional Documents
Culture Documents
Please select your answers for the questions below. Please note, that there is ONLY ONE best answer for
each question.
4. In general, if you want to write a SELECT statement to fetch data, which of the following is the
correct syntax?
A. SELECT FROM Employees
B. SELECT Employees WHERE Level > 3 ORDER BY EmployeeID
C. SELECT OrderID * FROM Employees WHERE Level > 3 ORDER BY EmployeeID
D. SELECT OrderID, Level FROM Orders WHERE Level > 3 ORDER BY Level
7. When trying to get total row count from the table Orders, which of the following is right by
returning the correct row count?
A. SELECT COUNT(OrderDate) FROM Orders
B. SELECT COUNT(OrderID) FROM Orders
C. SELECT COUNT(ShipCountry) FROM Orders
D. SELECT COUNT(ShipCity) FROM Orders
9. Which of the following queries can give us the result of listing Orders with average unit price
and discount? (Use function AVG to gather average value on a field)
A. SELECT OrderID, AVG(UnitPrice), AVG(Discount) FROM OrderDetails
B. SELECT OrderID, AVG(UnitPrice), AVG(Discount) FROM OrderDetails GROUP BY ProductID
C. SELECT OrderID, AVG(UnitPrice), AVG(Discount) FROM OrderDetails GROUP BY OrderID
D. You cannot aggregate more than one field with one SELECT.
10. If you want to directly switch between the VBA code editor and your Access database Form
Design view, which below can you take to do it as the quickest way?
A. Press F9
B. Use ALT_F11
C. Click Menu, search the correct item, and then click to go to the window
D. Click it from the bottom window list of your Window system
11. You are to build an on-click event response VBA code, which of the following is correct name of
Event Procedure Sub for Clicking button btnSetCaption?
A. Private Sub btnSetCaption_Clicking ()
‘ Your code
End Sub
B. Private Sub btnSetCaption_Clicked ()
‘ Your code
End Sub
C. Private Sub btnSetCaption_OnClick ()
‘ Your code
End Sub
D. Private Sub btnSetCaption_Click ()
‘ Your code
End Sub
12. Look at the code below as in a Sub, which one can run and give you a result?
A. Dim CutomerID As Byte
CustomerID = 246.8
MsgBox “CustomerID = “ & CustomerID
B. Dim CutomerID As Byte
CustomerID = 256
MsgBox “CustomerID = “ & CustomerID
C. Dim CutomerID As Byte
CustomerID = 5001
MsgBox “CustomerID = “ & CustomerID
D. Dim CutomerID As Byte
CustomerID = 105
MsgBox “CustomerID = “, CustomerID
13. Look at the code in a form below, and then pick the right result.
Dim Adding As Integer
Private Sub Form_Load()
Adding = 0
‘ Some of your code
End Sub
Private Sub Add1()
‘ Some of your code
Adding = Adding + 1
Add2
End Sub
Private Sub Add2()
‘ Some of your code
Adding = Adding + 1
Add3
End Sub
Private Sub Add3()
‘ Some of your code
MsgBox “Adding=” & Adding
Adding = Adding + 1
End Sub
… Some of your VBA Subs and Functions
14. Which of the following can be used in your VBA code to open another form from the current
form in Access?
A. Right click on the form from the left hand side of the form and choose Form View
B. Double-click on the form to open it
C. Call DoCmd.OpenForm
D. Use Me.OpenForm
15. When coding in VBA, why do we need to use ADO?
A. ADO is used to bound form and get data for its record source
B. Using ADO can link multiple forms each other
C. ADO is used to quickly open and close forms
D. ADO is used to connect to multiple types of data sources and run queries
1. A
2. C
3. A
4. D
5. D
6. C
7. B
8. A
9. C
10. B
11. D
12. A
13. C
14. C
15. D