Shared Flashcard Set

Details

CIS 326 Final
...
33
Computer Networking
Undergraduate 4
05/16/2012

Additional Computer Networking Flashcards

 


 

Cards

Term
ERD Construction Process
Definition

 -Identify entity types

-Determine Primary Keys

-Add relationships

-Identify Min and Max cardinality

-simplify relationships

-document

-add generalization hierarchy

Term
Compound Attribute decomposition
Definition

split common attributes into smaller attributes; can facilitate search of embedded data

*replace an attribute with a collection of attributes

Term
Entity transfrmation
Definition

Make a weak entity a strong entity and change associated identifying relationships into non-identifying relationships.

 

-makes it easier to reference entity type in table design;

reference to a weak entity will involve a combined FK with more than 1 column

-most useful for associative entity types, esp M

*remove identifying dependance symbols and possibly add a PK

Term
Generalization Hierarchy transformation
Definition

should be used sparingly;  useful if there are multiple attributes that do not apply to all entities & there is an accepted classification of entities; can also be allied to a collection of entity types

*Starting from supertype:add subtypes, a GH, & redistribute attributes to subtypes

*starting from subtypes: add supertype, GH, and redistribute common attributes and relationships to supertype

Term
Redundant relationships
Definition

-Relationships is redundant if it can be derived from other relationships; be careful removing b/c can be serious error

 

-

Term

M-N Relationship

(Many-to-Many)

Definition
Each M-N relationship becomes a separate table; PK is a combined key consisting of the PK's of the entity types participating in the M-N relationship
Term
Primary Key selection
Definition
-Should be stable & have single purpose, using guidelines; good choices are integers values automatically generated by DBMS; avoid government identifiers (SSN); 
Term
Update Anomalies
Definition
Occurs when it is necessary to change multiple rows to modify only a single fact
Term
Modification Anomalies
Definition
an unexpected side effect that occurs when changing the data in a table with excessive redundancies
Term
Functional Dependancy
Definition
a constraint about 2 or more columns of a table; X determines Y (X→Y) if there exists at most one value of Y for every value of X
Term
Normal Forms
Definition
a rule about allowable dependencies; each normal form removes certain kinds of redundancies.
Term

First Normal Form

(1NF)

Definition
Prohibits nesting or repeating groups in tables; a table not in 1NF is unnormalized; to convert an unnormalized table into 1NF, you replace each value of a repeating group with a row.
Term

Second Normal Form

(2NF)

Definition
a table is in 2NF if each nonkey column depends on all candidate keys, not on a subset of any candidate key; you should look for functional dependancies that violate this; an FD in which part of a key determines a nonkey column violates it; if all candidate keys contain only one column, it is in 2NF
Term

Third Normal Form

(3NF)

Definition
a table is in 3NF if it is in 2NF AND each nonkey column depends only on candidate keys, not on other nonkey columns; an FD in which a nonkey column determines another nonkey violates this; an equivalent way to define 3NF is that 3NF prohibits transitive dependencies
Term
Denormalization
Definition

the process on combining tables so that they are easier to query

 

Term
Nested Queries
Definition
a query (SELECT statement) inside a query; usually appears as a condition in WHERE or HAVING clauses, can also be used in FROM; also known as subquery
Term
Type I Nested Query
Definition

evaluate ONE time and produces a table

-a nested query in which the inner query has no direct reference to the outer query

Term
Type II Nest Query
Definition

executes one time for EACH row in the outer query

-a nested query in which the inner query DOES reference the outer query

Term
View Materialization
Definition

DBMS service to process a query on a view by executing the query directly on the stored view. The stored view can be materialized on demand or periodically rebuilt from the base table.

1) Create View

2) Run query against view

Term
View Modification
Definition

DBMS service to process a query on a view involving the execution of only ONE query. A query using a view is translated into a query using base tables by replacing references to the view with its definition

*DBMS will bypass view & extract data from original tables

Term
View
Definition

a table derived from base or physical tables using a query

*A view is the Users perception on the database presented in a form

Term
Hierarchical Form
Definition
a formatted window for data entry and display using a fixed (main form) and variable (subform) part. One record is shown in  the main form and multiple, related records are shown in the subform
Term
Hierarchical Report
Definition

a formatted display of a query using indentation to show grouping and sorting

*major advantage is that users can grasp more readily the meaning of data that are sorted and arranged in an indented manner.

Term

Using a Type I nested query, list the customer number, the name (first and last), and the city of each customer who has a balance greater than $150 and placed an order in February 2004.

Definition

SELECT CustNo, CustFirstName, CusstLastName, CustCity

 FROM Customer

 WHERE CustBal > 150 AND CustNo IN

  (SELECT CustNo

    FROM OrderTbl

        WHERE OrdDate BETWEEN #02/01/2010# AND #02/29/2010#)

 

Term
Using a Type II nested query, list the customer number, name (first, last) and city of each customer who has a balance greater than $150 and placed an order in Feb 2010
Definition

SELECT CustNo, CustFirstName, CustLastName CustCity

 FROM Customer

 WHERE CustBal > 150 AND EXISTS

    (SELECT CustNo

       FROM OrderTbl

       WHERE OrdDate BETWEEN #02/01/2010# AND #02/29/2010#

          AND Customer.CustNo = OrderTbl.CustNo)

Term
Using 2 Type I nested queries, list the prodct number, name, and price with a price greater than $150 that were ordered on Jan 23, 2010
Definition

SELECT ProdNo, ProdName, ProdPrice

  FROM Product

  WHERE ProdPrice > 150 AND ProdNo IN

    (SELECT ProdNo

      FROM OrdLine

      WHERE OrdNo IN

        (SELECT OrdNo

          FROM OrderTbl

          WHERE OrdDate = #01/23/2010# ))

Term

Using two Type I nested queries and another join style, list the product number, the name, and the price of products with a price greater than $150 that were ordered in January 2004 by customers with balances greater than $400.

Definition

SELECT ProdNo,  ProdName, ProdPrice

  FROM Product

  WHERE ProdPrice > 150 AND ProdNO IN

     (SELECT ProdNo

        FROM OrdLine

        WHERE OrdNo IN

         (SELECT OredrTbl.OrdNo

            FROM OrederTbl, Customer

            WHERE OrdDate BETWEEN #01/01/2010# AND #01/31/2010#

              AND OrderTbl.CustNo =Customer.CustNo AND CustBal > 400 ))

Term

List the order number, the order date, the employee number, and the employee name (first and last) of orders placed on January 23, 2004. List the order even if there is not an associated employee.

Definition

SELECT OrdNo, OrdDate, Employee.EmpNo, EmpFirstName, EmpLastName

  FROM OrderTbl LEFT JOIN Employee ON OrderTbl.EmpNo = Employee.EmpNo

  WHERE OrdDate = #01/23/2010#

Term

List the order number, the order date, the employee number, the employee name (first and last), the customer number, and the customer name (first and last) of orders placed on January 23, 2004. List the order even if there is not an associated employee.

Definition

SELECT OrdNo, OrdDate, Employee.EmpNo, EmpirstName, EmpLastName, Customer.CustNo, CustFirstName, CustLastName

  FROM (OrderTbl LEFT JOIN Employee ON OrderTbl.EmpNo = Employy.EmpNo)

     INNER JOIN Customer ON Customer.CustNo = OrderTbl.CustNo

  WHERE OrdDate = #01/23/2010#

Term

List all the people in the database. The resulting table should have all columns of the Customer and Employee tables. Match the Customer and Employee tables on first and last names. If a customer does not match any employees, the columns pertaining to the Employee table will be blank. Similarly for an employee who does not match any customers, the columns pertaining to the Customer table will be blank.

Definition

SELECT Customer*, Employee*

  FROM Customer LEFT JOIN Employee

    ON Customer.CustFirstName =Employee.EmpFirstName

    AND Customer.CustLastName = Employee.CustLastName

  UNION

SELECT Customer*, Employee*

  FROM Customer RIGHT JOIN Employee

     ON Customer.CustFirstName = Employee.EmpFirstName

     AND Customer.CustLastName = Employee.EmpLastName

Term

For each ‘Ink Jet’ product ordered in January 2004, list the order number, the order date, the customer number, the customer name (first and last), the employee number (if present), the employee name (first and last), the quantity ordered, the product number, and the product name. Include products containing ‘Ink Jet’ in the product name. Include both internet (no employee) and phone orders (taken by an employee).

Definition

SELECT OrderTbl.OrdNo, OrdDate, Employee.EmpNo, EmpFirstName, EmpLastName, Customer.CustNo, 

             CustomerFirstName, CustomerLastName, OrdLine.Qty, Product.ProdNo, , ProdName

  FROM ((( OrdTbl LEFT JOIN Employee ON OrderTbl.EmpNo = Employee.EmpNo)

      INNER JOIN Customer ON Customer.CustNo = OrderTbl.CustNo)

      INNER JOIN OrdLine ON OrderTbl.OrdNo = OreLine.OrdNo)

      INNER JOIN Product ON OrdLine.ProdNo = Product.ProdNo

  WHERE OrdDate BETWEEN #01/01/2010# AND #01/31/2010# AND ProdName LIKE '*Ink Jet*'

Term

Using a Type II nested query, list the customer number and the customer name of Colorado customers who have not placed orders in February 2004.

Definition

SELECT Customer.CustNo, CustomerFirstName, CustLastName

  FROM Customer

  WHERE CustState = 'CO' AND NOT EXISTS

     (SELECT *

        FROM OrderTbl

        WHERE OrdDate BETWEEN #02/01/2010# AND #02/29/2010#

           AND OrderTbl.CustNo = Customer.CustNo )

Term

Using a Type I nested query, list the customer number and the customer name of Colorado customers who have not placed orders in February 2004.

Definition

SELECT Customer.CustNo, CustFirstName, CustLastName

  FROM Customer

  WHERE CustState = 'CO' AND CustNo NOT IN

     (SELECT CustNo

      FROM OrderTbl

      WHERE OrdDate BETWEEN #02/01/2010# AND #02/29/2010#)

Supporting users have an ad free experience!