ࡱ> M եbjbj== %WWšl~~~~~~~R "v"v"v8Zv\vtR iB6x:xPxPxPxtttOQQQeЮ$ ˴~tކtttH~~PxPx#HHHt~Px~PxOHtOHHG~~;Px*x =V R l"v;90i)Q|DͶ;H,&~~~~SQL for SQL Server Simple Retrieval The basic form of an SQL expression is simple. It is merely SELECT_FROM_WHERE. After the SELECT, list those columns that you wish to have displayed. After the FROM, list the table or tables that are involved in the query. Finally, after the WHERE, list any conditions that apply to the data you wish to retrieve. Example 1: Retrieve certain columns and all rows. Statement: List the number, description and amount on hand of all parts. Since we want all parts listed there is no need for the WHERE clause (we have no restrictions). The query is thus: SELECT part_number, part_description, units_on_hand FROM Part The query will retrieve: part_number part_description units_on_hand AV13 Blade 40 AX12 Iron 104 AX44 Tray 33 AZ52 Dartboard 20 BA74 Basketball 40 BH22 Cornpopper 95 BN34 Spa Bath 47 BT04 Gas Grill 11  (24 row(s) affected) Example 2: Retrieve all columns and rows. Statement: List the entire orders table. You could use the same structure shown in example 1. However, there is a shortcut. Instead of listing all of the column names after the SELECT, you can use the symbol *. This indicates that you want all columns listed (in the order in which they have been described to the system during data definition). If you want all columns but in a different order, you would have to type the names of the columns in the order in which you want them to appear. In this case, assuming that the normal order is appropriate, the query would be: SELECT * FROM Orders The query will retrieve: Order_number orderdate customer_numeric 12400 2001-09-04 405 12401 2001-09-04 412 12402 2001-09-04 567 12403 2001-09-04 587 12404 2001-09-04 622 12405 2001-09-04 555 12506 2001-09-04 777  (85 row(s) affected) Example 3: Use of a simple condition with the WHERE clause. * Simple conditions consists of a column name, comparison operator (i.e. = ), followed by a value or another column name Statement: What is the first and last name of customer 405? SELECT c_first, c_last FROM Customer WHERE customer_number = 405 *character values must be enclosed in single quotation marks The query will retrieve: c_first c_last Al Williams (1 row(s) affected) Example 4: Use of a compound condition within the WHERE clause. *Compound conditions connects two or more simple conditions Statement: List the number and description of all parts that are in warehouse 2 and have over 50 units on hand. Compound conditions are possible within the WHERE clause using AND, OR, and NOT. In this case, you have: SELECT part_number, part_description FROM part WHERE (warehouse_numeric = '2') AND (units_on_hand > 50) The query will retrieve: part_number part_description CZ81 Treadmill (1 row(s) affected) The condition in the WHERE clause does not have to be an equal-to sign. Any of the normal comparison operators =, >, >=, <, <= may be used, as well as, <> (not equal-to). SQL also recognizes the operator != for not equal-to. Example 5: Use of computed fields. Statement: Find the available credit for all customers who have at least a $500 credit limit. There is no column AvailableCredit in our database. It is, however, computable from two columns that are present, credit_limit and balance (AvailableCredit = credit_limit - balance). There are two possible ways around this problem. If the DBMS that we are using supports virtual columns (columns that are not physically stored but rather are computed from existing columns when needed), then AvailableCredit could have been described to the system as a virtual column during the definition of the Customer table, and we could use it in this query. Assuming that, for whatever reason, this has not been done, we have a second solution to the problem. SQL permits us to specify computations within the SQL expression. In this case, we would have: SELECT customer_number, c_first, c_last, (credit_limit - balance) FROM Customer WHERE credit_limit >= 500 The query will retrieve: customer_number c_first c_last 114 Roger Twain 471.00 124 Sally Adams 181.25 221 Louise Henderson 145.00 256 Ann Samuels 1478.50 311 Don Charles 174.25 315 Tom Daniels -20.75 322 Linda Thompson 354.50 405 Al Williams 1097.25 412 Sally Adams 182.50 413 Alan Rogers -145.50  (20 row(s) affected) Note that the heading for the available credit column is simply a blank. Since this column does not exist in the Customer table, the computer does not know how to label the column. There is a facility within SQL to change any of the column headings to whatever you desire. To insert a column name, simply use the keyword AS followed by the desired column name (i.e. AvailableCredit), following the SQL expression of the computed column, (credit_limit - balance). Thus, we would have: SELECT customer_number, c_first, c_last, (credit_limit - balance) AS AvailableCredit FROM Customer WHERE credit_limit >= 500 The new query will retrieve the same results as above, but replaces the blank with a new column name, AvailableCredit. Example 6: Use of LIKE. Statement: List the first and last name and the address, city, and state of all the customers who live in Ada. Because of the way our Customer table has been designed, this is a relatively simple query and there would be no use for the LIKE clause. You would simply use the following SQL statement: SELECT c_first, c_last, c_street, c_city, c_state FROM Customer WHERE c_city = 'Ada' Lets say that the Customer table had been designed differently and the customer address, city, and state were all included under one column, c_address. For example, customer 311s record would now look like: Customer_number c_first c_last c_address balance credit_limit slsrep_numb 311 Don Charles 48 College, Ira, MI 49034 825.75 1000.00 2 Now how would you perform the same query that we performed above? In an instance like this when the city is just a portion of the column labeled c_address, and thus anyone living in Ada has Ada somewhere within his or her address, you can use the LIKE clause. SELECT customer_number, c_first, c_last, c_address FROM Customer WHERE Address LIKE %Ada% The symbol % is used as a wild card. Thus, we are asking for all customers whose address is LIKE some collection of characters, followed by Ada, followed by some other characters. Note that this query would also pick up a customer whose address was 576 Adabell, Lansing, MI. We would probably be safer to have asked for an address like %,Ada,% although this would have missed an address entered as 108 Pine, Ada, MI since this address does not contain the string of characters ,Ada, but rather , Ada,. Sorting Example 7: Use of ORDER BY and IN. Statement: List all customers ordered by last name. List all customers who have a credit limit of $300 or $1000 ordered by last name. List all customers whose first name begins with A ordered by last name. In a relational database, the order of the rows is considered immaterial. Therefore, if the order in which the data is displayed is important to you, then you should request that the results be displayed in the desired order through your query. In SQL, this is done through an ORDER BY clause. 7A: SELECT c_first, c_last FROM Customer ORDER BY c_last The query will retrieve: c_first c_last Sally Adams Sally Adams Don Charles Mateen Cleaves Tom Daniels Tran Dinh Patrick Ewing Mara Galvez  Roger Twain Al Williams (22 row(s) affected) 7B: SELECT c_first, c_last FROM Customer WHERE credit_limit IN (300,1000) ORDER BY c_last The query will retrieve: c_first c_last Sally Adams Don Charles Mara Galvez Louise Henderson Dan Martin Marco Polo Linda Thompson (7 row(s) affected) 7C: SELECT c_first, c_last FROM Customer WHERE c_last LIKE A% ORDER BY c_last You should use name LIKE A% instead of %A% because name LIKE %A% would give you all the customers whose name had the letter A anywhere within the last name. The query will retrieve: c_first c_last Sally Adams Sally Adams (2 row(s) affected) Example 8: Sorting with multiple keys, descending order. Statement: List the customer number, first and last name, and credit limit of all customers, ordered by decreasing credit limit and by customer number within credit limit. This is accomplished as follows: SELECT customer_number, c_first, c_last, credit_limit FROM Customer ORDER BY credit_limit DESC, customer_number The query will retrieve: customer_number c_first c_last credit_limit 412 Sally Adams 2000.00 256 Ann Samuels 1500.00 405 Al Williams 1500.00 522 Mary Nelson 1500.00 124 Sally Adams 1000.00 221 Louise Henderson 1000.00  778 Betty Hurst 400.00 112 Martin Lombard 200.00 (22 row(s) affected) Built-In Functions SQL has several built-in functions: COUNT - count of the number of values in a column SUM - sum of the values in a column AVG - average of the values in a column MAX - largest of the values in a column MIN - smallest of the values in a column Example 9: Use of the built-in function COUNT. Statement: How many different types of parts are in the item class AP? In this query, we are interested in the number of rows that contain the item class called AP. The query should be stated as follows: SELECT COUNT (part_number) AS Diff_Part_Types FROM Part WHERE item_class = AP The query will retrieve: Diff_Part_Types 5 (1 row(s) affected) Example 10: Use of COUNT and SUM. Statement: Find the number of customers and the total of their balances . SELECT COUNT (customer_number) AS NoOfCustomer, SUM(balance) AS Totalbalance FROM Customer The query will retrieve: NoOfCustomer Totalbalance 22 14607.37 (1 row(s) affected) Subqueries Example 11: Nesting Queries. Statement: What is the largest credit limit of any customer of sales representative 6? Which customers have this credit limit? Find the answer to part B in one step. 11A. SELECT MAX(credit_limit) AS MaxCreditLimit FROM Customer WHERE slsrep_numb = 06 The query will retrieve: MaxCreditLimit 1500.00 (1 row(s) affected) 11B. (After you see the answer from part A) SELECT customer_number, c_first, c_last FROM Customer WHERE credit_limit = 1500 The query will retrieve: customer_number c_first c_last 256 Ann Samuels 405 Al Williams 522 Mary Nelson (3 row(s) affected) 11C: In part C, you are going to accomplish the same thing that you accomplished in parts A and B, but in one step. You can accomplish this through a nesting query: SELECT customer_number, c_first, c_last FROM Customer WHERE credit_limit IN (SELECT MAX(credit_limit) FROM Customer WHERE slsrep_numb = 06) The query will retrieve the same results as in 11B. The portion of the SQL statement that is contained in the parenthesis is called a subquery. The subquery is evaluated first and then the outer query is evaluated in relation to the subquery. Example 12: Use of Distinct. Statement: Find the numbers of all customers who currently have orders. Find the numbers of all customers who currently have orders, making sure to list each customer only once. Count the number of customers who currently have orders. 12A: The formulation for this query is quite simple if you think about what the question is asking. If a customer currently has an order, then the customers number must appear in at least one row of the Orders table. Therefore the query should be written as follows: SELECT customer_numeric FROM Orders The query will retrieve: customer_numeric 405 412 567 587 622 555 777 413 221 112  (85 row(s) affected) 12B: When you look at the answer to part A, you will see that some of the customer numbers appear more than once. If you want to ensure that this duplication does not occur, you can use the DISTINCT clause. SELECT DISTINCT customer_numeric FROM Orders The query will retrieve: customer_numeric 112 114 124 221 256 311 315  777 778 880 (21 row(s) affected) 12C: Part C involves counting. Although counting has been discussed before, it is important to mention it again when we are discussing the DISTINCT clause. Without the DISTINCT clause, duplicate numbers may be counted twice as the following examples demonstrate: SELECT COUNT(customer_numeric) AS num_of_customers FROM Orders The query will retrieve: num_of_customers 85 (1 row(s) affected) SELECT COUNT(DISTINCT Customer_numeric) AS num_of_customers FROM Orders The query will retrieve: Num_of_customers 21 The same results can be achieved by the following query: SELECT COUNT(customer_number) AS num_of_customers FROM Customer WHERE customer_number IN (SELECT DISTINCT customer_numeric FROM Orders) Example 13: Use of a built-in function in a subquery. Statement: List the number and first and last name of all customers whose balance is over the average balance of all customers. SELECT Customer_number, c_first, c_last, balance FROM Customer WHERE balance > (SELECT AVG(balance) FROM Customer) The query will retrieve: customer_number c_first c_last balance 124 Sally Adams 818.75 221 Louise Henderson 855.00 311 Don Charles 825.75 315 Tom Daniels 770.75 412 Sally Adams 1817.50 555 Patsy Hinez 751.25 622 Dan Martin 1045.75 701 Patrick Ewing 750.25 704 MateenCleaves 1700.12 705 Jerry Stackhouse 700.12 880 Daniel Tanner 851.25 (11 row(s) affected) Grouping Example 14: Using GROUP BY and HAVING. Statement: List the order total for each order. List the order total for those orders that amount to over $700. 14A: The order total is equal to the sum of number of products ordered multiplied by their respective quoted prices for each order number. The query should be written as follows: SELECT order_number, SUM(numeric_ordered * quoted_price) AS order_total FROM Order_Line GROUP BY order_number ORDER BY order_number The query will retrieve: order_number order_total 12400 970.94 12401 74.82 12402 547.51 12403 108.79 12404 77.84 12405 22.95 12406 22.95  12753 27.10 12754 27.10 12755 27.10 (85 row(s) affected) 14B: In part B we are including a restriction. This restriction does not apply to individual rows but rather to groups. Since the WHERE clause applies only to rows, it should not be used in a case such as this. In this particular situation you should use a HAVING clause. SELECT order_number, SUM(numeric_ordered * quoted_price) FROM Order_Line GROUP BY order_number HAVING SUM (numeric_ordered * quoted_price) > 700 ORDER BY order_number The query will retrieve: order_number 12400 970.94 12494 1119.96 12498 1220.21 12517 1349.91 12520 1599.96 12525 773.75 12538 1119.96 12543 703.36 (8 row(s) affected) Example 15: HAVING vs WHERE. Statement: List each credit limit together with the number of customers who have this limit. Same as query A, but only list those credit limits held by more than one customer. List each credit limit together with the number of customers of sales representative 3 who have this limit. Same as query C, but only list those credit limits held by more than one customer. 15A. In order to count the number of customers who have a particular credit limit, the data must be GROUPED BY this credit limit. The query should be written as follows: SELECT credit_limit, COUNT(customer_number) AS no_of_customers FROM Customer GROUP BY credit_limit The query will retrieve: credit_limit no_of_customers 200.00 1 400.00 1 500.00 1 650.00 3 700.00 2 750.00 3 1000.00 7 1500.00 3 2000.00 1 (9 row(s) affected) 15B. Since this condition involves a group total, a HAVING clause must be used. The query should be written as follows: SELECT credit_limit, COUNT(customer_number) AS no_of_customers FROM Customer GROUP BY Credit_limit HAVING COUNT(customer_number) > 1 The query will retrieve: credit_limit no_of_customers 650.00 3 700.00 2 750.00 3 1000.00 7 1500.00 3 (5 row(s) affected) 15C: This condition only involves rows rather than groups, so the WHERE clause should be used here. The query should be written as follows: SELECT credit_limit, COUNT(customer_number) FROM Customer WHERE clsrep_numb = 03 GROUP BY credit_limit The query will retrieve: credit_limit no_of_customers 1000.00 2 2000.00 1 (2 row(s) affected) 15D: In part D, both a WHERE clause and a HAVING clause are needed since the conditions involve both rows and groups. The query should be written as follows: SELECT credit_limit, COUNT(customer_number) FROM Customer WHERE slsrep_numb = 03 GROUP BY credit_limit HAVING COUNT(customer_number) > 1 The query will retrieve: credit_limit no_of_customers 1000.00 2 (1 row(s) affected) Querying Multiple Tables Example 16: Joining two tables together. Statement: For each part that is on order, find the part number, number ordered, and unit price of the part. A part is considered to be on order if there is a row in the Order_Line table in which the part appears. You can easily find the part number and number of parts ordered in the Order_Line table. However, the unit price can only be found in the Part table. In order to satisfy this query, the Part table and the Order_Line table must be joined together. In this instance, the process of joining tables involves finding part numbers in the Order_Line table that match up to the corresponding part numbers in the Part table. The query should be written as follows: SELECT order_number, Order_Line.part_number, unit_price FROM Order_Line, Part WHERE Order_Line.part_number = Part.part_number The query will retrieve: order_number part_number unit_price 12400 AX12 24.95 12400 BZ66 399.99 12400 CA15 18.50 12400 CB03 299.99 12400 CB65 10.99 12400 CX45 35.50 12401 AX12 24.95 12401 BN34 12.47 12401 QW56 34.12  12752 BA74 29.95 12753 BA74 29.95 12754 BA74 29.95 12755 BA74 29.95 (117 row(s) affected) Here we indicated all fields that we wanted to display in the SELECT clause. In the FROM clause, we list the tables that are involved in the query. In the WHERE clause we give the condition that will restrict the data to be retrieved to only those rows from the two relations that match. Example 17: Comparison of JOIN and the use of IN. Statement: Find the description of all parts included in order number 12498. This query also involves both the Part table and the ORDERLIN table so it is very similar to the query that we just wrote. The query should be written as follows: SELECT Part.part_description FROM Order_Line, Part WHERE (Part.part_number = Order_Line.part_number) AND order_number = '12498' The query will retrieve: part_description Dartboard Basketball Spa Bath Gas Grill Toaster Dryer Bike Statue Pool Table Vacuum Bread Maker (11 row(s) affected) It is important to notice that Order_Line was listed in the FROM clause even though there were no fields from the Order_Line relation that were to be displayed. Because a field from the Order_Line relation was listed in the WHERE clause, the Order_Line table must be listed in the FROM clause. Another approach could be taken in this situation involving the IN clause and a subquery. We could first find all of the part numbers in the Order_Line relation that appear on any row in which the order number is 12498 as a subquery. Next we find the descriptions of any parts whose part number is in this list. The query would be written as follows: SELECT part_description FROM Part WHERE Part.part_number IN (SELECT Order_Line.part_number FROM Order_Line WHERE order_number = 12498) Example 18: Comparison of IN and EXISTS. Statement: Find the number and date of those orders that contain part BT04. Find the number and date of those orders that do not contain part BT04. 18A: This query is similar to the previous example and could thus be handled in either of the two ways given by the previous example. Using the formulation involving IN would give: SELECT Orders.order_number, orderdate FROM Orders WHERE Orders.order_number IN (SELECT Order_Line.order_number FROM Order_Line WHERE part_number = BT04) The query will retrieve: order_number orderdate 12491 2001-09-02 00:00:00.000 12498 2001-09-05 00:00:00.000 12500 2001-09-05 00:00:00.000 12517 2001-09-08 00:00:00.000 12541 2001-09-20 00:00:00.000 (5 row(s) affected) 18B: This query could be handled in essentially the same way, except that the IN would be replaced by NOT IN. An alternative formulation can be given using the SQL word EXISTS. However, in this case, we would use NOT EXISTS. The query should be written as follows: SELECT order_number, orderdate FROM Orders WHERE NOT EXISTS (SELECT * FROM Order_Line WHERE Orders.order_number = Order_Line.order_number AND part_number = BT04) For each order number in the Orders table, the subquery is selecting those rows of the Order_Line table on which the order number matches the order number from the Orders table and the part number is BT04 The query will retrieve: order_number orderdate 12400 2001-09-04 00:00:00.000 12401 2001-09-04 00:00:00.000 12402 2001-09-04 00:00:00.000 12403 2001-09-04 00:00:00.000 12404 2001-09-04 00:00:00.000 12405 2001-09-04 00:00:00.000 12406 2001-09-04 00:00:00.000 12407 2001-09-04 00:00:00.000  12752 2001-09-26 00:00:00.000 12753 2001-09-26 00:00:00.000 12754 2001-09-26 00:00:00.000 12755 2001-09-26 00:00:00.000 (80 row(s) affected) Example 19: Subquery within a Subquery. Statement: Find all of the numbers and dates of those orders that include a part located in warehouse 3. You can approach this problem by determining the list of part numbers in the Part relation for those parts that are located in warehouse 3. Once you have completed that, you can obtain a list of order numbers in the Order_Line relation where the corresponding part number is in your previous part number list. Finally, you can retrieve those order numbers and dates in the Orders relation for which the order number is in the list of order numbers obtained in your second step. The query would be written as follows: SELECT order_number, orderdate FROM Orders WHERE order_number IN (SELECT order_number FROM Order_Line WHERE part_number IN (SELECT part_number FROM Part WHERE warehouse_numeric = 3)) The query will retrieve: order_number orderdate 12400 2001-09-04 00:00:00.000 12401 2001-09-04 00:00:00.000 12402 2001-09-04 00:00:00.000 12403 2001-09-04 00:00:00.000 12404 2001-09-04 00:00:00.000 12405 2001-09-04 00:00:00.000 12406 2001-09-04 00:00:00.000 12407 2001-09-04 00:00:00.000  12744 2001-09-25 00:00:00.000 12745 2001-09-25 00:00:00.000 12746 2001-09-26 00:00:00.000 (52 row(s) affected) You could perform this query in an alternative fashion by joining all the tables rather than using subqueries. The query should be written as follows: SELECT Order_line.order_number, orderdate FROM Order_Line, Orders, Part WHERE Orders.order_number = Order_Line.order_number AND Order_Line.part_number = Part.part_number AND warehouse_numeric = '3' GROUP BY order_line.order_number, orderdate This query would produce the same results as the previous query. Example 20: A Comprehensive Example. Statement: List the customer number, the order number, the order date and the order total for all of those orders whose total is over $100. The query should be written as follows: SELECT customer_numeric, Orders.order_number, orderdate, SUM(numeric_ordered * quoted_price) AS OrderTotal FROM Orders, Order_Line WHERE Orders.order_number = Order_Line.order_number GROUP BY Orders.order_number, customer_numeric, orderdate HAVING SUM(numeric_ordered * quoted_price) > 100 ORDER BY Orders.order_number The query will retrieve: customer_numeric order_number orderdate OrderTotal 405 12400 2001-09-04 00:00:00.000 970.94 567 12402 2001-09-04 00:00:00.000 547.51 587 12403 2001-09-04 00:00:00.000 108.79 124 12489 2001-09-02 00:00:00.000 241.45 311 12491 2001-09-02 00:00:00.000 549.98 315 12494 2001-09-04 00:00:00.000 1119.96 522 12498 2001-09-05 00:00:00.000 1220.21 124 12500 2001-09-05 00:00:00.000 149.99  Using An Alias Example 21: Use of an alias. Statement: List the number and first and last name of all sales representatives together with the number and first and last name of all the customers they represent. When tables are listed in the FROM clause, you have the option of giving each table an alias or alternate name that you can use throughout the rest of your statement. You do this by immediately following the table with the alias. There should not be any commas separating the table and the alias. Aliases allow you to simplify your statement. An example of a query using an alias follows: SELECT S.slsrep_numb, S.sr_first, S.sr_last, C.customer_number, C.c_first, C.c_last FROM Sales_Rep S, Customer C WHERE (S.slsrep_numb = C.slsrep_numb) This query will retrieve: slsrep_numb S.sr_first S.sr_last customer_number C.c_first C.c_last 9 Rebecca Shaw 112 Martin Lombard 5 Todd Oldham 114 Roger Twain 3 Mary Jones 124 Sally Adams 6 William Smith 221 Louise Henderson 6 William Smith 256 Ann Samuels 12 Miguel Diaz 311 Don Charles 6 William Smith 315 Tom Daniels 12 Miguel Diaz 322 Linda Thompson 12 Miguel Diaz 405 Al Williams 3 Mary Jones 412 Sally Adams 4 Kelly Parker 413 Alan Rogers 12 Miguel Diaz 522 Mary Nelson 2 Michael Johnson 555 Patsy Hinez 6 William Smith 567 Tran Dinh 6 William Smith 587 Mara Galvez 3 Mary Jones 622 Dan Martin 6 William Smith 701 Patrick Ewing 10 Andrew Leroy 704 Mateen Cleaves 13 Billy Ray Valentine 705 Jerry Stackhouse 2 Michael Johnson 777 Marco Polo 13 Billy Ray Valentine 778 Betty Hurst 2 Michael Johnson 880 Daniel Tanner (22 row(s) affected) Although aliases can be useful for helping to simplify queries, they can also be essential. The next example demonstrates when an alias is essential. More Involved Joins Example 22: Joining a table to itself. Statement: Find the list of any pairs of customers who have the same first and last name. If our database contained two different customer tables and the query requested us to find customers in one table who had the same name as customers in the second table, we would perform a simple join operation. However, we only have one customer table in our database. Using the alias feature of SQL, we can treat our Customer table as though it is two tables in order to fulfill the request. The query should be written as follows: SELECT X.customer_number, X.c_first, X.c_last, Y.customer_number, Y.c_first, Y.c_last FROM Customer X, Customer Y WHERE (X.c_first = Y.c_first AND X.c_last = Y.c_last) AND (X.Customer_number < Y.Customer_number) The query would retrieve: customer_number c_first c_last customer_number c_first c_last 124 Sally Adams 412 Sally Adams (1 row(s) affected) ** The last line in the query was necessary in order to eliminate duplicates. For example, without it, the query would retrieve the following: customer_number c_first c_last customer_number c_first c_last 124 Sally Adams 412 Sally Adams 412 Sally Adams 124 Sally Adams Example 23: An example involving joining all five tables. Statement: List the number and first and last name of all sales representatives who represent any customers who currently have any orders on file for parts in item class HW. The query should be written as follows: SELECT Sales_Rep.slsrep_numb, Sales_Rep.sr_first, Sales_Rep.sr_last FROM Sales_Rep, Customer, Orders, Order_Line, Part WHERE ((Sales_Rep.slsrep_numb = Customer.slsrep_numb) AND (Customer.customer_number = Orders.customer_numeric) AND (Orders.order_number = Order_Line.order_number) AND (Order_Line.part_number = Part.part_number) AND (item_class = 'HW')) GROUP BY Sales_Rep.slsrep_numb, sr_first, sr_last The query will retrieve: slsrep_numb sr_first sr_lastName 2 Michael Johnson 3 Mary Jones 4 Kelly Parker 5 Todd Oldham 6 William Smith 9 Rebecca Shaw 12 Miguel Diaz 13 Billy Ray Valentine (8 row(s) affected) Union, Intersection, and Difference SQL supports the set of operation union, intersection and difference. The UNION of two relations is a relation containing all the rows that are in either the first relation, the second relation, or both. The intersection (INTERSECT) of two relations is a relation that contains all of the rows that are in both relations. The difference (MINUS or EXCEPT) of two relations is the set of rows that are in the first relation but are not in the second relation. However, most DMBSs do not support INTERSECT and MINUSonly Oracle does. These operations have an obvious restriction. It does not make sense to talk about the union of the Customer table and the Orders table, for example. The two relations must have the same structure, which is termed union-compatible. Union-compatible is defined as two relations that have the same number of attributes (columns) and the corresponding attributes have the same domain (of the same type). The column headings of the two relations do not have to be identical but the columns must come from the same domain. Example 24: Use of Union. Statement: List the number and first and last name of all customers who are either represented by sales representative 12 or who currently have orders on file, or both. SELECT Customer_number, c_first, c_last FROM Customer WHERE slsrep_numb = '12' UNION SELECT Customer.customer_number, c_first, c_last FROM Customer, Orders WHERE Customer.customer_number = Orders.customer_numeric The query will retrieve: customer_number c_first c_last 112 Martin Lombard 114 Roger Twain 124 Sally Adams 221 Louise Henderson 256 Ann Samuels 311 Don Charles 315 Tom Daniels 322 Linda Thompson 405 Al Williams 412 Sally Adams  880 Daniel Tanner (21 row(s) affected) All and ANY Example 27: Use of ALL. Statement: Find the number, first and last name, current balance, and sales representative number of those customers whose balance is larger than the balances of all customers of sales representative 12. This query can be satisfied by finding the maximum balance of the customers that are represented by sales representative 12 in a subquery and then finding all customers whose balance is greater than this number. The query can also be satisfied using an ALL statement, which is demonstrated below: SELECT customer_number, c_first, c_last, balance, slsrep_numb FROM Customer WHERE balance > ALL (SELECT balance FROM Customer WHERE slsrep_numb = 12) The query will retrieve: Customer_number c_first c_last balance slsrep_numb 221 Louise Henderson 855.00 6 412 Sally Adams 1817.50 3 622 Dan Martin 1045.75 3 704 Mateen Cleaves 1700.12 10 880 Daniel Tanner 851.25 2 (5 row(s) affected) Example 28: Use of ANY. Statement: Find the number, first and last name, current balance, and sales representative number of those customers whose balance is larger than the balance of any customer of sales representative 12. This query can be satisfied by finding the minimum balance of the customers that are represented by sales representative 12 in a subquery and then finding all customers whose balance is greater than this number. The query can also be satisfied using an ANY statement which is demonstrated below: SELECT Customer_number, c_first, c_last, balance, slsrep_numb FROM Customer WHERE balance > ANY (SELECT balance FROM Customer WHERE Slsrep_numb = 12) The query will retrieve: customer_number c_first c_last balance slsrep_numb 112 Martin Lombard 310.00 9 114 Roger Twain 279.00 5 124 Sally Adams 818.75 3  778 Betty Hurst 500.63 13 880 Daniel Tanner 851.25 2 (20 row(s) affected) Update Example 29: Change existing data in the database. Statement: Change the street of sales representative 12 to 111 Brookhollow. The command should be written as follows: UPDATE Sales_Rep SET c_street = 111 Brookhollow WHERE slsrep_numb = 12 Example 30: Add new data to the database. Statement: Add new customer (444, Cindy, Wilson, 317 Harvard, Grant, MI, 0.00, 300, 6) to the database. The command should be written as follows: INSERT INTO Customer VALUES (444,CINDY,WILSON,317 Harvard,Grant,MI,0.00,300,06) Example 31: Delete data from the database. Statement: Delete customer 124 from the database. The command should be written as follows: DELETE Customer WHERE customer_number = 124 When deleting records from a database it is important to remember to use the primary key. For example, say we had said to delete the customer named Sally Adams. If we had written our command this way, two records would have been deleted because there are two customers named Sally Adams. We may only have meant to delete one. Since primary keys are unique, there will be no chance of deleting more than one record when you delete using the primary key. Example 32: Change data in the database based on a compound condition. Statement: For each customer with a $500 credit limit whose balance does not exceed his/her credit limit, increase the credit limit to $800. The command should be written as follows: UPDATE Customer SET Credit_limit = 800 WHERE Credit_limit = 500 AND balance < Credit_limit Example 33: Create a new relation with data from an existing relation. Statement: Create a new relation called Cust containing the same columns as Customer but only the rows for which the credit limit is $500 or less. The first thing that must be done is to describe the new table using the data definition facilities of SQL. CREATE TABLE Cust (CustNumber CHAR(4). CustFirst CHAR(10). CustLast CHAR(10). CustC_street CHAR(20). CustCity CHAR(10). CustState CHAR(2). balance DECIMAL(7,2). Credit_limit DECIMAL(4,2) Slsrep_numb CHAR(2)) ** CHAR(4) ( 4 represents the number of characters allocated in the relation DECIMAL (7,2) ( 7 = length of the total digits; 2 = number of decimal places Example: 15000.00 Once we have described the new table, we can use the INSERT command we used earlier. However, we must also use a SELECT command to indicate what is to be inserted into this new table. The command should be written as follows: INSERT INTO Cust SELECT * FROM Customer WHERE Credit_limit <= 500 PAGE 28 %e L e f r   @B[\k=>@J޾ޭުު֪ުޛ֕ޛސު֕ޛֺOJQJ 5OJQJ B*CJph>*CJOJQJCJjCJUmHnHu>*CJ5CJ6CJOJQJ]5CJOJQJ\5CJOJQJ CJOJQJ5>*CJOJQJ>*B*CJph B*CJph8%&deVW*YHv`ťԥ  3 4 5 > K L e f  7 W r `  @AB[\k !`=>@J`yov   !?!N!j!k!r#s#{#{5>*CJOJQJB*CJ\ph 5CJ\CJOJQJ\>*CJmH sH 5CJOJQJmH sH jCJUmHnHuCJOJQJmH sH >*CJOJQJ 6CJ]5CJOJQJ\5CJOJQJ>*CJCJ6CJOJQJ] CJOJQJ0|}lm?v'` 0^`0   !"34  `oLM  >^`>uvw  ! !?!N!j!k!r#s#t#|#}##### & F"]"  ']  !]`{##&$'$o$p$q$%%%%%&&&&&&'#':'I'~'''''(b(((((((()))))-*i*+9+o+~++++++*,q,,-"--ö߯ΥΞ߯߯߯߶>*CJOJQJ CJmH sH >*CJOJQJ\ B*CJphjCJUmHnHuCJOJQJmH sH CJ6CJOJQJ]>*CJ CJOJQJ 5>*CJ\5CJOJQJ\5CJOJQJ9#'$q$r$%%%%%%%%%%&&'&>&W&m&&&&&&&&'' & F''''''#':'I'k'|'}'~''''''((4(L(b(|(}((((((((((())))))***+*,*-*.*h*i*++8+9+o+~+++++++*,N,q,,,,-#-$-I-{-|-------------- `---.*...//00%0B0Z0|0}000"131L1M11111 22222222223)3:3W3_3`3u3y3333440444=5>5W5X5]57788899֪֪翤5CJ 5>*CJ5>*CJOJQJ\6CJOJQJ]CJ>*CJOJQJ 5CJ\ 6CJ]5CJOJQJ\ B*CJph CJOJQJ5CJOJQJ5>*CJOJQJ?-.*.R.z.....////////00%0B0D0E0Y0Z0[0}00000"1112131L1M11111111111122e2222222 & F`233)3*3:3W3_3`3t3u3333333440445=5>5W5X5]55 ^``55'666M6i6y6667777777_8888999999990: & F999:X:Y:p:r:w:C;d;r;;;;;;;:<?<======2>K>L>^>~>??O??@I@Z@@@@@"A#ALAzA B*CJ\5CJ jCJOJQJUmHnHu6CJOJQJ] B*CJph5CJOJQJ\ *CJOJQJjCJUmHnHu>*CJOJQJCJ CJOJQJ00:4:8:<:@:D:H:L:P:T:X:Z:[:p:q:r:w:B;C;d;q;r;s;;;;;;;`;;;;;;;;;;;;9<:<?<C=D=w============%>%>1>2>K>L>^>~>>>>>>>>>>????N?O?P???@ @:@I@Z@q@q@@@@@@#ALAzAAA BLWLvLLIMNMMNLNeNfNNNO(OP7P8PVPPPPQQQRR"RTRIJ祡稙Ĩ稙 6CJ]>*CJOJQJ>*CJCJ5CJOJQJ\#jCJOJQJU\mHnHuCJOJQJ\>*CJOJQJ\6CJOJQJ] B*CJph CJOJQJ5CJOJQJ5>*CJOJQJ:EEE F!F6FKFNFOFdFyFFFFFFFFFFFFFFFFGGG H H$HWHnHoHHHHHHH I I5IKI`IvIwIIIIIIIJbJJ"K#K & F#K$K%K&K'K(K)K*K+K,K1KKKL&L=L>LWLXLvLLLLLLLMM!M1M1M2MGMHMIMNMMMNN(NKNLNeNfNNNNNNNOOOO O!O"O#O(O(OOOOOPPP7P8PVPPPPPPPPPYQZQQQQQQQRR`R"RTR_R`RtRuRwRxRyRzR{R|R}R~RRRRRRRRRR5S6SlUmUU`TRRRR5SU V V-V/V}VWWWXoYYYZ[[/[B[`[[[[[^!_"____a0a2aIaawb|bcce(e)e@e{5CJ 5CJ^JCJOJQJ^J>*CJOJQJ^J5CJOJQJ\^J6CJOJQJ]^J B*CJphCJ jCJOJQJUmHnHu>*CJOJQJ6CJOJQJ]5CJOJQJ\5CJOJQJ5>*CJOJQJ CJOJQJ.UUUUUU V V/V}VVVVVW8W[W~WWWWWWX3X4XJXKXLX `LXnYoYpYYYYYZZZZZ[[/[0[B[`[j[u[~[[[[[[[[`[[[[[]]c^d^|^^^^^^^^^!_"_-_p____q`r`s`` & F`````aa1a2aIaaaaab9b`babubvbwb|bcccccccdd"d>d?dee(e)e@eeeee"fGflffffffg)gNgOgdgegfggg@eeffegggjjjkKkllnooo|ppq q!q}qqytzt~ttttyuwXwwwwxxNxxyz￷ֱַ֕zmCJOJQJ^JmH sH CJOJQJ^J>*CJ5CJ5>*CJOJQJjCJUmHnHuCJOJQJ\ B*CJph 5CJ\>*CJOJQJCJ6CJOJQJ]5CJOJQJ\5CJOJQJ jCJOJQJUmHnHu CJOJQJ>*CJOJQJ\*gggjj!j.jEj\jnjjjjjjjjjjkKkrkkkkl5l\lllllllllmmmmmm,n[nxnnnnnnoooo0pHp|pppqqqqq q!q}qqDrrr?sss*tzttttttttttttttttttttttttttttttttttttttttttttyuyuzuwwXwvwwwwwwx yQyxyyyz*CJ>*CJOJQJ6CJOJQJ]CJ5CJOJQJ\5CJOJQJ5>*CJOJQJ CJOJQJCJOJQJ^JmH sH CJOJQJ^J3|-}}}2~~~~~~()܁݁3O͂` ^`]͂΂ՄCijklmnopqrstuv R]R`R]RΆ7pԇ 9:\Έ<`͉̉` ^`͉23; p@  ,:WV׏aߐ Uby{t*_x\cݜԝY쿼ڎ켊켊ڼ>*CJ5>*CJOJQJ jCJOJQJUmHnHuCJOJQJmH sH >*CJOJQJCJ6CJOJQJ] B*CJph5CJOJQJ\5CJOJQJ56CJOJQJ CJOJQJ56CJOJQJ\]4;<VW)7PV֏׏bߐ 7b`=>Uabz{IJstԔ)*_ԕQҖӖ`ӖΗ6DXix\ӚZ`cduܜݜpqӝԝ]^o`XYYZj0F[tңHIĥťƥ̥ͥϥХѥԥե0JmHnHu0J j0JU>*CJ CJOJQJ jCJOJQJ 9:ťѥҥӥԥե&`  !` !#0P/ =!"#$% iH@H Normal5$7$8$9DH$OJQJ_HmH sH tH 8@8 Heading 1$@& CJOJQJ<@< Heading 2$@&5CJOJQJH@H Heading 3$ @&` CJOJQJB@B Heading 4$@&B*CJOJQJphB@B Heading 5$@&B*CJOJQJph@@@ Heading 6$`@&]` CJOJQJJ@J Heading 7$@&`B*CJOJQJph@ Heading 8L$$d%d&d'd@&NOPQB*CJOJQJph @ Heading 9L $$d%d&d'd@&NOPQB*CJOJQJph<A@< Default Paragraph Font, @, Footer  !&)@& Page Number6'@6 Comment ReferenceCJ,@", Comment Text6B@26 Body Text5CJOJQJBP@BB Body Text 2 ]5CJOJQJPP@RP Body Text 20^`0B*CJOJQJphTR@bT Body Text Indent 20^`0 CJOJQJ6Q@r6 Body Text 3 CJOJQJNP@N Body Text 2 >^` CJOJQJHP@H Body Text 2 `B*CJOJQJph<>@< Title$a$5B*CJ$OJQJphա!z!z!z!z!z!z!z!z! z! z! z! z! z z z z z z z z z z z z z z z z z5 !$)-2s7:W?B,G#KNpUZ?`fmp{vUxXա @   9  2):$ %&deVW*YHv345>KLef7Wr  @ A B [ \ k  = >   @ J    |}lm?v'`   !"34  `oLMuvw  ?Njkrst|}' q r !!!!!!!!!!""'">"W"m""""""""#########:#I#k#|#}#~######$$4$L$b$|$}$$$$$$$$$$%%%%%%&&&+&,&-&.&h&i&''8'9'o'~''''''*(N(q(((()#)$)I){)|))))))))))))))***R*z*****++++++++,,%,B,D,E,Y,Z,[,},,,,"-1-2-3-L-M------------..e.......//)/*/:/W/_/`/t/u///////000001=1>1W1X1]111'262M2i2y2223333333_444455555555064686<6@6D6H6L6P6T6X6Z6[6p6q6r6w6B7C7d7q7r7s77777777777777777798:8?8C9D9w999999999999%:1:2:K:L:^:~::::::::::;;?;N;O;P;;;< <:<I<Z<q<<<<<<#=L=z=== ><>o>>>?4?5?J?K?L?M?N?O?P?Q?R?S?T?U?V?W?`?a??????????@@@@ A"A9A:ASATAnAAAAA B!B6BKBNBOBdByBBBBBBBBBBBBBBBBCCC D$DWDnDoDDDDDDD E E5EKE`EvEwEEEEEEEFbFF"G#G$G%G&G'G(G)G*G+G,G1GGGH&H=H>HWHXHvHHHHHHHII!I1I2IGIHIIINIIIJJ(JKJLJeJfJJJJJJJKKKK K!K"K#K(KKKKKLLL7L8LVLLLLLLLLLYMZMMMMMMMNN"NTN_N`NtNuNwNxNyNzN{N|N}N~NNNNNNNNNN5O6OlQmQQQQQQQ R R/R}RRRRRS8S[S~SSSSSST3T4TJTKTLTnUoUpUUUUUVVVVVWW/W0WBW`WjWuW~WWWWWWWWWWWWYYcZdZ|ZZZZZZZZZ!["[-[p[[[[q\r\s\\\\\\]]1]2]I]]]]]^9^`^a^u^v^w^|^_______`"`>`?`aa(a)a@aaaaa"bGblbbbbbbc)cNcOcdcecfcccccff!f.fEf\fnffffffffffgKgrggggh5h\hhhhhhhhiiiiii,j[jxjjjjjjkkkk0lHl|lllmmmm m!m}mmDnnn?ooo*pzpppppppppppppppppppppppppppppppppppppppppppyqzqssXsvsssssst uQuxuuuvUabz{IJstԐ)*_ԑQҒӒΓ6DXix\ӖZcduܘݘpqәԙ]^oXYYZj0F[tҟ9:šѡҡ֡00000000000000000000000000000000000000000000000f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f80f0 0 0 0 0 0 0 00\ 80\ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 h0 0@ 0@ 0@ 0@ 0@ 00 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00000000000000000000000000000000o0o0o0o0o0o0o0o0o0o0o(0o0000000000000o80?0N0N0N0N0N0N0N0N0N 0N 0N 0N0N0N0N0N0N0N0N0N0N0N0N0o0!0!0!0!0!0!0!0!0!0!0!0!0!0!0!0!0!0!0!0!0!80!0:#0:#0:#0:#0:#0:#0o0#000000000|$0|$0|$0|$0|$H0|$0$00$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$80$09'80$0~'0~'0~'0$0'0'0'(0'(0'0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(80(0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0, 0, 0,0,0,0,80,0.0.0.0.0.0.0.0.0.0.0.0.80,0/0/0/0/0/0,0,0,0,0,0,0>10>10>10>10>10>10>10>10>10>10>10>10>10>10>10>10>1 0>1 0>1 0>10>10>10>10>10>10>10>10>10>10,050505050505050505050505050505050505058050C70C70C70C70C70,07070707070707070707070707070707070707070707070700000090909090909090909090909090909090909098090;0;0;0;0;0;0;0;0;0;8090I<0I<0I<0I<0I<090<0<0<0<0<0<h0<0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 > 0 > 0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >0 >80<0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A0"A090D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D 0D 0D 0D 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D80D0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M0M(0D0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0S0Sh0S0V0V0V0V0V0V0V0V0V0V0V0V0V090909090W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W 0W 0W0W0W0W0W00W0W0W0W0W0W0W0W0W090]0]0]0]0]0]0]0]0]0]0]0]0]0]0]0]0]0]00_0_0_0_0_0_0_0_0_0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0_0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f80f0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0gl0_0%0%0%0%0%0%0%0%h0%0000000000000000000000000000000000000h0%0؉0؉0؉0؉00s0s0s0s0s0s0s0s0s0s0s0s0s0s0s0s000000000@0@0@0@0@000000I00000000I00I0I0I0I0I0I0I0I0I0I0I0I0I0I0I0I0000000000000000000000000000000000000000000000000000000000000000000000000000000{#-9KCTR@ezեU[_diov| #'(+-0250:;%>q@SCE H#K1M(ORULX[`dglqtyu|͉͂;ӖեVXYZ\]^`abcefghjklmnpqrstuwxyz{}~ԥWա !@  ))@ (( (  PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB   3 ?"PB   3 ?"PB   3 ?"PB   3 ?" PB   3 ?"PB  3 ?"PB  3 ?"PB  3 ?" PB  3 ?" PB  3 ?"PB  3 ?"PB  3 ?" BB  3 ? PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB  3 ?"PB   3 ?"PB ! 3 ?"!PB " 3 ?" PB # 3 ?"PB $ 3 ?"&PB % 3 ?"%PB & 3 ?"$PB ' 3 ?"#PB ( 3 ?""B S  ?H0(  "")) )!)X67KBLBSSSbbhhzp{p|p}pա m-mt e -e t -tm#mt # tM#Mt]t]t ]t ]ttt]E]t]tu ]u t]]]t]]}tEtEt}E}tt tMMtu ]u t}]}t  - t}-}t-tEt E tEt#]E]t"E EE t!Et(5u5t'-u-t&ut%u uu t$ut^ik{}'1frs| \ c d j " - / ? Q b o |  (t  ")+14@P_vT[]cemouw~1:w"$+-35>dgovWZkn!!!!!!!!!"W"]"""""*#1#3#9#P#\#u#{#####$$L$Q$$$$$$$$$%%%%@'O'Q'X'Z'`'b'n'''''''''''''++++++,#,,,,,-!-M-Y-[-g---...../*/8/////////00 0'0)0/02222 2&2=2I2[2g2223%3,343335555S7c777Q9a9f9v9999::$:L:\:::::;;.;>;|;;<<!<(<*<0<<<<<<<">'>>>>>@@@@@@@@A AA!A,A8ATA`AaAlACCCCCCD DD#D1D@DCDODaDmDDDEEGGGHHH0H]?]H]_______` `!`(`3`n`v```)a5a6a?arczcccdd fff f5fAfOf[fcfmfvffffffffffxiiiiiiiiijj+j1jGjJjZj`jqjjjjjkkkkkklll l%l/l=lGlNlaldl{llllllllllllm!m1m3m?mAmJmSm]m sss$s&s/s1sBsDsMsOsWs]sfs}ssssssssssssssstww)x-xzxxjypyyyz!z}}}~~ ~*~2~V~_~b~k~p~x~{~~~~~~~~~~~~~~~ €ɀˀр͂ӂ܂ !5<TWnuƒ҃ك :EGOP[ "(=H]uw~Ջ ˏӏ{*9:ACIS^bhPX*5ŕƕ֕̕+6ktzvo{+/%1:GO\hu}ßӟޟš֡}  \ ] G P +_wx$56!!##%%''**,,..00 2!2W2[25577K9Q99999::2<9<d<h<<<@@TAYACCDDGGXH^HII0J6JfJlJKK8L>LoMuMMMN N RRpUU0W4W\\2]7])a.affklll!m)mhsssssuu||~~:@"#Дߔ*0ʙ ',<AQVjoş͟ҟš֡:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::5? ?v t}##,,0007777L:~:#=L== >?5?nABBBDwE,G1GHH!I2I#K(KLLuNvNNN}RRRR0WjWWW@abbbhhhhjk*pzpppppwwzz΄>ӒӖZš֡PCB Student LabsA:\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.docPCB Student LabsA:\SQLInstructSu01.docPCB Student LabsD:\Database\SQLInstructSu01.doc%}m;58Im;QUum;WK2ym; 3|m;@hh^h`56CJOJQJo(. @hh^h`.@hh^h`56CJOJQJo(. @h8^8`56CJOJQJo(. @hh^h`56CJOJQJo(. @hh^h`56CJOJQJo(. QUuI%}5858dWK2y 3|d @@hh^h`56.ġ֡@1. Laser Printer ($0.03/Page)\\Mfpcb\.Room 111.Students.MFPCBHPBPCLA1. Laser Printer ($0.03/Page)1. Laser Printer ($0.03/Page)XX1. Laser Printer ($0.03/Page)XXldߟա`@UnknownG:Times New Roman5Symbol3& :Arial;WingdingsO1CourierCourier New"AhVV!VFdTD#xx>0G 2QSQLAuthorized Gateway CustomerPCB Student Labs#O From: "Your Name" Subject: SQLInstructSu01.doc Date: Tue, 26 Jun 2001 12:40:48 -0500 Organization: The University of Oklahoma MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400  Oh+'0 $0 L X d p|SQLQLAuthorized Gateway Customeruthuth Normal.dotGPCB Student Labsy C2B Microsoft Word 9.0C@F#@ f@.A @.A dT ՜.+,0 hp  MFPCB University of Oklahoma D SQL TitleSQL  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Root Entry F@^V 1TableͶWordDocument%SummaryInformation(DocumentSummaryInformation8CompObjjObjectPool@^V @^V   FMicrosoft Word Document MSWordDocWord.Document.89q