CHAPTER 3: QUESTIONS AND ANSWERS

Size: px
Start display at page:

Download "CHAPTER 3: QUESTIONS AND ANSWERS"

Transcription

1 CHAPTER 3: QUESTIONS AND ANSWERS 1 Why do some people pronounce SQL as sequel? Because of its naming history, SQL is developed from SEQUEL language, so some people pronounce SQL as sequel. 2 Why are the manipulation statements of SQL more widely used than the definition and control statements? Because only the database administrator uses the definition and control statements, while power users and analysts, who are the majority, use the manipulation statements. 3 Is the SQL standard supported in whole or in part? Briefly explain. The SQL standard is supported in part. Because of the size of the previous standard SQL-92 (contains more than 600 pages) and the current SQL: 1999 standard (contains more than 2,100 pages), there are multiple levels that can be supported. No vendor supports the entire SQL-92 standard now. Most vendors support a super/subset of the standard. With the new SQL: 1999 standard, vendor implementation will likely be more fragmented because of the size and scope of the standard. 4 How many levels of conformance does the SQL-92 standard have? The SQL-92 specification contained three levels: Entry SQL, Intermediate SQL, and Full SQL. Unfortunately, no vendor claimed conformance beyond Entry SQL although most vendors implemented some features in the higher SQL levels as well as providing proprietary SQL extensions. 5 How many levels of conformance do the SQL: 1999 standard have? The SQL: 1999 standard contains a single level of conformance called Core SQL. At the time of writing of this chapter, no vendor claims conformance to Core SQL although some vendors seem close to conformance. SQL: 1999 contains many features outside of Core SQL grouped into packages. 6 What is standalone SQL? In standalone SQL, the user submits SQL statements with the use of a specialized editor. The editor alerts the user to syntax errors and sends the statements to the DBMS. 7 What is embedded SQL? In the embedded context, an executing program submits SQL statements, and the DBMS sends results back to the program. The program includes SQL statements along with statements of the host programming language such as COBOL or Visual Basic. There are additional statements that allow other SQL statements (such as SELECT) to be used inside a computer program. 8 What is an expression in the context of database languages? An expression is a combination of constants, column names, functions, and operators that produces a value. In conditions and result columns, expressions can be used in any place that column names can appear.

2 9 From examples and discussion in Chapter 3, what parts of SELECT are not supported by all DBMSs? The different parts are pattern-matching characters, case sensitivity in string matching, date constants, the inequality symbol, join operator style, and difference operations. 10 Recite the rule about GROUP BY and HAVING. The GROUP BY clause must contain every column in the Select clause except for aggregate expressions. The HAVING clause must be preceded by the GROUP BY clause. 11 Recite the rule about columns in SELECT when a GROUP BY clause is used. The columns in the SELECT clause must either be in the GROUP BY clause or be part of a summary calculation with an aggregate function. 12 How does a row condition differ from a group condition? A condition in a row (WHERE clause) cannot involve aggregate functions whereas a condition in a group (HAVING clause) involves aggregate functions. 13 Why should row conditions be placed in the WHERE clause rather than the HAVING clause? Often, execution speed will improve if row conditions are tested in the WHERE clause rather than the HAVING clause. In the conceptual evaluation process, testing of conditions in the WHERE clause precedes testing of group conditions in the HAVING clause. The HAVING clause should be used for conditions that can be tested only on groups. 14 Why are most DBMS not case sensitive when matching on string conditions? Because case non-sensitive promotes user-friendliness. 15 Explain how working with sample tables can provide insight about difficult problems. Working with sample tables helps users understand the conceptual evaluation process of SQL statements and visualize the result of a query, so that users can imitate the statement in samples table and apply it to the real problem. 16 When working with date columns, why is it necessary to refer to documentation of your DBMS? Because the date constants are different among DBMS. For example, in Access SQL, pound symbols enclose date constants; while in Oracle SQL, single quotation marks enclose date constants. 17 How do exact and inexact matching differs in SQL? Exact matching is used to find an identical string, but inexact matching supports conditions that match just some part of the string. Along with wildcard characters, inexact matching could be used to find values having a common prefix (or suffix) or

3 match strings containing a substring. Whereas inexact matching uses operators such as LIKE, exact matching uses the equality comparison operator (=). 18 How do you know when the output of a query relates to groups of rows as opposed to individual rows? In a problem statement, you should look for computations involving aggregate functions. For example, the problem list the name and average grade of students contains an aggregate computation. Problems referencing an aggregate function indicate that the output relates to groups of rows. In a SELECT statement, the GROUP BY and HAVING keywords indicate that the output relates to groups of rows rather than individual rows. 19 What tables belong in the FROM statement? The FROM clause should contain all tables that were mentioned in the problem statement. You should match the columns listed in the problem statement with columns from various tables. Include columns that are needed for output as well as for conditions. You also should include tables that are needed only to connect other tables. 20 Explain the cross product style for join operations. The cross product style lists tables in the FROM clause and join conditions in the WHERE clause. 21 Explain the join operator style for join operations. The join operator style lists join operations in the FROM clause using the INNER JOIN and ON keywords. 22 Discuss the pros and cons of the cross product versus the join operator styles. Do you need to know both the cross product and the join operator styles? The cross product style is easy to read but does not support outer join operations. The join operator style can be difficult to read but supports outer join operations. We need to know both, since sometimes we need the query results of outer join operations. 23 What is a self-join? When is a self-join useful? A self-join is a join between a table and itself (two copies of the same table). Selfjoin is useful for finding relationships among rows of the same table. 24 Provide a SELECT statement example in which a table is needed even though the table does not provide conditions to test or columns to show in the result. SELECT Student.* FROM Student, Faculty WHERE StdSSN = FacSSN (This SELECT statement lists students who are the faculty.) 25 What is the requirement when using the traditional set operators in a SELECT statement?

4 Tables must be union compatible (table must have the same number of columns and each corresponding column must have the same data type). 26 When combining joins and grouping, what conceptually occurs first, joins or grouping? Joins always occur before grouping. 27 How many times can grouping occur in a SELECT statement? Grouping can occur only one time. 28 Why is the SELECT statement more widely used than the modification statements INSERT, UPDATE, and DELETE? Because end users can use data entry forms, which are easier than using the modification statements. 29 Provide an example of an INSERT statement that can insert multiple rows. INSERT INTO ISFaculty SELECT * FROM Faculty WHERE FacDept = 'IS' (This INSERT statement adds rows into the ISFaculty table.) 30 What is the relationship between the DELETE statement and the rules about deleting referenced rows? By the referential integrity constraint, the DELETE statement is subject to the actions on referenced rows. A row cannot be deleted if related rows exist and the deletion action is restrict. 31 What is the relationship between the UPDATE statement and the rules about updating the primary key of referenced rows? The UPDATE statement is subject to the actions on updating the primary key of referenced rows. Update rules on referenced rows may not allow the operation when changing the primary key. 32 How does COUNT(*) differ from COUNT(ColumnName)? COUNT(*) computes the number of rows. COUNT(ColumnName) computes the number of non null column values. If a column does not have null values, COUNT(*) and COUNT(ColumnName) are identical. 33 How does COUNT(DISTINCT ColumnName) differ from COUNT(ColumnName)? COUNT(DISTINCT ColumnName) computes the number of unique column values. COUNT(ColumnName) computes the number of non null column values. If a column has unique values such as a primary key or candidate key, COUNT(DISTINCT ColumnName) and COUNT(ColumnName) are identical.

5 PROBLEM SOLUTIONS The problems use the tables of the order entry database, an extension of the order entry tables used in the problems of Chapter 2. In the problem description in the textbook, Table 3P 1 lists the meaning of each table and Figure 3P.1 shows the Access Relationship window. After the relationship diagram, row listings and Oracle CREATE TABLE statements are shown for each table. Note that the primary key of the OrdLine table is a combination of OrdNo and ProdNo. The Employee table has a self-referencing (unary) relationship to itself through the foreign key, SupEmpNo, the employee number of the supervising employee. In the relationship diagram, the table Employee_1 is a representation of the self-referencing relationship, not a real table. The relationship from OrderTbl to OrdLine cascades deletions and primary key updates of referenced rows. All other relationships restrict deletions and primary key updates of referenced rows if related rows exist (NO ACTION). Part 1: SELECT 1. List the customer number, name (first and last), and balance of customers. SELECT CustNo, CustFirstName, CustLastName, CustBal 2. List the customer number, name (first and last), and balance of customers who reside in Colorado (CustState is CO ). SELECT CustNo, CustFirstName, CustLastName, CustBal WHERE CustState = 'CO' 3. List all columns of the Product table for products costing more than $50. Order the result by product manufacturer (ProdMfg) and product name. SELECT * FROM Product WHERE ProdPrice > 50 ORDER BY ProdMfg, ProdName 4. List the order number, order date, and shipping name (OrdName) of orders sent to addresses in Denver or Englewood. The first solution uses the IN comparison operator and the second solution uses the Boolean OR connector. SELECT OrdNo, OrdDate, OrdName FROM OrderTbl WHERE OrdCity IN ('Denver', 'Englewood')

6 SELECT OrdNo, OrdDate, OrdName FROM OrderTbl WHERE OrdCity = 'Denver' OR OrdCity = 'Englewood' 5. List the customer number, name (first and last), city, and balance of customers who reside in Denver with a balance greater than $150 or who reside in Seattle with a balance greater than $300. The parentheses are necessary when mixing the logical AND and OR connectors. SELECT CustNo, CustFirstName, CustLastName, CustCity, CustBal WHERE (CustCity = 'Denver' AND CustBal > 150) OR (CustCity = 'Seattle' AND CustBal > 200) 6. List the cities and states where orders have been placed. Remove duplicates from the result. The DISTINCT keyword eliminates duplicate rows. SELECT DISTINCT OrdCity, OrdState FROM OrderTbl 7. List all columns of the OrderTbl table for Internet orders placed in January An Internet order does not have an associated employee. Two solutions are provided because Access and Oracle have different formats for date constants. SELECT * FROM OrderTbl WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND EmpNo IS NULL SELECT * FROM OrderTbl WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' AND EmpNo IS NULL 8. List all columns of the OrderTbl table for phone orders placed in February A phone order has an associated employee. Two solutions are provided because Access and Oracle have different formats for date constants.

7 SELECT * FROM OrderTbl WHERE OrdDate BETWEEN #2/1/2004# AND #2/29/2004# AND EmpNo IS NOT NULL SELECT * FROM OrderTbl WHERE OrdDate BETWEEN '1-Feb-2004' AND '29-Feb-2004' AND EmpNo IS NOT NULL 9. List all columns of the Product table that contain the words Ink Jet in the product name. The only difference in the Access and Oracle solutions is the wildcard character (* versus %, respectively). In Oracle SQL, because string matching is case sensitive, the constant must match the case of the ProdName value. SELECT * FROM Product WHERE ProdName LIKE '*Ink Jet*' SELECT * FROM Product WHERE ProdName LIKE '%Ink Jet%' 10. List the order number, order date, and customer number of orders placed after January 23, 2004, that are shipped to Washington recipients. The only difference in the Access and Oracle solutions is representation of date constants. SELECT OrdNo, OrdDate, CustNo FROM OrderTbl WHERE OrdState = 'WA' AND OrdDate > #1/23/2004# SELECT OrdNo, OrdDate, CustNo FROM OrderTbl WHERE OrdState = 'WA' AND OrdDate > '23-Jan-2004' 11. List the order number, order date, customer number, and customer name (first and last) of orders placed in January 2004 sent to Colorado recipients.

8 The only difference in the Access and Oracle solutions is the format of date constants. SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName FROM OrderTbl, Customer WHERE OrdState = 'CO' AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND OrderTbl.CustNo = Customer.CustNo Oracle solution: SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName FROM OrderTbl, Customer WHERE OrdState = 'CO' AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan- 2004' AND OrderTbl.CustNo = Customer.CustNo Access solution with an INNER JOIN operation: SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName FROM OrderTbl INNER JOIN Customer ON OrderTbl.CustNo = Customer.CustNo WHERE OrdState = 'CO' AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004# Oracle 9i solution with an INNER JOIN operation: SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName FROM OrderTbl INNER JOIN Customer ON OrderTbl.CustNo = Customer.CustNo WHERE OrdState = 'CO' AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan- 2004' 12. List the order number, order date, customer number, and customer name (first and last) of orders placed in January 2004 placed by Colorado customers (CustState) but sent to Washington recipients (OrdState). The only difference in the Access and Oracle solutions is the format of date constants. SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName FROM OrderTbl, Customer WHERE OrdState = 'WA' AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND OrderTbl.CustNo = Customer.CustNo AND CustState = 'CO' SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName FROM OrderTbl, Customer

9 WHERE OrdState = 'WA' AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan- 2004' AND OrderTbl.CustNo = Customer.CustNo AND CustState = 'CO' 13. List the customer number, name (first and last), and balance of Washington customers who have placed one or more orders in February Remove duplicate rows from the result. The only difference in the Access and Oracle solutions is the format of date constants. The DISTINCT keyword is necessary because a customer can place multiple orders in February SELECT DISTINCT Customer.CustNo, CustFirstName, CustLastName, CustBal FROM OrderTbl, Customer WHERE CustState = 'WA' AND OrdDate BETWEEN #2/1/2004# AND #2/29/2004# AND OrderTbl.CustNo = Customer.CustNo SELECT DISTINCT Customer.CustNo, CustFirstName, CustLastName, CustBal FROM OrderTbl, Customer WHERE CustState = 'WA' AND OrdDate BETWEEN '1-Feb-2004' AND '29-Feb- 2004' AND OrderTbl.CustNo = Customer.CustNo 14. List the order number, order date, customer number, customer name (first and last), employee number, and employee name (first and last) of January 2004 orders placed by Colorado customers. The only difference in the Access and Oracle solutions is the format of date constants. SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM OrderTbl, Customer, Employee WHERE CustState = 'CO' AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND OrderTbl.CustNo = Customer.CustNo AND OrderTbl.EmpNo = Employee.EmpNo SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM OrderTbl, Customer, Employee WHERE CustState = 'CO' AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan- 2004'

10 AND OrderTbl.CustNo = Customer.CustNo AND OrderTbl.EmpNo = Employee.EmpNo Access SQL solution with INNER JOIN operations: SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM ( OrderTbl INNER JOIN Customer ON OrderTbl.CustNo = Customer.CustNo ) INNER JOIN Employee ON OrderTbl.EmpNo = Employee.EmpNo WHERE CustState = 'CO' AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004# Oracle 9i SQL solution with INNER JOIN operations: SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM ( OrderTbl INNER JOIN Customer ON OrderTbl.CustNo = Customer.CustNo ) INNER JOIN Employee ON OrderTbl.EmpNo = Employee.EmpNo WHERE CustState = 'CO' AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan- 2004' 15. List the employee number, name (first and last), and phone of employees who have taken orders in January 2004 from customers with balances greater than $300. Remove duplicate rows in the result. The only difference in the Access and Oracle solutions is the format of date constants. The DISTINCT keyword is necessary because an employee can take multiple orders. SELECT DISTINCT Employee.EmpNo, EmpFirstName, EmpLastName, EmpPhone FROM OrderTbl, Customer, Employee WHERE CustBal > 300 AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND OrderTbl.CustNo = Customer.CustNo AND OrderTbl.EmpNo = Employee.EmpNo SELECT DISTINCT Employee.EmpNo, EmpFirstName, EmpLastName, EmpPhone FROM OrderTbl, Customer, Employee WHERE CustBal > 300 AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan- 2004' AND OrderTbl.CustNo = Customer.CustNo AND OrderTbl.EmpNo = Employee.EmpNo

11 16. List the product number, name, and price of products ordered by customer number C in January Remove duplicate products in the result. The only difference in the Access and Oracle solutions is the format of date constants. The DISTINCT keyword is required because a customer may order the same product across orders. SELECT DISTINCT Product.ProdNo, ProdName, ProdPrice FROM OrderTbl, OrdLine, Product WHERE CustNo = 'C ' AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004# SELECT DISTINCT Product.ProdNo, ProdName, ProdPrice FROM OrderTbl, OrdLine, Product WHERE CustNo = 'C ' AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' 17. List the customer number, name (first and last), order number, order date, employee number, employee name (first and last), product number, product name, and order cost (OrdLine.Qty * ProdPrice) for products ordered on January 23, 2004, in which the order cost exceeds $150. The only difference in the Access and Oracle solutions is the format of date constants. The join operator style can also be used with Access SQL. SELECT Customer.CustNo, CustFirstName, CustLastName, OrderTbl.OrdNo, OrdDate, Employee.EmpNo, EmpFirstName, EmpLastName, Product.ProdNo, ProdName, ProdPrice*Qty AS OrderCost FROM OrderTbl, OrdLine, Product, Customer, Employee WHERE OrdDate = #1/23/2004# AND ProdPrice*Qty > 150 AND OrderTbl.CustNo = Customer.CustNo AND Employee.EmpNo = OrderTbl.EmpNo SELECT Customer.CustNo, CustFirstName, CustLastName, OrderTbl.OrdNo, OrdDate, Employee.EmpNo, EmpFirstName, EmpLastName, Product.ProdNo, ProdName, ProdPrice*Qty AS OrderCost FROM OrderTbl, OrdLine, Product, Customer, Employee WHERE OrdDate = '23-Jan-2004' AND ProdPrice*Qty > 150

12 AND OrderTbl.CustNo = Customer.CustNo AND Employee.EmpNo = OrderTbl.EmpNo 18. List the average balance of customers by city. Only include customers residing in Washington state ( WA ). SELECT CustCity, AVG(CustBal) AS AvgBal WHERE CustState = 'WA' GROUP BY CustCity 19. List the average balance of customers by city and short zip code (the first five digits of the zip code). Only include customers residing in Washington state ( WA ). In Microsoft Access, the expression left (CustZip, 5) returns the first five digits of the zip code. In Oracle, the expression substr (CustZip, 1, 5) returns the first five digits. The Access and Oracle solutions use different functions to extract the first five digits of the zip code. SELECT CustCity, left(custzip, 5) AS ShortZip, AVG(CustBal) AS AvgBal WHERE CustState = 'WA' GROUP BY CustCity, Left(CustZip, 5) SELECT CustCity, substr(custzip, 1, 5) AS ShortZip, AVG(CustBal) AS AvgBal WHERE CustState = 'WA' GROUP BY CustCity, substr(custzip, 1, 5) 20. List the average balance and number of customers by city. Only include customers residing in Washington state ( WA ). Eliminate cities in the result with less than two customers. The HAVING clause is necessary to eliminate cities with only one customer. SELECT CustCity, AVG(CustBal) AS AvgBal, COUNT(*) AS NumCustomers WHERE CustState = 'WA' GROUP BY CustCity HAVING COUNT(*) > 1

13 21. List the number of unique short zip codes and average customer balance by city. Only include customers residing in Washington state ( WA ). Eliminate cities in the result in which the average balance is less than $100. In Microsoft Access, the expression left (CustZip, 5) returns the first five digits of the zip code. In Oracle, the expression substr (CustZip, 1, 5) returns the first five digits. (Note: this problem requires two SELECT statements in Access SQL or a nested query in the FROM clause see Chapter 9.) The solution cannot be directly performed in Microsoft Access because DISTINCT cannot be used inside of aggregate functions. However, the same result can be produced in Access by using two SELECT statements as shown below. SELECT CustCity, COUNT(DISTINCT substr(custzip, 1, 5)) AS NumShortZips, AVG(CustBal) AS AvgBal WHERE CustState = 'WA' GROUP BY CustCity HAVING AVG(CustBal) > 100 the second SELECT statement should be saved as a query with the name Temp3_21. SELECT CustCity, COUNT(*) AS NumShortZips, AVG(CustBal) AS AvgCustBal FROM Temp3_21 GROUP BY CustCity HAVING AVG(CustBal) >= 100; Temp3_21: SELECT DISTINCT CustCity, left(custzip, 5) AS CustShortZip, CustBal WHERE CustState = 'WA'; 22. List the order number and the total amount of the order for orders on January 23, The total amount of an order is the sum of the quantity times the product price for each product on the order. The Product table is necessary because the ProdPrice column is needed in the aggregate expression. The solutions differ by the format of date constants. Access SQL Solution SELECT OrderTbl.OrdNo, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product WHERE OrdDate = #1/23/2004# GROUP BY OrderTbl.OrdNo

14 Oracle SQL Solution SELECT OrderTbl.OrdNo, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product WHERE OrdDate = '23-Jan-2004' GROUP BY OrderTbl.OrdNo 23. List the order number, order date, customer name (first and last), and total amount of the order for orders on January 23, The total amount of an order is the sum of the quantity times the product price for each product on the order. The OrdDate, CustFirstName, and CustLastName columns must be included in the GROUP BY clause because every column in SELECT that is not an aggregate expression must appear in the GROUP BY clause. The solutions differ by the format of date constants. Access SQL Solution SELECT OrderTbl.OrdNo, OrdDate, CustFirstName, CustLastName, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product, Customer WHERE OrdDate = #1/23/2004# AND Customer.CustNo = OrderTbl.CustNo GROUP BY OrderTbl.OrdNo, OrdDate, CustFirstName, CustLastName Oracle SQL Solution SELECT OrderTbl.OrdNo, OrdDate, CustFirstName, CustLastName, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product, Customer WHERE OrdDate = '23-Jan-2004' AND Customer.CustNo = OrderTbl.CustNo GROUP BY OrderTbl.OrdNo, OrdDate, CustFirstName, CustLastName 24. List the customer number, customer name (first and last), the sum of the quantity of products ordered, and the total amount of products ordered in January Only include products in which the product name contains the string Ink Jet or Laser. Include only customers who have ordered more than two Ink Jet or Laser products in January The HAVING clause is necessary to eliminate customers with two or less products ordered. Access SQL Solution

15 SELECT Customer.CustNo, CustFirstName, CustLastName, SUM(Qty) AS ProdQty, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product, Customer WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND Customer.CustNo = OrderTbl.CustNo AND (ProdName LIKE '*Ink Jet*' OR ProdName LIKE '*Laser*') GROUP BY Customer.CustNo, CustFirstName, CustLastName HAVING SUM(Qty) > 2 Oracle SQL Solution SELECT Customer.CustNo, CustFirstName, CustLastName, SUM(Qty) AS ProdQty, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product, Customer WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' AND Customer.CustNo = OrderTbl.CustNo AND (ProdName LIKE '%Ink Jet%' OR ProdName LIKE '%Laser%') GROUP BY Customer.CustNo, CustFirstName, CustLastName HAVING SUM(Qty) > List the product number, product name, sum of the quantity of products ordered, and total order amount (sum of the product price times the quantity) for orders placed in January Only include products that have more than five products ordered in January Sort the result by descending total amount. The HAVING clause is necessary to eliminate products with five or less products ordered. In the ORDER BY clause, the column number (3) can be used in place of the aggregate expression. Access SQL Solution SELECT Product.ProdNo, ProdName, SUM(Qty) AS ProdQty, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# GROUP BY Product.ProdNo, ProdName HAVING SUM(Qty) > 5 ORDER BY SUM(Qty*ProdPrice) DESC Oracle SQL Solution SELECT Product.ProdNo, ProdName, SUM(Qty) AS ProdQty, SUM(Qty*ProdPrice) AS TotOrdAmt FROM OrderTbl, OrdLine, Product

16 WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' GROUP BY Product.ProdNo, ProdName HAVING SUM(Qty) > 5 ORDER BY SUM(Qty*ProdPrice) DESC 26. List the order number, order date, customer number, customer name (first and last), customer state, and shipping state (OrdState) in which the customer state differs from the shipping state. The not equality comparison (<>) ensures that the customer and shipping state are different. SELECT OrdNo, OrdDate, OrdState, Customer.CustNo, CustFirstName, CustLastName, CustState FROM OrderTbl, Customer WHERE OrdState <> CustState AND OrderTbl.CustNo = Customer.CustNo 27. List the employee number, employee name (first and last), commission rate, supervising employee name (first and last), and commission rate of the supervisor. The table alias names are necessary to distinguish the copies of the Employee table. SELECT E.EmpNo, E.EmpFirstName, E.EmpLastName, E.EmpCommRate, Supr.EmpFirstName, Supr.EmpLastName, Supr.EmpCommRate FROM Employee E, Employee Supr WHERE E.SupEmpNo = Supr.EmpNo 28. List the employee number, employee name (first and last), and total amount of commissions on orders taken in January The amount of a commission is the sum of the dollar amount of products ordered times the commission rate of the employee. The two solutions differ because of the date formats. Access SQL Solution SELECT Employee.EmpNo, EmpFirstName, EmpLastName, SUM(EmpCommRate*Qty*ProdPrice) AS TotCommAmt FROM Employee, OrderTbl, OrdLine, Product WHERE OrderTbl.EmpNo = Employee.EmpNo AND OrdDate BETWEEN #1/1/2004# AND #1/31/2004#

17 GROUP BY Employee.EmpNo, EmpFirstName, EmpLastName Oracle SQL Solution SELECT Employee.EmpNo, EmpFirstName, EmpLastName, SUM(EmpCommRate*Qty*ProdPrice) AS TotCommAmt FROM Employee, OrderTbl, OrdLine, Product WHERE OrderTbl.EmpNo = Employee.EmpNo AND OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' GROUP BY Employee.EmpNo, EmpFirstName, EmpLastName 29. List the union of the name, street, city, state, and zip of customers and order recipients. You need to use the concatenation function to combine the first and last names so that they can be compared to the order recipient name. In Access SQL, the & symbol is the concatenation function. In Oracle SQL, the symbol is the concatenation function. The two solutions differ because of the concatenation function. The columns have been renamed so that the result table has meaningful column names. Access SQL Solution SELECT CustFirstName & ' ' & CustLastName AS PersonName, CustStreet AS Street, CustCity AS City, CustState AS State, CustZip AS Zip UNION SELECT OrdName AS PersonName, OrdStreet AS Street, OrdCity AS City, OrdState AS State, OrdZip AS Zip FROM OrderTbl Oracle SQL Solution SELECT CustFirstName ' ' CustLastName AS PersonName, CustStreet AS Street, CustCity AS City, CustState AS State, CustZip AS Zip UNION SELECT OrdName AS PersonName, OrdStreet AS Street, OrdCity AS City, OrdState AS State, OrdZip AS Zip FROM OrderTbl 30. List the first and last name of customers who have the same name (first and last) as an employee. This problem can be formulated with a join or intersection operation. Join formulation (Access and Oracle) SELECT CustFirstName, CustLastName

18 , Employee WHERE CustFirstName = EmpFirstName AND CustLastName = EmpLastName Intersection formulation (Oracle) SELECT CustFirstName AS FirstName, CustLastName AS LastName INTERSECT SELECT EmpFirstName AS FirstName, EmpLastName AS LastName FROM Employee 31. List the employee number and name (first and last) of second-level subordinates (subordinates of subordinates) of the employee named Thomas Johnson. This problem requires two self-joins of the Employee table. The table alias E represents the supervising employee. The table alias Subr1 represents the first level subordinates. The table alias Subr2 represents the second level subordinates. SELECT Subr2.EmpNo, Subr2.EmpFirstName, Subr2.EmpLastName FROM Employee E, Employee Subr1, Employee Subr2 WHERE Subr1.EmpNo = Subr2.SupEmpNo AND Subr1.SupEmpNo = E.EmpNo AND E.EmpFirstName = 'Thomas' AND E.EmpLastName = 'Johnson' 32. List the employee number and name (first and last) of the first- and second-level subordinates of the employee named Thomas Johnson. To distinguish the level of subordinates, include a computed column with subordinate level (1 or 2). This problem requires a union operation to combine the first level and second level subordinates. In each SELECT statement, the SubLevel column indicates the level. SELECT Subr1.EmpNo, Subr1.EmpFirstName, Subr1.EmpLastName, 1 AS SubLevel FROM Employee E, Employee Subr1 WHERE Subr1.SupEmpNo = E.EmpNo AND E.EmpFirstName = 'Thomas' AND E.EmpLastName = 'Johnson' UNION SELECT Subr2.EmpNo, Subr2.EmpFirstName, Subr2.EmpLastName, 2 AS SubLevel FROM Employee E, Employee Subr1, Employee Subr2 WHERE Subr1.EmpNo = Subr2.SupEmpNo AND Subr1.SupEmpNo = E.EmpNo AND E.EmpFirstName = 'Thomas' AND E.EmpLastName = 'Johnson' 33. Using a mix of the join operator and the cross product styles, list the names (first and last) of customers who have placed orders taken by Amy Tang. Remove duplicate rows in the result. Note that Oracle 8i does not support the join operator style, but Oracle 9i does support the style.

19 This statement does not execute in Oracle 8i SQL because Oracle 8i does not support the join operator style. SELECT DISTINCT CustFirstName, CustLastName FROM Employee INNER JOIN OrderTbl ON Employee.EmpNo = OrderTbl.EmpNo, Customer WHERE Customer.CustNo = OrderTbl.CustNo AND EmpFirstName = 'Amy' AND EmpLastName = 'Tang' 34. Using the join operator style, list the product name and the price of all products ordered by Beth Taylor in January Remove duplicate rows from the result. This statement does not execute in Oracle SQL because Oracle SQL does not support the join operator style. Access SQL Solution SELECT DISTINCT ProdName, ProdPrice FROM ( ( OrdLine INNER JOIN OrderTbl ON OrdLine.OrdNo = OrderTbl.OrdNo ) INNER JOIN Customer ON Customer.CustNo = OrderTbl.CustNo ) INNER JOIN Product ON OrdLine.ProdNo = Product.ProdNo WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND CustFirstName = 'Beth' AND CustLastName = 'Taylor' Oracle 9i SQL Solution SELECT DISTINCT ProdName, ProdPrice FROM ( ( OrdLine INNER JOIN OrderTbl ON OrdLine.OrdNo = OrderTbl.OrdNo ) INNER JOIN Customer ON Customer.CustNo = OrderTbl.CustNo ) INNER JOIN Product ON OrdLine.ProdNo = Product.ProdNo WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' AND CustFirstName = 'Beth' AND CustLastName = 'Taylor' 35. For Colorado customers, compute the number of orders placed in January The result should include the customer number, the last name, and the number of orders placed in January Access SQL Solution SELECT Customer.CustNo, CustLastName, COUNT(*) AS NumOrders FROM OrderTbl, Customer WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND Customer.CustNo = OrderTbl.CustNo GROUP BY Customer.CustNo, CustLastName Oracle SQL Solution SELECT Customer.CustNo, CustLastName, COUNT(*) AS NumOrders

20 FROM OrderTbl, Customer WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' AND Customer.CustNo = OrderTbl.CustNo GROUP BY Customer.CustNo, CustLastName 36. For Colorado customers, compute the number of orders placed in January 2004 in which the orders contain products made by Connex. The result should include the customer number, the last name, and the number of orders placed in January Access SQL Solution SELECT Customer.CustNo, CustLastName, COUNT(*) AS NumOrders FROM OrderTbl, Customer, OrdLine, Product WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND Customer.CustNo = OrderTbl.CustNo AND ProdMfg = 'Connex' GROUP BY Customer.CustNo, CustLastName Oracle SQL Solution SELECT Customer.CustNo, CustLastName, COUNT(*) AS NumOrders FROM OrderTbl, Customer, OrdLine, Product WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' AND Customer.CustNo = OrderTbl.CustNo AND ProdMfg = 'Connex' GROUP BY Customer.CustNo, CustLastName 37. For each employee with a commission rate of less than 0.04, compute the number of orders taken in January The result should include the employee number, the employee last name, and the number of orders taken. Access SQL Solution SELECT Employee.EmpNo, EmpLastName, COUNT(*) AS NumOrders FROM OrderTbl, Employee WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND Employee.EmpNo = Employee.EmpNo AND EmpCommRate < 0.04 GROUP BY Employee.EmpNo, EmpLastName

21 Oracle SQL Solution SELECT Employee.EmpNo, EmpLastName, COUNT(*) AS NumOrders FROM OrderTbl, Employee WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' AND Employee.EmpNo = Employee.EmpNo AND EmpCommRate < 0.04 GROUP BY Employee.EmpNo, EmpLastName 38. For each employee with a commission rate of greater than 0.03, compute the total commission earned from orders taken in January The total commission earned is the total order amount times the commission rate. The result should include the employee number, the employee last name, and the total commission earned. Access SQL Solution SELECT Employee.EmpNo, EmpLastName, SUM(EmpCommRate * Qty * ProdPrice) AS TotCommEarned FROM OrderTbl, Employee, OrdLine, Product WHERE OrdDate BETWEEN #1/1/2004# AND #1/31/2004# AND Employee.EmpNo = Employee.EmpNo AND EmpCommRate > 0.03 GROUP BY Employee.EmpNo, EmpLastName Oracle SQL Solution SELECT Employee.EmpNo, EmpLastName, SUM(EmpCommRate * Qty * ProdPrice) AS TotCommEarned FROM OrderTbl, Employee, OrdLine, Product WHERE OrdDate BETWEEN '1-Jan-2004' AND '31-Jan-2004' AND Employee.EmpNo = Employee.EmpNo AND EmpCommRate > 0.03 GROUP BY Employee.EmpNo, EmpLastName Part 2: INSERT, UPDATE, and DELETE statements 1. Insert yourself as a new row in the Customer table. INSERT INTO Customer (CustNo, CustFirstName, CustLastName, CustStreet, CustCity, CustState, CustZip, CustBal) VALUES ('C ', 'Michael', 'Mannino', '123 Any Street', 'MyTown', 'CO',

22 ' ', 500) 2. Insert your roommate, best friend, or significant other as a new row in the Employee table. INSERT INTO Employee ( EmpNo, EmpFirstName, EmpLastName, EmpPhone, EmpCommRate) VALUES ('E ', 'Mary', 'Mannino', '(720) ', 0.04) 3. Insert a new OrderTbl row with you as the customer, the person from Problem 2 (Part 2) as the employee, and your choice of values for the other columns of the OrderTbl table. Access SQL: INSERT INTO OrderTbl ( OrdNo, OrdDate, CustNo, EmpNo, OrdName, OrdStreet, OrdCity, OrdState, OrdZip) VALUES ('O ', #1/27/2000#, 'C ', 'E ', 'Mary Mannino', '123 Any Street', 'MyTown', 'CO', ' ') Oracle SQL: INSERT INTO OrderTbl ( OrdNo, OrdDate, CustNo, EmpNo, OrdName, OrdStreet, OrdCity, OrdState, OrdZip) VALUES ('O ', '27-Jan-2000', 'C ', 'E ', 'Mary Mannino', '123 Any Street', 'MyTown', 'CO', ' ') 4. Insert two rows in the OrdLine table corresponding to the OrderTbl row inserted in Problem 3 (Part 2). INSERT INTO OrdLine (OrdNo, ProdNo, Qty) VALUES ('O ', 'P ', 2) INSERT INTO OrdLine (OrdNo, ProdNo, Qty) VALUES ('O ', 'P ', 2) 5. Increase the price by 10 percent of products containing the words Ink Jet. Access SQL: UPDATE Product SET ProdPrice = ProdPrice * 1.1 WHERE ProdName LIKE '*Ink Jet*'

23 Oracle SQL: UPDATE Product SET ProdPrice = ProdPrice * 1.1 WHERE ProdName LIKE '%Ink Jet%' 6. Change the address (street, city, and zip) of the new row inserted in Problem 1 (Part 2). UPDATE Customer SET CustStreet = '123 AnyNew Street', CustCity = 'MyNewTown', CustZip = ' ' WHERE CustNo = 'C ' 7. Identify an order that respects the rules about deleting referenced rows to delete the rows inserted in Problems 1 to 4 (Part 2)? The new OrderTbl row must be deleted first. Because deletes cascade from OrderTbl to OrdLine, separate DELETE statements are not necessary for the new rows of the OrdLine table. After deleting the new OrderTbl row, the order does not matter for deleting the new Customer and Employee rows. 8. Delete the new row(s) of the table listed first in the order for Problem 7 (Part 2). This DELETE statement deletes the new OrderTbl row along with the related OrdLine rows. DELETE FROM OrderTbl WHERE OrdNo = 'O ' 9. Delete the new row(s) of the table listed second in the order for Problem 7 (Part 2). DELETE WHERE CustNo = 'C ' 10. Delete the new row(s) of the remaining tables listed in the order for Problem 7 (Part 2). DELETE FROM Employee WHERE EmpNo = 'E '

Full file at

Full file at David Kroenke's Database Processing: Fundamentals, Design and Implementation (10 th Edition) CHAPTER TWO INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) True-False Questions 1. SQL stands for Standard

More information

Test Bank for Database Processing Fundamentals Design and Implementation 13th Edition by Kroenke

Test Bank for Database Processing Fundamentals Design and Implementation 13th Edition by Kroenke Test Bank for Database Processing Fundamentals Design and Implementation 13th Edition by Kroenke Link full download: https://testbankservice.com/download/test-bank-fordatabase-processing-fundamentals-design-and-implementation-13th-edition-bykroenke

More information

2) SQL includes a data definition language, a data manipulation language, and SQL/Persistent stored modules. Answer: TRUE Diff: 2 Page Ref: 36

2) SQL includes a data definition language, a data manipulation language, and SQL/Persistent stored modules. Answer: TRUE Diff: 2 Page Ref: 36 Database Processing, 12e (Kroenke/Auer) Chapter 2: Introduction to Structured Query Language (SQL) 1) SQL stands for Standard Query Language. Diff: 1 Page Ref: 32 2) SQL includes a data definition language,

More information

LECTURE10: DATA MANIPULATION IN SQL, ADVANCED SQL QUERIES

LECTURE10: DATA MANIPULATION IN SQL, ADVANCED SQL QUERIES LECTURE10: DATA MANIPULATION IN SQL, ADVANCED SQL QUERIES Ref. Chapter5 From Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. 1 IS220: D a

More information

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel 1 In this chapter, you will learn: The basic commands

More information

Language. f SQL. Larry Rockoff COURSE TECHNOLOGY. Kingdom United States. Course Technology PTR. A part ofcenqaqe Learninq

Language. f SQL. Larry Rockoff COURSE TECHNOLOGY. Kingdom United States. Course Technology PTR. A part ofcenqaqe Learninq Language f SQL Larry Rockoff Course Technology PTR A part ofcenqaqe Learninq *, COURSE TECHNOLOGY!» CENGAGE Learning- Australia Brazil Japan Korea Mexico Singapore Spain United Kingdom United States '

More information

You can write a command to retrieve specified columns and all rows from a table, as illustrated

You can write a command to retrieve specified columns and all rows from a table, as illustrated CHAPTER 4 S I N G L E - TA BL E QUERIES LEARNING OBJECTIVES Objectives Retrieve data from a database using SQL commands Use simple and compound conditions in queries Use the BETWEEN, LIKE, and IN operators

More information

Handout 9 CS-605 Spring 18 Page 1 of 8. Handout 9. SQL Select -- Multi Table Queries. Joins and Nested Subqueries.

Handout 9 CS-605 Spring 18 Page 1 of 8. Handout 9. SQL Select -- Multi Table Queries. Joins and Nested Subqueries. Handout 9 CS-605 Spring 18 Page 1 of 8 Handout 9 SQL Select -- Multi Table Queries. Joins and Nested Subqueries. Joins In Oracle https://docs.oracle.com/cd/b19306_01/server.102/b14200/queries006.htm Many

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL)

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management Tenth Edition Chapter 7 Introduction to Structured Query Language (SQL) Objectives In this chapter, students will learn: The basic commands and

More information

Querying Data with Transact SQL

Querying Data with Transact SQL Course 20761A: Querying Data with Transact SQL Course details Course Outline Module 1: Introduction to Microsoft SQL Server 2016 This module introduces SQL Server, the versions of SQL Server, including

More information

CSC Web Programming. Introduction to SQL

CSC Web Programming. Introduction to SQL CSC 242 - Web Programming Introduction to SQL SQL Statements Data Definition Language CREATE ALTER DROP Data Manipulation Language INSERT UPDATE DELETE Data Query Language SELECT SQL statements end with

More information

Lecture10: Data Manipulation in SQL, Advanced SQL queries

Lecture10: Data Manipulation in SQL, Advanced SQL queries IS220 / IS422 : Database Fundamentals : Data Manipulation in SQL, Advanced SQL queries Ref. Chapter5 Prepared by L. Nouf Almujally & Aisha AlArfaj College of Computer and Information Sciences - Information

More information

SIT772 Database and Information Retrieval WEEK 6. RELATIONAL ALGEBRAS. The foundation of good database design

SIT772 Database and Information Retrieval WEEK 6. RELATIONAL ALGEBRAS. The foundation of good database design SIT772 Database and Information Retrieval WEEK 6. RELATIONAL ALGEBRAS The foundation of good database design Outline 1. Relational Algebra 2. Join 3. Updating/ Copy Table or Parts of Rows 4. Views (Virtual

More information

chapter 2 G ETTING I NFORMATION FROM A TABLE

chapter 2 G ETTING I NFORMATION FROM A TABLE chapter 2 Chapter G ETTING I NFORMATION FROM A TABLE This chapter explains the basic technique for getting the information you want from a table when you do not want to make any changes to the data and

More information

Oracle Syllabus Course code-r10605 SQL

Oracle Syllabus Course code-r10605 SQL Oracle Syllabus Course code-r10605 SQL Writing Basic SQL SELECT Statements Basic SELECT Statement Selecting All Columns Selecting Specific Columns Writing SQL Statements Column Heading Defaults Arithmetic

More information

12. MS Access Tables, Relationships, and Queries

12. MS Access Tables, Relationships, and Queries 12. MS Access Tables, Relationships, and Queries 12.1 Creating Tables and Relationships Suppose we want to build a database to hold the information for computers (also refer to parts in the text) and suppliers

More information

Unit Assessment Guide

Unit Assessment Guide Unit Assessment Guide Unit Details Unit code Unit name Unit purpose/application ICTWEB425 Apply structured query language to extract and manipulate data This unit describes the skills and knowledge required

More information

Relational Database Management Systems for Epidemiologists: SQL Part I

Relational Database Management Systems for Epidemiologists: SQL Part I Relational Database Management Systems for Epidemiologists: SQL Part I Outline SQL Basics Retrieving Data from a Table Operators and Functions What is SQL? SQL is the standard programming language to create,

More information

Intermediate SQL: Aggregated Data, Joins and Set Operators

Intermediate SQL: Aggregated Data, Joins and Set Operators Intermediate SQL: Aggregated Data, Joins and Set Operators Aggregated Data and Sorting Objectives After completing this lesson, you should be able to do the following: Identify the available group functions

More information

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement GIFT Department of Computing Science [Spring 2013] CS-217: Database Systems Lab-2 Manual Data Selection and Filtering using the SELECT Statement V1.0 4/12/2016 Introduction to Lab-2 This lab reinforces

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 2-1 Objectives This lesson covers the following objectives: Apply the concatenation operator to link columns to other columns, arithmetic expressions, or constant values to

More information

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables

INDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables INDEX Exercise No Title 1 Basic SQL Statements 2 Restricting and Sorting Data 3 Single Row Functions 4 Displaying data from multiple tables 5 Creating and Managing Tables 6 Including Constraints 7 Manipulating

More information

SQL functions fit into two broad categories: Data definition language Data manipulation language

SQL functions fit into two broad categories: Data definition language Data manipulation language Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 7 Beginning Structured Query Language (SQL) MDM NUR RAZIA BINTI MOHD SURADI 019-3932846 razia@unisel.edu.my

More information

Join, Sub queries and set operators

Join, Sub queries and set operators Join, Sub queries and set operators Obtaining Data from Multiple Tables EMPLOYEES DEPARTMENTS Cartesian Products A Cartesian product is formed when: A join condition is omitted A join condition is invalid

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL

More information

tablename ORDER BY column ASC tablename ORDER BY column DESC sortingorder, } The WHERE and ORDER BY clauses can be combined in one

tablename ORDER BY column ASC tablename ORDER BY column DESC sortingorder, } The WHERE and ORDER BY clauses can be combined in one } The result of a query can be sorted in ascending or descending order using the optional ORDER BY clause. The simplest form of an ORDER BY clause is SELECT columnname1, columnname2, FROM tablename ORDER

More information

A subquery is a nested query inserted inside a large query Generally occurs with select, from, where Also known as inner query or inner select,

A subquery is a nested query inserted inside a large query Generally occurs with select, from, where Also known as inner query or inner select, Sub queries A subquery is a nested query inserted inside a large query Generally occurs with select, from, where Also known as inner query or inner select, Result of the inner query is passed to the main

More information

CS6302 DBMS 2MARK & 16 MARK UNIT II SQL & QUERY ORTIMIZATION 1. Define Aggregate Functions in SQL? Aggregate function are functions that take a collection of values as input and return a single value.

More information

Getting Information from a Table

Getting Information from a Table ch02.fm Page 45 Wednesday, April 14, 1999 2:44 PM Chapter 2 Getting Information from a Table This chapter explains the basic technique of getting the information you want from a table when you do not want

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 10-4 Objectives This lesson covers the following objectives: Identify when correlated subqueries are needed. Construct and execute correlated subqueries. Construct and execute

More information

1 Writing Basic SQL SELECT Statements 2 Restricting and Sorting Data

1 Writing Basic SQL SELECT Statements 2 Restricting and Sorting Data 1 Writing Basic SQL SELECT Statements Objectives 1-2 Capabilities of SQL SELECT Statements 1-3 Basic SELECT Statement 1-4 Selecting All Columns 1-5 Selecting Specific Columns 1-6 Writing SQL Statements

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL ORACLE UNIVERSITY CONTACT US: 00 9714 390 9000 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database

More information

SQL QUERIES. CS121: Relational Databases Fall 2017 Lecture 5

SQL QUERIES. CS121: Relational Databases Fall 2017 Lecture 5 SQL QUERIES CS121: Relational Databases Fall 2017 Lecture 5 SQL Queries 2 SQL queries use the SELECT statement General form is: SELECT A 1, A 2,... FROM r 1, r 2,... WHERE P; r i are the relations (tables)

More information

NULLs & Outer Joins. Objectives of the Lecture :

NULLs & Outer Joins. Objectives of the Lecture : Slide 1 NULLs & Outer Joins Objectives of the Lecture : To consider the use of NULLs in SQL. To consider Outer Join Operations, and their implementation in SQL. Slide 2 Missing Values : Possible Strategies

More information

Querying Data with Transact-SQL

Querying Data with Transact-SQL Course 20761A: Querying Data with Transact-SQL Page 1 of 5 Querying Data with Transact-SQL Course 20761A: 2 days; Instructor-Led Introduction The main purpose of this 2 day instructor led course is to

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 8 Advanced SQL

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management Tenth Edition Chapter 8 Advanced SQL SQL Join Operators Join operation merges rows from two tables and returns the rows with one of the following:

More information

SQL STRUCTURED QUERY LANGUAGE

SQL STRUCTURED QUERY LANGUAGE STRUCTURED QUERY LANGUAGE SQL Structured Query Language 4.1 Introduction Originally, SQL was called SEQUEL (for Structured English QUery Language) and implemented at IBM Research as the interface for an

More information

Data Manipulation Language (DML)

Data Manipulation Language (DML) In the name of Allah Islamic University of Gaza Faculty of Engineering Computer Engineering Department ECOM 4113 DataBase Lab Lab # 3 Data Manipulation Language (DML) El-masry 2013 Objective To be familiar

More information

RESTRICTING AND SORTING DATA

RESTRICTING AND SORTING DATA RESTRICTING AND SORTING DATA http://www.tutorialspoint.com/sql_certificate/restricting_and_sorting_data.htm Copyright tutorialspoint.com The essential capabilities of SELECT statement are Selection, Projection

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 8 Advanced SQL

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management Tenth Edition Chapter 8 Advanced SQL Objectives In this chapter, you will learn: How to use the advanced SQL JOIN operator syntax About the different

More information

Oracle 1Z Oracle Database 11g SQL Fundamentals I. Download Full Version :

Oracle 1Z Oracle Database 11g SQL Fundamentals I. Download Full Version : Oracle 1Z1-051 Oracle Database 11g SQL Fundamentals I Download Full Version : https://killexams.com/pass4sure/exam-detail/1z1-051 QUESTION: 238 You need to perform these tasks: - Create and assign a MANAGER

More information

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved. Restricting and Sorting Data Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort

More information

Set theory is a branch of mathematics that studies sets. Sets are a collection of objects.

Set theory is a branch of mathematics that studies sets. Sets are a collection of objects. Set Theory Set theory is a branch of mathematics that studies sets. Sets are a collection of objects. Often, all members of a set have similar properties, such as odd numbers less than 10 or students in

More information

Chapter 4 SQL. Database Systems p. 121/567

Chapter 4 SQL. Database Systems p. 121/567 Chapter 4 SQL Database Systems p. 121/567 General Remarks SQL stands for Structured Query Language Formerly known as SEQUEL: Structured English Query Language Standardized query language for relational

More information

Data Infrastructure IRAP Training 6/27/2016

Data Infrastructure IRAP Training 6/27/2016 Data Infrastructure IRAP Training 6/27/2016 UCDW Database Models Integrity Constraints Training Database SQL Defined Types of SQL Languages SQL Basics Simple SELECT SELECT with Aliases SELECT with Conditions/Rules

More information

Querying Data with Transact SQL Microsoft Official Curriculum (MOC 20761)

Querying Data with Transact SQL Microsoft Official Curriculum (MOC 20761) Querying Data with Transact SQL Microsoft Official Curriculum (MOC 20761) Course Length: 3 days Course Delivery: Traditional Classroom Online Live MOC on Demand Course Overview The main purpose of this

More information

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 6 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA

More information

Relational Databases

Relational Databases Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 49 Plan of the course 1 Relational databases 2 Relational database design 3 Conceptual database design 4

More information

DB2 SQL Class Outline

DB2 SQL Class Outline DB2 SQL Class Outline The Basics of SQL Introduction Finding Your Current Schema Setting Your Default SCHEMA SELECT * (All Columns) in a Table SELECT Specific Columns in a Table Commas in the Front or

More information

SQL Data Manipulation Language. Lecture 5. Introduction to SQL language. Last updated: December 10, 2014

SQL Data Manipulation Language. Lecture 5. Introduction to SQL language. Last updated: December 10, 2014 Lecture 5 Last updated: December 10, 2014 Throrought this lecture we will use the following database diagram Inserting rows I The INSERT INTO statement enables inserting new rows into a table. The basic

More information

Vendor: Oracle. Exam Code: 1Z Exam Name: Oracle Database: SQL Fundamentals I. Q&As: 292

Vendor: Oracle. Exam Code: 1Z Exam Name: Oracle Database: SQL Fundamentals I. Q&As: 292 Vendor: Oracle Exam Code: 1Z1-051 Exam Name: Oracle Database: SQL Fundamentals I Q&As: 292 QUESTION 1 Evaluate the SQL statement: TRUNCATE TABLE DEPT; Which three are true about the SQL statement? (Choose

More information

Analytics: Server Architect (Siebel 7.7)

Analytics: Server Architect (Siebel 7.7) Analytics: Server Architect (Siebel 7.7) Student Guide June 2005 Part # 10PO2-ASAS-07710 D44608GC10 Edition 1.0 D44917 Copyright 2005, 2006, Oracle. All rights reserved. Disclaimer This document contains

More information

Follow these steps to get started: o Launch MS Access from your start menu. The MS Access startup panel is displayed:

Follow these steps to get started: o Launch MS Access from your start menu. The MS Access startup panel is displayed: Forms-based Database Queries The topic presents a summary of Chapter 3 in the textbook, which covers using Microsoft Access to manage and query an Access database. The screenshots in this topic are from

More information

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

PASS4TEST. IT Certification Guaranteed, The Easy Way!  We offer free update service for one year PASS4TEST \ http://www.pass4test.com We offer free update service for one year Exam : 1z1-051 Title : Oracle Database: SQL Fundamentals I Vendor : Oracle Version : DEMO Get Latest & Valid 1Z1-051 Exam's

More information

MTA Database Administrator Fundamentals Course

MTA Database Administrator Fundamentals Course MTA Database Administrator Fundamentals Course Session 1 Section A: Database Tables Tables Representing Data with Tables SQL Server Management Studio Section B: Database Relationships Flat File Databases

More information

II. Structured Query Language (SQL)

II. Structured Query Language (SQL) II. Structured Query Language (SQL) Lecture Topics ffl Basic concepts and operations of the relational model. ffl The relational algebra. ffl The SQL query language. CS448/648 II - 1 Basic Relational Concepts

More information

II. Structured Query Language (SQL)

II. Structured Query Language (SQL) II. Structured Query Language () Lecture Topics Basic concepts and operations of the relational model. The relational algebra. The query language. CS448/648 1 Basic Relational Concepts Relating to descriptions

More information

CS Reading Packet: "Writing relational operations using SQL"

CS Reading Packet: Writing relational operations using SQL CS 325 - Reading Packet: "Writing relational operations using SQL" p. 1 CS 325 - Reading Packet: "Writing relational operations using SQL" Sources: Oracle9i Programming: A Primer, Rajshekhar Sunderraman,

More information

SQL. SQL Data Manipulation: Queries

SQL. SQL Data Manipulation: Queries SQL Data Manipulation: Queries ISYS 464 Spring 2003 Topic 09 1 SQL SQL: Structured Query Language Pronounced: "S Q L" or "sequel" Developed by IBM in San Jose for its experimental relational database management

More information

SQL Data Query Language

SQL Data Query Language SQL Data Query Language André Restivo 1 / 68 Index Introduction Selecting Data Choosing Columns Filtering Rows Set Operators Joining Tables Aggregating Data Sorting Rows Limiting Data Text Operators Nested

More information

Oracle Database 11g: SQL and PL/SQL Fundamentals

Oracle Database 11g: SQL and PL/SQL Fundamentals Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL

More information

In This Lecture. Yet More SQL SELECT ORDER BY. SQL SELECT Overview. ORDER BY Example. ORDER BY Example. Yet more SQL

In This Lecture. Yet More SQL SELECT ORDER BY. SQL SELECT Overview. ORDER BY Example. ORDER BY Example. Yet more SQL In This Lecture Yet More SQL Database Systems Lecture 9 Natasha Alechina Yet more SQL ORDER BY Aggregate functions and HAVING etc. For more information Connoly and Begg Chapter 5 Ullman and Widom Chapter

More information

CSEN 501 CSEN501 - Databases I

CSEN 501 CSEN501 - Databases I CSEN501 - Databases I Lecture 5: Structured Query Language (SQL) Prof. Dr. Slim slim.abdennadher@guc.edu.eg German University Cairo, Faculty of Media Engineering and Technology Structured Query Language:

More information

King Fahd University of Petroleum and Minerals

King Fahd University of Petroleum and Minerals 1 King Fahd University of Petroleum and Minerals Information and Computer Science Department ICS 334: Database Systems Semester 041 Major Exam 1 18% ID: Name: Section: Grades Section Max Scored A 5 B 25

More information

T-SQL Training: T-SQL for SQL Server for Developers

T-SQL Training: T-SQL for SQL Server for Developers Duration: 3 days T-SQL Training Overview T-SQL for SQL Server for Developers training teaches developers all the Transact-SQL skills they need to develop queries and views, and manipulate data in a SQL

More information

Sql Server Syllabus. Overview

Sql Server Syllabus. Overview Sql Server Syllabus Overview This SQL Server training teaches developers all the Transact-SQL skills they need to create database objects like Tables, Views, Stored procedures & Functions and triggers

More information

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.

Restricting and Sorting Data. Copyright 2004, Oracle. All rights reserved. Restricting and Sorting Data Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort the rows that are retrieved by a query Use

More information

Braindumps.1z QA

Braindumps.1z QA Braindumps.1z0-061.75.QA Number: 1z0-061 Passing Score: 800 Time Limit: 120 min File Version: 19.1 http://www.gratisexam.com/ Examcollection study guide is the best exam preparation formula. The Dump provides

More information

Jarek Szlichta

Jarek Szlichta Jarek Szlichta http://data.science.uoit.ca/ SQL is a standard language for accessing and manipulating databases What is SQL? SQL stands for Structured Query Language SQL lets you gain access and control

More information

RDBMS- Day 4. Grouped results Relational algebra Joins Sub queries. In today s session we will discuss about the concept of sub queries.

RDBMS- Day 4. Grouped results Relational algebra Joins Sub queries. In today s session we will discuss about the concept of sub queries. RDBMS- Day 4 Grouped results Relational algebra Joins Sub queries In today s session we will discuss about the concept of sub queries. Grouped results SQL - Using GROUP BY Related rows can be grouped together

More information

5. Single-row function

5. Single-row function 1. 2. Introduction Oracle 11g Oracle 11g Application Server Oracle database Relational and Object Relational Database Management system Oracle internet platform System Development Life cycle 3. Writing

More information

Announcements (September 14) SQL: Part I SQL. Creating and dropping tables. Basic queries: SFW statement. Example: reading a table

Announcements (September 14) SQL: Part I SQL. Creating and dropping tables. Basic queries: SFW statement. Example: reading a table Announcements (September 14) 2 SQL: Part I Books should have arrived by now Homework #1 due next Tuesday Project milestone #1 due in 4 weeks CPS 116 Introduction to Database Systems SQL 3 Creating and

More information

STIDistrict Query (Basic)

STIDistrict Query (Basic) STIDistrict Query (Basic) Creating a Basic Query To create a basic query in the Query Builder, open the STIDistrict workstation and click on Utilities Query Builder. When the program opens, database objects

More information

GIFT Department of Computing Science. CS-217/224: Database Systems. Lab-5 Manual. Displaying Data from Multiple Tables - SQL Joins

GIFT Department of Computing Science. CS-217/224: Database Systems. Lab-5 Manual. Displaying Data from Multiple Tables - SQL Joins GIFT Department of Computing Science CS-217/224: Database Systems Lab-5 Manual Displaying Data from Multiple Tables - SQL Joins V3.0 5/5/2016 Introduction to Lab-5 This lab introduces students to selecting

More information

Introduction SQL DRL. Parts of SQL. SQL: Structured Query Language Previous name was SEQUEL Standardized query language for relational DBMS:

Introduction SQL DRL. Parts of SQL. SQL: Structured Query Language Previous name was SEQUEL Standardized query language for relational DBMS: Introduction SQL: Structured Query Language Previous name was SEQUEL Standardized query language for relational DBMS: SQL The standard is evolving over time SQL-89 SQL-9 SQL-99 SQL-0 SQL is a declarative

More information

Lab # 6. Using Subqueries and Set Operators. Eng. Alaa O Shama

Lab # 6. Using Subqueries and Set Operators. Eng. Alaa O Shama The Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Database Lab Lab # 6 Using Subqueries and Set Operators Eng. Alaa O Shama November, 2015 Objectives:

More information

Preview. Advanced SQL. In this chapter, you will learn:

Preview. Advanced SQL. In this chapter, you will learn: C6545_08 8/15/2007 16:13:3 Page 297 Advanced 8 Preview In this chapter, you will learn: About the relational set operators UNION, UNION ALL, INTERSECT, and MINUS How to use the advanced JOIN operator syntax

More information

CPS221 Lecture: Relational Database Querying and Updating

CPS221 Lecture: Relational Database Querying and Updating CPS221 Lecture: Relational Database Querying and Updating last revised 8/5/10 Objectives: 1. To introduce the SQL select statement 2. To introduce the SQL insert, update, and delete statements Materials:

More information

Relational Databases. APPENDIX A Overview of Relational Database Structure and SOL

Relational Databases. APPENDIX A Overview of Relational Database Structure and SOL APPENDIX A Overview of Relational Database Structure and SOL - THIS APPENDIX CONTAINS a brief overview of relational databases and the Structured Query Language (SQL). It provides the basic knowledge necessary

More information

D B M G. SQL language: basics. Managing tables. Creating a table Modifying table structure Deleting a table The data dictionary Data integrity

D B M G. SQL language: basics. Managing tables. Creating a table Modifying table structure Deleting a table The data dictionary Data integrity SQL language: basics Creating a table Modifying table structure Deleting a table The data dictionary Data integrity 2013 Politecnico di Torino 1 Creating a table Creating a table (1/3) The following SQL

More information

CPS221 Lecture: Relational Database Querying and Updating

CPS221 Lecture: Relational Database Querying and Updating CPS221 Lecture: Relational Database Querying and Updating Objectives: last revised 10/29/14 1. To introduce the SQL select statement 2. To introduce the SQL insert, update, and delete statements Materials:

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

Computing for Medicine (C4M) Seminar 3: Databases. Michelle Craig Associate Professor, Teaching Stream

Computing for Medicine (C4M) Seminar 3: Databases. Michelle Craig Associate Professor, Teaching Stream Computing for Medicine (C4M) Seminar 3: Databases Michelle Craig Associate Professor, Teaching Stream mcraig@cs.toronto.edu Relational Model The relational model is based on the concept of a relation or

More information

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Table of Contents. PDF created with FinePrint pdffactory Pro trial version Table of Contents Course Description The SQL Course covers relational database principles and Oracle concepts, writing basic SQL statements, restricting and sorting data, and using single-row functions.

More information

Simple queries Set operations Aggregate operators Null values Joins Query Optimization. John Edgar 2

Simple queries Set operations Aggregate operators Null values Joins Query Optimization. John Edgar 2 CMPT 354 Simple queries Set operations Aggregate operators Null values Joins Query Optimization John Edgar 2 Data Manipulation Language (DML) to Write queries Insert, delete and modify records Data Definition

More information

Database Foundations. 6-4 Data Manipulation Language (DML) Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Foundations. 6-4 Data Manipulation Language (DML) Copyright 2015, Oracle and/or its affiliates. All rights reserved. Database Foundations 6-4 Roadmap You are here Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control

More information

Activant Solutions Inc. SQL 2005: Basic Data Manipulation

Activant Solutions Inc. SQL 2005: Basic Data Manipulation Activant Solutions Inc. SQL 2005: Basic Data Manipulation SQL Server 2005 suite Course 4 of 4 This class is designed for Beginner/Intermediate SQL Server 2005 System Administrators Objectives System Stored

More information

8) A top-to-bottom relationship among the items in a database is established by a

8) A top-to-bottom relationship among the items in a database is established by a MULTIPLE CHOICE QUESTIONS IN DBMS (unit-1 to unit-4) 1) ER model is used in phase a) conceptual database b) schema refinement c) physical refinement d) applications and security 2) The ER model is relevant

More information

1) Introduction to SQL

1) Introduction to SQL 1) Introduction to SQL a) Database language enables users to: i) Create the database and relation structure; ii) Perform insertion, modification and deletion of data from the relationship; and iii) Perform

More information

Lesson 2. Data Manipulation Language

Lesson 2. Data Manipulation Language Lesson 2 Data Manipulation Language IN THIS LESSON YOU WILL LEARN To add data to the database. To remove data. To update existing data. To retrieve the information from the database that fulfil the stablished

More information

ASSIGNMENT NO Computer System with Open Source Operating System. 2. Mysql

ASSIGNMENT NO Computer System with Open Source Operating System. 2. Mysql ASSIGNMENT NO. 3 Title: Design at least 10 SQL queries for suitable database application using SQL DML statements: Insert, Select, Update, Delete with operators, functions, and set operator. Requirements:

More information

Slicing and Dicing Data in CF and SQL: Part 2

Slicing and Dicing Data in CF and SQL: Part 2 Slicing and Dicing Data in CF and SQL: Part 2 Charlie Arehart Founder/CTO Systemanage carehart@systemanage.com SysteManage: Agenda Slicing and Dicing Data in Many Ways Cross-Referencing Tables (Joins)

More information

1 SQL Structured Query Language

1 SQL Structured Query Language 1 SQL Structured Query Language 1.1 Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following

More information

Database Systems SQL SL03

Database Systems SQL SL03 Checking... Informatik für Ökonomen II Fall 2010 Data Definition Language Database Systems SQL SL03 Table Expressions, Query Specifications, Query Expressions Subqueries, Duplicates, Null Values Modification

More information

MariaDB Crash Course. A Addison-Wesley. Ben Forta. Upper Saddle River, NJ Boston. Indianapolis. Singapore Mexico City. Cape Town Sydney.

MariaDB Crash Course. A Addison-Wesley. Ben Forta. Upper Saddle River, NJ Boston. Indianapolis. Singapore Mexico City. Cape Town Sydney. MariaDB Crash Course Ben Forta A Addison-Wesley Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich Paris Madrid Cape Town Sydney Tokyo Singapore Mexico City

More information

Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept]

Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept] Interview Questions on DBMS and SQL [Compiled by M V Kamal, Associate Professor, CSE Dept] 1. What is DBMS? A Database Management System (DBMS) is a program that controls creation, maintenance and use

More information

SQL. CS 564- Fall ACKs: Dan Suciu, Jignesh Patel, AnHai Doan

SQL. CS 564- Fall ACKs: Dan Suciu, Jignesh Patel, AnHai Doan SQL CS 564- Fall 2015 ACKs: Dan Suciu, Jignesh Patel, AnHai Doan MOTIVATION The most widely used database language Used to query and manipulate data SQL stands for Structured Query Language many SQL standards:

More information

Displaying Data from Multiple Tables. Copyright 2004, Oracle. All rights reserved.

Displaying Data from Multiple Tables. Copyright 2004, Oracle. All rights reserved. Displaying Data from Multiple Tables Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data

More information

INTRODUCTION TO MYSQL MySQL : It is an Open Source RDBMS Software that uses Structured Query Language. It is available free of cost. Key Features of MySQL : MySQL Data Types: 1. High Speed. 2. Ease of

More information

CIS Slightly-different version of Week 10 Lab, also intro to SQL UPDATE and DELETE, and more

CIS Slightly-different version of Week 10 Lab, also intro to SQL UPDATE and DELETE, and more CIS 315 - Week 10 Lab Exercise p. 1 Sources: CIS 315 - Slightly-different version of Week 10 Lab, 10-27-09 more SELECT operations: UNION, INTERSECT, and MINUS, also intro to SQL UPDATE and DELETE, and

More information