251 Final Important Flashcards

1
Q

(Open Quiz 2 Diagram image)

It is mandatory for employees and mentors to exist in the table.

A

False

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

(Open Quiz 2 Diagram image)

A mentor can have only one employee mentee.

A

False

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

You have a parent Table A that has a 1-1 relationship with Table B. You want to ensure that a record in Table A is not deleted and remains active when you have a record in Table B. You establish a deletion rule of:

A. Set Default

B. Nullify

C. Cascade

D. Restrict

E. Deny

A

D

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

Which discipline below addresses unstructured data as a key part of its value offering:

a. NoSQL

b. Big Data

c. Cloud

d. In Memory Computing

e. RDBMS

A

B

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

The debate on __________has reintroduced some of the old discussions of non-structured DB focused on lower-level data management vs the benefits of structured relational DB.

a. NoSQL

b. Big Data

c. Cloud

d. In Memory Computing

e. RDBMS

A

A

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

An ideal table should have all of the following with the exception of:

a. Primary key

b. Foreign key

c. No calculated field

d. a and c

e. all are needed

A

B

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

Alternative to Relational DB where speed is the leading priority, but reliability can be a concern

A

Nosql

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

Includes focus on complex data sets that may include structured and unstructured data

A

big data

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

Requires the evaluation of data redundancy and geo-graphic redundancy

A

high availability

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

Write a SQL that produces a list of employees making less Than $19.50 per hour that work at store number 222. This list will be provided to the branch manager and she only needs the first and last names of the employees and their hourly rate. The manager wants it in alpha order by last name. Your field specifications state that the store number is defined as a character and the hourly rate as a decimal.

Fields: employee_firstname, employee_lastname, employee_hourlywage, store_number

A

SELECT employee_firstname, employee_lastname, employee_hourlywage, store_number

FROM EMPLOYEE

WHERE employee_hourlywage < 19.50 AND store_number = ‘222’

ORDER BY employee_lastname ASC;

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

Fields: store_number, store_address, store_city, store_state, store_squareft (ex: 1500 V)

Using the same tables above, the construction manager needs to visit each store that is over 1000 square ft (stored as numeric) to review existing city violations. However, the manager only wants to visit those stores that actually have a violation open. The store violations field stores a numeric value equal to the number of violations that are open. Although the manager doesn’t want to see the number of violations, he wants a special indicator for you to add next to the store square footage number of a “V” to remind him that there are violations open. You have been asked to create a report that looks as follows:

A

SELECT store_number, store_address, store_city, store_state, store_squareft || ‘ V’ AS store_squareft
FROM STORE
WHERE store_squareft > 1000 AND store_violations > 0;

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

Write an SQL that will return store number (no other info needed) that are in zip codes starting with 606 or 601, but only if they have zero (decimal) violations.

A

SELECT store_number

FROM STORE

WHERE store_violations = 0 AND (store_zip LIKE ‘606%’ OR store_zip LIKE ‘601%’);

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

Deletion Rule:

The RDBMS will not delete the record in the parent table, but will instead keep the record and designate it as “inactive.”

A

Deny (D)

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

Deletion Rule:

RDBMS does not delete the parent table record if it had related records in the child record

A

Restrict (R)

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

Deletion Rule:

RDBMS will delete the parent table record and all related records in the child table.

A

Cascade (C)

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

Deletion Rule:

The RDBMS will delete the record in the parent table and will then update the foreign key values of related records in the child table to null.

(If you are going to use this deletion rule, you must modify the foreign key’s field specifications and set the Null Support logical element to “Nulls Allowed.”)

A

Nullify (N)

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

Deletion Rule:

RDBMS will delete the parent table record and updates the FK value of the related child table record with “default value” from the logical specification setting

A

Set Default (SD)

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

Do a inner table join for the vendors and products table.

The PK of vendors table is vendor_ID. This is a FK in products table.

The fields you’ll need are vendor_name, product_name, and product_price.

A

SELECT vendor_name, product_name, product_price

FROM vendors, products

WHERE vendors.vendor_ID = products.vendor_ID

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

Self Join Example: You want to send mail to all customer contacts that work at the same company where Jim Jones works. So, we have to first find what company (cust_name) Jim Jones works for and then pull all contacts at that same company.

A

SELECT cust_id, cust_name, cust_contact

FROM Customer

WHERE cust_name = (SELECT cust_name

FROM Customers

WHERE cust_contact = ‘Jim Jones’);

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

A type of join in SQL. Allows you to include rows that have no related rows.

A

Outer join

21
Q

Virtual tables composed of fields from one or more base tables and possibly fields from other views. So, although not a real table, it uses the concept of rows and columns, but does not have its own PK.

Example: From the Students and Classes tables you could make a “Class Roster” table with the fields: Class Name, Student first name, and Student last name

A

Views

22
Q

Create a view in SQL to return list of customers who have ordered any products:

Called “ProductCustomers”

Tables:

Customers (PK is cust_id)

Orders (PK is order_num, FK is cust_id)

OrderItems (FK is order_num)

Fields: cust_name, cust_contact, prod_ID

A

CREATE VIEW ProductCustomers AS

SELECT cust_name, cust_contact, prod_id

FROM Customers, Orders, OrderItems

WHERE Customers.cust_id = Orders.cust_id AND Orderitems.order_num = Orders.order_num;

23
Q

Clustering Files/Tables

A

A technique used to bring data from multiple tables closer together on disk that is often used together - as in a join

downside is that extracting records strictly from one of the tables slows down since those record are dispersed over a greater part of the disk

24
Q

Splitting Tables - partitioning (horizontal)

A

DIFFERENT PARTS

store groups of frequently used records on a different area of the disk or even on a different disk (store near each other on concentrated space for fast access)

25
Q

Splitting Tables - partitioning (vertical)

A

store groups of frequently used columns of tables where columns most used together are stored CLOSE on disk

26
Q

insert a new salesperson named Robert Downey with ID 12345 into salespeople table.

A

INSERT INTO Salespeople (Salesperson_ID, Salesperson_name)

VALUES (‘12345’, ‘Robert Downey’);

27
Q

SQL Update Example: You are updating the customer table. For customers that have over 1000 miles, their Customer_status is changed to Preferred.

A

UPDATE Customer
SET Customer_status = ‘Preferred’
WHERE Number_of_miles > 1000;

28
Q

SQL Example:
We want you to delete some stuff from the Customer table. If the customer_status is “delinquent” (they didn’t pay their bills), please delete this customer.

A

DELETE FROM Customer
WHERE Customer_status = ‘delinquent’;

29
Q

SQL Practice

ACME Supplies has sold the last product from Easy Street vendor (vendor #98001). The ACME Supplier Management team has decided to stop doing business with Easy Street and you have been asked to delete them as a vendor from the database and also delete all its products.

A

DELETE FROM Vendor
WHERE Vendor_ID = ‘98001’;

30
Q

Specifies how the transmitted message is broken up into small “packets” on sending end and reassembled at receiving end
(break data into packets)

A

TCP

31
Q

the protocol for exchanging hypertext info and also indicates the type of browser on the client and other information needed to format the right web pages
(explains how the info is FORMATTED)

A

HTTP

32
Q

Performance Gains: holding a copy of the retrieved data outside of the DB for other requests; often at webserver level (achieved via “query cache” which is specialized and dedicated memory)
ex: log-in credentials

A

Database persistance

33
Q

Performance Gains: a technique where frequently run queries are stored so that the query doesn’t have to go through a process of query optimization every time it is run

A

Canning

34
Q

Performance Gains: emerging space where cloud services are used to place data closer to use
Ex: someone in IL and someone in CA visiting the same website – may look the same, but they are both probably accessing different data based on what’s closest to each of them

A

Edge Computing

35
Q

markup language that instructs the browser on how to DISPLAY the webpage

A

HTML

36
Q

markup language that focuses on the meaning of the data - tells how to INTERPRET the data that is being exchnaged

A

XML

37
Q

XML: Holds the data characteristics that are tied to the relational table fields and other pertinent XML info (no actual values)

A

DTD

38
Q

Holds the actual values and appropriate tags that provide the “meaning” of the data
(holds the actual data - like names and values)

A

XML Document (file)

39
Q

DTD Content models: text only, no element content allowed

A

(#PCDATA)

40
Q

DTD Content models: empty element; null

A

EMPTY

41
Q

DTD Content models: all well formed content allowed

A

ANY

42
Q

DTD Content models: text and element content

A

MIXED

43
Q

DTD Content models: one or more child element names (think fields in a table)

A

(elementname)

44
Q

You designed a vendor database and you have allowed your vendor partners the ability to electronically send you updated product information via the web that you will use to update your vendor product information using an application that resides on your application server. Product ID is the only required field. Other fields are optional, but can occur multiple times. Your product table defined on your database server has the following look:

Product: Product_ID (PK), Product_name, Product_description, Product_cost, Vendor_id (FK)

Create the DTD and XML Doc showing content received from your vendor for product SS999 where they changed the product name to “Super Soap” and set a new cost at .50 cents. Also include a comment in the prologue of XML Doc describing that there has been a product name and cost change.

Add a comment on top of Doc!

A

(click edit to see correct answer)

DTD:
<!ELEMENT Product (Product_ID, Product_Name, Product_description, Product_cost*)>
<!ELEMENT Product _ID (#PCDATA) >
<!ELEMENT Product_Name (#PCDATA) >
<!ELEMENT Product_Description (#PCDATA) >
<!ELEMENT Product_cost (#PCDATA) >

XML Doc:
<!--Product_name + cost change-->

<Product>
<Product_ID> SS999 </Product_ID>
<Product_name> Super Soap </Product_name>
<Product_cost> 0.50 </Product_cost>
</Product>

45
Q

DTD: indicates optional, but can occur 0 or only once (0,1)

A

?

46
Q

DTD: indicates optional, but can occur 0 or many times (0, M)

A

*

47
Q

DTD: indicates required, min 1 occurrence, and max unlimited (1, M)

A

+

48
Q

DTD: exactly one occurrence (1,1)

A

If not explicitly defined (no symbol given after the field)