Integral Marking Scheme version 2024/2025
AND operator - correct answer - It displays a record if more than one condition is true
AVG() function - correct answer - It returns the average value of a numeric column.
BETWEEN operator - correct answer - It allows you to specify a range of numeric
values in a search.
DISTINCT operator - correct answer - It is used to eliminate duplicate rows in a query
result.
IN operator - correct answer - It allows you to specify a list of character strings to be
included in a search
JOIN clause - correct answer - It is used to combine rows from more than one table,
based on a common field between them. Sometimes it is done by using the '=' symbol.
LIKE operator - correct answer - It allows you to specify partial character strings in a
"wildcard" sense.
OR operator - correct answer - It displays a record it either the first condition OR the
second condition is true.
ORDER BY clause - correct answer - It simply takes the result of a SQL query and
orders them by one or more specified attributes.
SELECT command - correct answer - Data retrieval in SQL is accomplished with the
SELECT command.
,Subquery - correct answer - When on SELECT statement is "nested" within another in
a format, it is known as subquery. This is shown when there is a second SELECT
phrase within a set of parenthesis.
Common DDL commands: - correct answer - DROP
- ALTER
- RENAME
- CREATE
- TRUNCATE
Common DML commands: - correct answer - UPDATE
- DELETE
- INSERT
- MERGE
- SELECT
Write the basic SQL query command: - correct answer SELECT<columns>
FROM<table>
WHERE<predicates identifying rows to be included>
Write the SQL query to "Find the commission percentage and year of hire of
salesperson 186": - correct answer SELECT COMMPERCT, YEARHIRE
FROM SALESPERSON
WHERE SPNUM=186;
Write the SQL query to "Retrieve the entire record for salesperson 186": - correct
answer SELECT *
FROM SALESPERSON
WHERE SPNUM=186;
, Write the SQL query to "List the salesperson numbers and salesperson names of those
salespersons who have a commission percentage of 10.": - correct answer SELECT
SPNUM, SPNAME
FROM SALESPERSON
WHERE COMMPERCT=10;
Write the SQL query to "List the salesperson numbers, salesperson names, and
commission percentages of the salespersons whose commission percentage is less
than 12.": - correct answer SELECT SPNUM, SPNAME, COMMPERCT
FROM SALESPERSON
WHERE COMMPERCT<12;
Write the SQL query to "List the customer numbers and headquarters cities of all
customers that have a customer number of at least 1700": - correct answer SELECT
CUSTNUM, HQCITY
FROM CUSTOMER
WHERE CUSTNUM>=1700;
Write the SQL query to "List the customer numbers, customer names, and headquarters
cities of the customers that are headquartered in New York and that have a customer
number higher than 1500": - correct answer SELECT CUSTNUM, CUSTNAME,
HQCITY
FROM CUSTOMER
WHERE HQCITY='New York'
AND CUSTNUM>1500;
Write the SQL query to "List the customer numbers, customer names, and headquarters
cities of the customers that are headquartered in New York OR that have customer
numbers higher than 1500": - correct answer SELECT CUSTNUM, CUSTNAME,
HQCITY
FROM CUSTOMER
WHERE HQCITY='New York'