Practice Final Flashcards

(43 cards)

1
Q

In the figure below, which of the following apply to both OUTPATIENTs and RESIDENT_PATIENTs?

A

Checkback_Date
Date_Discharged!
Patient_Name
XML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the following SQL statement do?

DELETE FROM Customer_T
WHERE state = ‘HI’;

A

Deletes all records from Customer_t where the state is equal to HI

Removes the Customer_T table from the database

Deletes all records from the Customer_T table

Doesn’t delete anything because of a syntax error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

MongoDB databases are composed of:

A

collections.
tables.
rowsets.
columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A subquery must use 3rd
normal form table as the outer table.

A

False

True

Depends on the schema

None of the choices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The ________ states that no primary key attribute may be null.

A

referential integrity constraint

*entity integrity rule *

partial specialization rule

range domain rule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which SQL function can be used to calculate the total amount of all orders for a specific customer?

A

*SUM() *

MAX()

TOTAL()

AVG()

None of the above choices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following are properties of relations?

A

Each attribute has the same name.

*No two rows in a relation are identical. *

There are multivalued attributes in a relation.

All columns are numeric.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

All of the following are guidelines for better query design EXCEPT:

A

understand how indexes are used in query processing.

  • use a lot of self-joins. *

write simple queries.

retrieve only the data that you need.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Consider below data in the table.
Technician
———-
Allen
Jacob
Smith
Jones
Hunter
Mark
Jacy
Ogburn
Chris
Dwayne
———-
Which of the following RegEX will find all the names that start with letter “J”?

A

REGEXP_LIKE(Technician,’*J’)

REGEXP_LIKE(Technician,’$J’)

REGEXP_LIKE(Technician,’J^’)

  • REGEXP_LIKE(Technician,’^J’) *
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The following code is an example of a(n):

SELECT Customer_T.CustomerID, Order_T.CustomerID,
CustomerName, OrderID
FROM Customer_T, Order_T
WHERE Customer_T.CustomerID = Order_T. CustomerID;

A

*equi-join. *

subquery.

Full Outer JOIN.

Right Outer JOIN.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What will be returned when the following SQL query is executed?

SELECT driver_no, COUNT() as num_deliveries
FROM deliveries
GROUP BY driver_no
HAVING COUNT(
) > 2;

A

A listing of all drivers who made more than 2 deliveries as well as a count of the number of deliveries

A listing of all drivers

A listing of the number of deliveries greater than 2

A listing of all drivers who made more than 2 deliveries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following is NOT a reason to create an instance of a relational schema with sample data?

A

Sample data can be used to improve user communications.

Sample data can be used for prototype generation.

Sample data can reverse database implementation errors.

Sample data provide a convenient way to check the accuracy of your design.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What type of results did Left join returns?

A

all rows from the left table and only matching rows from the right table

all rows from the right table and only matching rows from the left table

all rows from the left table and the right table

None of the above choices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Multiple values returned from an SQL query that includes an aggregate function are called:

A

*vector aggregates *

scalar aggregates.

agates.

summation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

NoSQL focuses on:

A

avoidance of replication of data.

minimizing storage space.

normalized data.

  • flexibility. *
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The ________ operator is used to combine the output from multiple queries into a single result table.

A

INTERSECT
DIVIDE
COLLATE
* UNION *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following SQL queries uses a subquery to find the second highest price in the products table?

A

SELECT price FROM products WHERE price = (SELECT MAX(price) FROM products);

SELECT MAX(price) FROM products WHERE price < (SELECT AVG(price) FROM products);

SELECT * FROM products WHERE price > (SELECT MIN(price) FROM products);

  • SELECT MAX(price) FROM products WHERE price < (SELECT MAX(price) FROM products); *
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which of the following is the wildcard operator in SQL statements?

18
Q

The last part of an SQL query to be read is the ________ statement.

A

SELECT
FROM
WHERE
ORDER BY

19
Q

A procedure is:

A

stored outside the database.
given a reserved SQL name.
* called by name. *
unable to be modified.

20
Q

An SQL database in 3rd
normal form can be stored in a single mongo DB collection because:

A

By using UNION queries, one can combine all the tables.

Each table can be stored as a single Collection and then a JOIN can be performed.

Mongodb can only store 4th
normal form data.

  • None of the choices*
21
Q

Which of the following SQL queries uses a subquery to find the products that have not been ordered by any customer?

A

*SELECT * FROM products WHERE product_id NOT IN (SELECT product_id FROM orders); *

SELECT * FROM products WHERE product_id = (SELECT product_id FROM orders WHERE order_id IS NOT NULL);

SELECT * FROM products WHERE product_id NOT IN (SELECT product_id FROM orders WHERE order_id IS NULL);

SELECT * FROM products WHERE product_id NOT IN (SELECT DISTINCT product_id FROM orders);

22
Q

An integrity control supported by a DBMS is:

A

substitute estimates.
security.
* range control. *
GUI guards.

23
Q

While Oracle has responsibility for managing data inside a tablespace, the tablespace, as a whole, is managed by the:

A

user.
CEO.
XML.
* operating system. *

24
A natural join is the same as an equi-join, except that it is performed over matching columns that have been defined with the same name, and one of the duplicate columns is eliminated.
False
25
Data is represented in the form of:
a. data trees. *b. tables.* c. data notes. d. chairs.
26
The following code would include: SELECT Customer_T.CustomerID, Order_T.CustomerID, CustomerName, OrderID FROM Customer_T, Order_T WHERE Customer_T.CustomerID = Order_T. CustomerID;
all rows of the Order_T Table regardless of matches with the Customer_T Table. all rows of the Customer_T Table regardless of matches with the Order_T Table. *only rows that match both Customer_T and Order_T Tables.* only rows that don't match both Customer_T and Order_T Tables.
27
4. ________ use the result of the inner query to determine the processing of the outer query.
a. Correlated subqueries b. Outer subqueries c. Inner subqueries *d. Subqueries*
28
5. A table can NOT be normalized if it’s not connected to other tables.
a. True *b. False* c. depends on other relations. d. None of the choices
29
6. Consider the following two tables and select the MOST accurate statement the query : SELECT * FROM Customer C LEFT OUTER JOIN Order O ON C.ID = O.CID; The number of rows in the result will be:
a. 16 * b. 4 * c. 8 d. None of the choices
30
8. Given the following table myTable: Query: select COUNT(DISTINCT C-2) from myTable; The results from the above query will be _______.
a. a.6 b. b.5 *c. c.4* d. d.0 e. None of the choices
31
9. What results will be produced by the following SQL query? SELECT SUM(Standard_Price) as Total_Price from Product_V where Product_Type = 'WOOD';
*The total price of all products that are of type wood* The total price of all products The Standard_Price of the first wood product in the table The Standard_Price of any wood product in the table
32
10. To eliminate duplicate rows in a query, the ________ qualifier is used in the SQL Select command.
a. ALTER *b. DISTINCT* c. CHECK d. SPECIFIC
33
11. Consider the following two tables and select the MOST accurate statement the query: SELECT * FROM Customer C FULL OUTER JOIN Order O ON C.ID = O.CID; The number of rows in the result will be:
a. 16 b. 4 * c. 8 * d. None of the choices
34
12. FULL OUTER JOIN can be used if we need?
Both tables data which has NULL values. Unmatched data from one table. Unmatched data from both the tables. *Matched and unmatched data from both the tables.*
35
13. A cloud computing approach in which the service consists of infrastructure resources and additional tools that enable application and solution data management solution developers to reach a high level of productivity is called:
a. Software-as-a-service. b. *Platform-as-a-service.* c. Infrastructure-as-a-service. d. Tools-as-a-service.
36
14. A business transaction is a sequence of steps that constitute some well-defined business activity.
a. True
37
15. The NoSQL model that incorporates 'column families' is called a:
a. key-value store. b. document store. * c. wide-column store. * d. column-SQL database.
38
16. Big data databases tend to sacrifice consistency for availability.
True
39
17. Consider the following two tables and select the MOST accurate statement about them: What is the result of the following query, assuming the EmpCity column of the employee table contains NULL values? SELECT COUNT(*) FROM Employee WHERE EmpCity IS NULL;
Returns the total number of employees in the table. Returns the number of employees who have a value in the EmpCity column. *Returns the number of employees who do not have a value in the EmpCity column.* Returns an error because NULL values cannot be counted.
40
18. Which of the following SQL queries can be used find the products that have not been ordered by any customer?
*SELECT * FROM products WHERE product_id NOT IN (SELECT product_id FROM orders);* SELECT * FROM products WHERE product_id = (SELECT product_id FROM orders WHERE order_id IS NOT NULL); SELECT * FROM products WHERE product_id NOT IN (SELECT product_id FROM orders WHERE order_id IS NULL); SELECT * FROM products WHERE product_id NOT IN (SELECT DISTINCT product_id FROM orders);
41
19. Select a statement which is most accurate about the following two MongoDB documents: Document 1: {"FirstName": "Bruce", "LastName": "Wayne", "Email": "bwayne@Wayneenterprises.com"} Document 2: {"First name": "Mike", "Last name": "Michael"}
a. Since the schema for the two documents is different, they can NOT be stored in the same collection. b. Because the field names of the two documents are different, they can NOT be stored in the same collection. c. The documents are in incorrect normal forms. *d. none of the choices*
42
20. For mongodb, which of the following commands creates a database named "myDB":
a. create database myDB b. create new myDB c. create myDB *d. use myDB* e. None of the choices