Sample Questions Answers
Sample Questions Answers
Part 1: SQL
Please use the following database schema to answer questions 1-9. Assume all PK and FK columns have
INTEGER data type and data types of all other columns are as expected.
QUESTION #1: For each state, you want to display name of the state and number of customers that the company has in
the state. Review this statement and determine if it contains a syntax error, and if so on which line.
1. SELECT state, COUNT(*)
2. FROM CUSTOMER
3. GROUP BY state;
The above statement has: (a) no error (b) error on line 1 (c) error on line 2 (d) error on line 3
QUESTION #2: Does the following statement contain any syntax error?
SELECT COUNT(*)
FROM CUSTOMER
GROUP BY state;
The above statement: (a) it has no error (b) it has a syntax error
QUESTION #3: You write the following statement to know how many total suppliers the company has. Is this the right
statement for this purpose?
SELECT COUNT(*)
FROM supplier;
(a) Yes (b) No
QUESTION #4: You write the following statement to know how many total suppliers the company has. Is this the right
statement for this purpose?
SELECT COUNT(supplierID)
FROM product;
(a) Yes (b) No
QUESTION #5: Does the following statement contain any syntax error?
select ProductCode from product
where ProductCode = 21225 or supplierID is null;
The above statement: (a) has no error (b) has a syntax error
This study source was downloaded by 100000868930969 from CourseHero.com on 06-29-2023 15:52:03 GMT -05:00
https://www.coursehero.com/file/87518682/Sample-Questions-Answersdocx/
QUESTION #7: Does the following statement contain any syntax error, if so on which line?
QUESTION #8: Does the following statement contain any syntax error, if so on which line?
QUESTION #9: To add a new row to the INVOICE table, the following type of DML statement should be used (one word
only): -------------- INSERT
For Questions 10-12, please use the following PRODUCT table and data:
QUESTION #10: What will the following statement generate when you run it? If it will generate an error then write the
word “ERROR”; otherwise write the output: -------------- 3
QUESTION #11: What will the following statement generate when you run it? If it will generate an error then write the
word “ERROR”; otherwise write the output: -------------- NULL
QUESTION #12: What will the following statement generate when you run it? If it will generate an error then write the
word “ERROR”; otherwise write the output: -------------- 4
*******
Part 2: NoSQL
(1) Which of the following types of databases has better ACID compliance?
(a) relational databases (b) NoSQL databases (c) big data databases
This study source was downloaded by 100000868930969 from CourseHero.com on 06-29-2023 15:52:03 GMT -05:00
https://www.coursehero.com/file/87518682/Sample-Questions-Answersdocx/
(2) Suppose a JSON collection in a large NoSQL database contains the same data that is stored in multiple tables in a
relational database. We need to process a query that requires retrieving data from multiple tables in a relational database
or multiple documents in a NoSQL database. Which of these choices is more likely to have shorter query response time?
(a) relational databases (b) NoSQL databases (c) big data databases
(a) professor/s whose last name is Lee (b) professor/s or anyone whose last name is Lee
(c) none of the above
(5) Review the following JSON document and determine which of the following is correct query to search for all books
published in 2014?
This study source was downloaded by 100000868930969 from CourseHero.com on 06-29-2023 15:52:03 GMT -05:00
https://www.coursehero.com/file/87518682/Sample-Questions-Answersdocx/
Powered by TCPDF (www.tcpdf.org)