Databases | SQL | Oracle | MS Access Answers

Questions: 641

Answers by our Experts: 641

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Select the statement with the correct syntax below.



SELECT [CustomerID]
,[SalespersonID]
,count(*)
FROM [dbo].[Order_T]
GROUP BY [CustomerID]
,[SalespersonID]

SELECT [CustomerID]
,[SalespersonID]
,count(*)
FROM [dbo].[Order_T]
GROUP BY [CustomerID]


SELECT [CustomerID]
,[SalespersonID]
,count(*)
FROM [dbo].[Order_T]
ORDER BY [CustomerID]
,[SalespersonID]

SELECT [CustomerID]
,[SalespersonID]
,count(*)
FROM [dbo].[Order_T]
Assume a table SALES with sales of a product across all states in USA. Assume there is a column State in that table and that values are the USPS two character state abbreviation. Now select the statement that will give retrieve the sales from Connecticut (CT) and New York (NY).



SELECT *

FROM SALES

WHERE NOT STATE = 'CT'

OR STATE = 'NY'


SELECT *

FROM SALES

WHERE STATE = 'CT'

OR STATE = 'NY'


SELECT *

FROM SALES

WHERE STATE = 'CT'

AND STATE = 'NY'


SELECT *

FROM SALES

WHERE STATE = 'CT'

AND NOT STATE = 'NY'
What is the query below retrieving?

SELECT CUSTOMER_STATE

FROM CUSTOMER_T

GROUP BY CUSTOMER_STATE

HAVING COUNT(*) = 1



record for CUSTOMERID = 1


States with more than 1 customer


States with one customer


States with ID = 1
Table CUSTOMER has all customers, and it has a column LASTNAME for the Customer's last name. What statement below would return all customers whose last name begins with 'EST'?

SELECT *

FROM CUSTOMER

WHERE LASTNAME LIKE 'EST%'


SELECT *

FROM CUSTOMER

WHERE LASTNAME = 'EST%'


SELECT *

FROM CUSTOMER

WHERE LASTNAME = 'EST'


SELECT *

FROM CUSTOMER

WHERE LASTNAME = 'EST'

OR LASTNAME = 'ESTA'
Table CUSTOMER has all customers, and it has a column STATE for the Customer Address' State. What statement below would return all customers from California ('CA') and Texas ('TX')?


SELECT *

FROM CUSTOMER

WHERE STATE = 'CA'

OR STATE = 'TX'


SELECT *

FROM CUSTOMER

WHERE STATE = 'CA' OR 'TX'


SELECT *

FROM CUSTOMER

WHERE STATE = 'CA','TX'


SELECT *

FROM CUSTOMER

WHERE STATE = 'CA'

AND STATE = 'TX'
What is CUST in the statement below?

SELECT CUST.CUSTOMERNAME

FROM CUSTOMER_T CUST

WHERE CUSTOMER_STATE = 'TX'


a column alias


a synonym


a table alias


an aggregate function
Table A has one column, COL1, an INTEGER. Select the command below that would add a row with value 10 to the table.


A (COL1) VALUES (10)


ADD ROW TO A (COL1) VALUES (10)


SELECT A (COL1) VALUES (10)


INSERT INTO A (COL1) VALUES (10)
Referential Integrity is enforced via...


foreign keys


NOT NULL values


NULL values


primary keys
When adding a column to a table, what is the keyword used to make values for the column required? Think how you would avoid that column being empty (no value).


NULL


NOT NULL


PRIMARY KEY


UNIQUE
Difference between natural join and inner join
LATEST TUTORIALS
APPROVED BY CLIENTS