
Data Manipulation Quiz
Authored by David Coetzer
Computers
11th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A programmer is displaying records from a tblProducts table one at a time on a form. After displaying the first product, they want to show the next one. Which command is used to move the dataset's cursor to the very next record in the table?
tblProducts.First;
tblProducts.Next;
tblProducts.Last;
tblProducts.Bookmark;
Answer explanation
The command tblProducts.Next; is used to move the dataset's cursor to the next record in the tblProducts table. The other options do not serve this purpose.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You have a table tblSales with fields Quantity and Price. You need to display the total cost for each sale (Quantity * Price) in a TDBGrid, but you don't want to add a permanent 'TotalCost' field to the actual database table. How can you achieve this?
Manually calculate the total for each row and add it to the TDBGrid cells.
Create a calculated field in the dataset component that computes the total on-the-fly.
Use the tblSales.Insert; command to add a new column to the table temporarily.
Write a separate SQL query just to calculate the totals and display it in another grid.
Answer explanation
Creating a calculated field in the dataset allows for dynamic computation of TotalCost (Quantity * Price) without altering the database structure, making it the most efficient solution for displaying totals in the TDBGrid.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In an application for a veterinarian, you need to calculate the total amount billed for a specific animal's treatments. The tblInvoices contains VisitDate, AnimalID, and Amount. What is the most efficient way to sum the Amount for only the records where AnimalID is 'A101'?
Loop through the entire tblInvoices table with .First and .Next, and use an if statement inside the loop to check if AnimalID is 'A101' before adding the Amount to a running total.
Use the .Locate method to find the first record for 'A101' and then only read the Amount from that single record.
Filter the dataset using tblInvoices.Filter := 'AnimalID = ''A101'''; tblInvoices.Filtered := True; and then loop through the much smaller, filtered result set to sum the Amount.
Ask the user to manually select all the correct records in the TDBGrid and then click a 'Calculate Total' button.
Answer explanation
Filtering the dataset for 'A101' reduces the number of records to process, making it more efficient to sum the Amount. This method avoids unnecessary checks on unrelated records, unlike looping through the entire table.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
An administrator at a school needs to find all students in tblStudents who are registered in 'Grade 11'. Which line of code correctly sets the filter for the dataset?
tblStudents.Filter := 'Grade = 11';
tblStudents.Filter := 'Grade = ''11''';
tblStudents.Filter := 'Grade: 11';
tblStudents.Filtered := 'Grade = 11';
Answer explanation
The correct filter syntax requires single quotes to denote string values in SQL-like queries. Thus, 'Grade = ''11'';' correctly filters for students in Grade 11, while the other options are either incorrect or improperly formatted.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A real estate application needs to display a list of available properties in a TDBGrid. The tblProperties table has a Status field. Which two properties of the dataset component must be used together to show only the properties where the Status is 'Available'?
.Filter and .Filtered
.Filter and .Active
.Locate and .Filtered
.IndexName and .MasterSource
Answer explanation
.Filter allows you to specify a condition (e.g., Status = 'Available'), while .Filtered must be set to true to apply that filter. Together, they effectively limit the dataset to show only the desired properties.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A sales manager wants to see all sales from the last quarter that were greater than R5000. The tblSales table has a SaleDate (a TDateTime field) and a SaleAmount (a numeric field). Which filter expression would achieve this?
tblSales.Filter := 'SaleDate >= #01/05/2025# AND SaleAmount > 5000';
tblSales.Filter := 'SaleDate > 01-05-2025 AND SaleAmount > 5000';
tblSales.Filter := 'SaleDate is after #01/05/2025# AND SaleAmount >= 5000';
tblSales.Filter := 'SaleAmount > 5000 OR SaleDate >= #01/05/2025#';
Answer explanation
The correct filter expression is 'SaleDate >= #01/05/2025# AND SaleAmount > 5000' as it accurately captures sales from the last quarter (starting from 01/05/2025) that exceed R5000.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A data clerk is cleaning a tblMembers database. They need to find members who have not provided an email address. The Email field for these members is empty. What is the correct way to check if the Email field for the current record is empty?
if tblMembers['Email'] = '' then...
if tblMembers['Email'].IsEmpty then...
if tblMembers.FieldByName('Email').IsNull then...
if tblMembers['Email'] = NULL then...
Answer explanation
The correct choice is 'if tblMembers.FieldByName('Email').IsNull then...'. This checks if the Email field is null, which indicates that no email address has been provided, unlike the other options that are incorrect.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
17 questions
ÔN TẬP CUỐI KỲ II TIN 8
Quiz
•
8th - 11th Grade
14 questions
¿QUÉ TANTO SABES?
Quiz
•
1st - 12th Grade
10 questions
TIN 11- KIỂU XÂU
Quiz
•
11th Grade
12 questions
ICT Computer Basics pt1
Quiz
•
10th - 12th Grade
15 questions
J808 LO1 and LO2 planning project keywords / terms
Quiz
•
9th - 11th Grade
17 questions
Email Lớp 6
Quiz
•
6th Grade - University
10 questions
Паскаль. Основные команды
Quiz
•
8th - 11th Grade
10 questions
Excel
Quiz
•
10th - 11th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade