









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Which of the statements below best describes the result set returned by this SELECT statement? SELECT VendorState, COUNT() AS Column FROM Vendors GROUP BY VendorState HAVING COUNT() > 1; A. the names of the vendors in each state B. the duplicate vendors from each state C. the number of vendors in each state
Which aggregate expression gets the number of unique values in the VendorID column? A. AVG(VendorID) B. COUNT(VendorID) C. SUM(VendorID)
SELECT VendorState, VendorCity, VendorName, COUNT(*) AS InvoiceQty,SUM(InvoiceTotal) AS InvoiceAvg FROM Invoices i JOIN Vendors v ON i.VendorID = v.VendorID WHERE VendorState < 'e'
GROUP BY VendorState, VendorCity, VendorName HAVING SUM(InvoiceTotal) > 500 ORDER BY VendorState, VendorCity, VendorName; The GROUPING SETS operator works like the ROLLUP and CUBE operators, but it... A. excludes summary rows B. doesn't add summary rows for specified groups C. allows you to use additional sets of parentheses to create composite groups
allows you to use additional sets of parentheses to create composite groups Expressions coded in the WHERE clause... A. can use either aggregate search conditions or non-aggregate search conditions B. can use aggregate search conditions but can't use non-aggregate search conditions C. can use non-aggregate search conditions but can't use aggregate search conditions
aggregate search conditions but can't use aggregate search conditions A SELECT statement that includes aggregate functions is often called a/an ________________ query. A. action B. compound C. summary
Which aggregate expression finds the latest date in the InvoiceDate column? A. SUM(InvoiceDate) B. COUNT(InvoiceDate) C. MAX(InvoiceDate)
JOIN Top5 ON i.VendorID = Top5.VendorID GROUP BY i.VendorID ORDER BY LargestInvoice DESC; When this query is executed, each row in the result table will show... A. the largest invoice amount related to that row B. the average invoice amount related to that row C. the largest invoice amount related to that row, but only if it's larger than the average for all invoices D. the average invoice amount related to that row, but only if it's larger than the average for all invoices
row If coded as follows, what can the subquery return? SELECT (subquery) A. a single value B. a column of one or more values C. a table
If coded as follows, what can the subquery return? WHERE (subquery) A. a single value B. a column of one or more rows C. a table
coded in this way WITH Top5 AS(SELECT TOP 5 VendorID, AVG(InvoiceTotal) AS AvgInvoice
FROM Invoices GROUP BY VendorID ORDER BY AvgInvoice DESC) SELECT i.VendorID, MAX(i.InvoiceTotal) AS LargestInvoice FROM Invoices i JOIN Top5 ON i.VendorID = Top5.VendorID GROUP BY i.VendorID ORDER BY LargestInvoice DESC; In this query, the table named Top5 is used as part of a... A. correlated subquery B. noncorrelated subquery C. correlated table expression
Which operator can you use to test whether any rows are returned by a subquery? A. EXISTS B. NOT EXISTS C. MAX
A subquery is a/an ______________ statement that's coded within another SQL statement. A. SELECT B. FROM C. ORDER BY
If coded as follows, what can the subquery return? WHERE VendorID NOT IN (subquery) A. a single value B. a column of one or more values C. a table
more values All of the following values can be stored in a column that's defined as decimal(6,2), except... A. - 246. B. 0 C. 2479.
2 of which may be behind the decimal. If you assign a value with one data type to a column with another data type, SQL Server converts the value to the data type of the column using what? A. explicit conversion B. implicit conversion C. Unicode values
Which string uses the least amount of storage when stored in a column of type varchar(20)? A. 'example' B. 'exam' C. 'ex'
Which function is typically used to insert control characters into a character string?
Which of the following statements is true? A. implicit data type conversion is performed when you mix values of different data types in an expression B. every data type can be implicitly converted to every other data type C. values are always implicitly converted from the data type with higher precedence to the data type with lower precedence D. you can convert a data type implicitly by using either the CAST or the CONVERT function
of different data types in an expression Regarding the char and nchar data types, which of the statements below is false? A. data stored using these data types occupies the same number of bytes regardless of the actual length of the string B. they are typically used to define columns that have a fixed number of characters C. the char(2) data type will always contain two characters
strings Which data type is only used to store whole numbers? A. int B. decimal C. real
B. fixed-length string C. Unicode
Observe the ENROLLMENT AND COURSE database: ENROLLMENT EmpID | EmpName | CourseID 111 | Joe | AMG 222 | Bob | AMG 333 | Lisa | PMG 444 | Sue | AMG COURSE CourseID | CourseName AMG | Anger Management PMG | Project Management What will be the result of the following query? SELECT count(*) FROM enrollment GROUP BY courseid;
Which of the following statements would be used to populate a table with data?
Which of the following is an invalid SQL keyword?
DDL commands are CREATE, ALTER, DROP, and TRUNCATE What is the result of the following SQL statement? UPDATE employee SET salary = 50000 WHERE salary < 50000;
Which of the following describes the uniqueness data quality characteristic?
The characteristic that requires each real-world instance to be represented only once in the data collection T/F - Mandating instantaneous entry of all new data is an example of a preventive data quality action.
Missing date of hire information of an employee indicates which data quality problem?
Which of the following describes the conformity data quality characteristic?
format Assume that Table B has a foreign key referring to a primary key in Table A. Which of the following options may result in the following: deleting a row in Table A will cause a deletion of a rowin Table B?
T/F - Misspelled state name in the state field for the address of a customer always indicates the accuracy
Which of the following statements given to you by a consultant should arouse suspicion?
If A --> B is an existing functional dependency, which of the following is an augmented functional dependency?