Query 1. Modify data. Replace the text. Your First Name, Your Last Name with your first...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Query 1. Modify data. Replace the text. Your First Name, Your Last Name with your first name and your last name in the DML file. Aside: Last Name is the Family Name or Surname. Replace 0 in Balance field with another number. Replace the other five entries in the Customer_T table with your own data. Write the names of your colleagues sitting besides you in the lab. Do not skip this step. After modifying the script run it. Type and run each of the statements to verify that the tables are created successfully. SELECT FROM Customer_T; SELECT FROM Invoice_T; SELECT FROM Product_T; SELECT * FROM Invoice_Line_T; Query 2. List data in sorted order. List all customers (last name and then first name), sorted by last name. Hint: Use the clause ORDER BY. Query 3. List year of invoice number. List only invoice numbers and invoice dates (4-digit year) from the Invoice T table. Tip: Use the EXTRACT function. Query 4. List Data, identify correct table. List Invoice Number, Product. Code, and Line Price. Identify the table that has these columns? Query 5. List Data. Associate common terms with database field ames. List all product code and product description. Choose the appropriate table to complete the query. Query 6. Filter rows. List customer names (last and first name) and city for those customers who do not live in Ottawa. Hint: Use WHERE clause. Query 7. Use String functions. The city name is stored as Ottawa. Modify the query to list the same number of rows when the condition is written as OTTAWA. Tip: Use the appropriate string function shown in figure 2.2 on page 23, Query 8. Reverse Engineer the database. Reverse Engineer the Inventory database using a data modeling tool. Rearrange the entities and relationships. Insert a text box with your name, section number, student number, course code, and course name. Query 8. Reverse Engineer the database. Reverse Engineer the Inventory database using a data modeling tool. Rearrange the entities and relationships. Insert a text box with your name, section number, student number, course code, and course name. Query 9. Determine identifying and non-identifying entities. Determine the identifying and non-identifying relationships. Note your answers, you will need them for the quiz. Refer to the documentation on identifying and non-identifying relationships. Query 10. Determine the associative entity. Which one of the four entities is an associative entity? Give a reason. 5. SQL CONSTRAINTS Notes on Relationships An identifying relationship is represented by a solid line; a row in a child table can be uniquely identified only if an entry exists in the parent table. For example, in table Invoice_Line_T an entry can be identified only if an Invoice_Number exists in the Invoice_T table. Aside: The prime key Invoice_Number in the Invoice T Table is part of the prime key in the Invoice_Line_T table. A non-identifying relationship is represented by a broken (dashed) line. In a non-identifying relationship, an entry in a child table can be uniquely identified without a corresponding entry in the parent table. For example, an entry in the Invoice T table can be uniquely identified by Invoice_Number alone, it does not need an entry from the customer table. Similarly an entry in the Invoice_Line_T table can be uniquely identified by a combination of Invoice_Number and Invoice_Line it does not depend on an entry in the Product T table. 66 4 cust_id cust_fname cust_Iname cust_phone cust_address cust_city cust prov cust_postcode customer t Character(4) Character varying(30) Character varying (30) Character varying (15) Character varying (20) Character varying(15) Character(2) Character(6) cust_balance Numeric(9,2) + invoice_number cust_id invoice date I I I fk cust id invoice_t NN (PK) NN NN Date NN NN NN Character(6) NN (PK) Character(4) NN (FK) fkl invoice line prod_code prod_description prod_indate prod_qoh prod_min prod_price prod discount product_t Character(5) Character varying(60) Date Integer Integer Numeric(5,2) Integer invoice_line_t 4 invoice_number Character(6) invoice_line prod_code line_units line_price NN (PK) NN Figure 5.4: Inventory Database NN NN NN fk2 invoice line NN (PFK) Integer NN (PK) Character(5) NN (FK) Integer NN Numeric(5,2) NN Requirements Create a database called Inventory in postgres. First load and run Inventory-DDL, the DDL script will create tables. Load the Inventory-DML script. Locate the following line, INSERT INTO Customer_T VALUES ( C002 , Your First Name , Your Last Name , 613-727-4723 , 1385 Woodroffe Ave , Ottawa , ON , K2G1V8¹,0); A note on CONSTRAINTS. You can run the DML.sql file only once, the constraints will prevent you from running it again. If you need to run the DML the second time, first run the DDL. This will drop all existing tables and recreate them. Now you will be able to run your modified DML.sql. Query 1. Modify data. Replace the text. Your First Name, Your Last Name with your first name and your last name in the DML file. Aside: Last Name is the Family Name or Surname. Replace 0 in Balance field with another number. Replace the other five entries in the Customer_T table with your own data. Write the names of your colleagues sitting besides you in the lab. Do not skip this step. After modifying the script run it. Type and run each of the statements to verify that the tables are created successfully. SELECT FROM Customer_T; SELECT FROM Invoice_T; SELECT FROM Product_T; SELECT * FROM Invoice_Line_T; Query 2. List data in sorted order. List all customers (last name and then first name), sorted by last name. Hint: Use the clause ORDER BY. Query 3. List year of invoice number. List only invoice numbers and invoice dates (4-digit year) from the Invoice T table. Tip: Use the EXTRACT function. Query 4. List Data, identify correct table. List Invoice Number, Product. Code, and Line Price. Identify the table that has these columns? Query 5. List Data. Associate common terms with database field ames. List all product code and product description. Choose the appropriate table to complete the query. Query 6. Filter rows. List customer names (last and first name) and city for those customers who do not live in Ottawa. Hint: Use WHERE clause. Query 7. Use String functions. The city name is stored as Ottawa. Modify the query to list the same number of rows when the condition is written as OTTAWA. Tip: Use the appropriate string function shown in figure 2.2 on page 23, Query 8. Reverse Engineer the database. Reverse Engineer the Inventory database using a data modeling tool. Rearrange the entities and relationships. Insert a text box with your name, section number, student number, course code, and course name. Query 8. Reverse Engineer the database. Reverse Engineer the Inventory database using a data modeling tool. Rearrange the entities and relationships. Insert a text box with your name, section number, student number, course code, and course name. Query 9. Determine identifying and non-identifying entities. Determine the identifying and non-identifying relationships. Note your answers, you will need them for the quiz. Refer to the documentation on identifying and non-identifying relationships. Query 10. Determine the associative entity. Which one of the four entities is an associative entity? Give a reason. 5. SQL CONSTRAINTS Notes on Relationships An identifying relationship is represented by a solid line; a row in a child table can be uniquely identified only if an entry exists in the parent table. For example, in table Invoice_Line_T an entry can be identified only if an Invoice_Number exists in the Invoice_T table. Aside: The prime key Invoice_Number in the Invoice T Table is part of the prime key in the Invoice_Line_T table. A non-identifying relationship is represented by a broken (dashed) line. In a non-identifying relationship, an entry in a child table can be uniquely identified without a corresponding entry in the parent table. For example, an entry in the Invoice T table can be uniquely identified by Invoice_Number alone, it does not need an entry from the customer table. Similarly an entry in the Invoice_Line_T table can be uniquely identified by a combination of Invoice_Number and Invoice_Line it does not depend on an entry in the Product T table. 66 4 cust_id cust_fname cust_Iname cust_phone cust_address cust_city cust prov cust_postcode customer t Character(4) Character varying(30) Character varying (30) Character varying (15) Character varying (20) Character varying(15) Character(2) Character(6) cust_balance Numeric(9,2) + invoice_number cust_id invoice date I I I fk cust id invoice_t NN (PK) NN NN Date NN NN NN Character(6) NN (PK) Character(4) NN (FK) fkl invoice line prod_code prod_description prod_indate prod_qoh prod_min prod_price prod discount product_t Character(5) Character varying(60) Date Integer Integer Numeric(5,2) Integer invoice_line_t 4 invoice_number Character(6) invoice_line prod_code line_units line_price NN (PK) NN Figure 5.4: Inventory Database NN NN NN fk2 invoice line NN (PFK) Integer NN (PK) Character(5) NN (FK) Integer NN Numeric(5,2) NN Requirements Create a database called Inventory in postgres. First load and run Inventory-DDL, the DDL script will create tables. Load the Inventory-DML script. Locate the following line, INSERT INTO Customer_T VALUES ( C002 , Your First Name , Your Last Name , 613-727-4723 , 1385 Woodroffe Ave , Ottawa , ON , K2G1V8¹,0); A note on CONSTRAINTS. You can run the DML.sql file only once, the constraints will prevent you from running it again. If you need to run the DML the second time, first run the DDL. This will drop all existing tables and recreate them. Now you will be able to run your modified DML.sql.
Expert Answer:
Answer rating: 100% (QA)
Answer Query1 UPDATE custmert SET custfnameJohn custlnameSmith custphone9856321548 custaddressKottar... View the full answer
Related Book For
Database Systems Design Implementation and Management
ISBN: 978-1285196145
11th edition
Authors: Carlos Coronel, Steven Morris
Posted Date:
Students also viewed these databases questions
-
Another database associated with this text and found in Wiley PLUS is the Consumer Food database. There is a dichotomous variable in this database, and that is whether a family lives in a metro area...
-
Create a SQL query to satisfy each of the tasks below. Save each SQL query using the name associated with the task in the table below You must create an sql code for each tasks and ensure when...
-
Name three ways that null values in a database can be interpreted. Why is this problematic?
-
Show that in the limit ??x ?? 0 and ??t ?? 0, the difference Equation (3.12) is equivalent to the differential Equation (2.5). GIVENThe difference equation for one-dimensional transient...
-
Why would a retailer use mystery shoppers rather than other forms of observation? Are there any instances when you would not recommend their use? Why or why not?
-
Consider the table listing the solubilities of several alcohols in water and in hexane. Which statement best describes the observed trend in terms of intermolecular forces? (a) As you move down the...
-
On a distant planet small-amplitude waves travel across a \(1-\mathrm{m}\)-deep pond with a speed of \(5 \mathrm{~m} / \mathrm{s}\). Determine the acceleration of gravity on the surface of that...
-
Virginia Partners, Ltd. (Virginia Partners), a limited partnership organized under the laws of Florida, conducted business in Kentucky but failed to register as a foreign limited partnership, as...
-
Given: 1kg = 1000g 1. A pitcher threw a pitch that generated an impulse of 3.25 Ns on the catcher's glove. If the mass of the baseball is 142g, what was the velocity of the pitched baseball when it...
-
K Dhoni is a business consultant. The following trial balance is provided at 30 September 201: The following additional information is supplied: 1. At 30 September 201 rent received in advance...
-
Jeff has enjoyed tinkering cars as long as he can remember. He was elated when he fulfilled his goal to earn a certified Automotive Technician Degree from the local technical institute. The placement...
-
Just at the turn of the New Year of 2018, you have just been appointed as a Portfolio Manager and Strategic Pricing Specialist of large Asset Management Company. This company has branches in many...
-
Cool Look Limited (CLL) is a high-end clothing design and manufacturing company that has been in business in Canada since 1964. CLL started as an owner-managed enterprise created and run by Hector...
-
Find the answers to the questions below and what are the answers? What is the total personal property (after any 179)? What is the Total Personal Property 4th quarter (after any 179)?
-
Variable Costing Income Statement; Reconciliation LO6-1, LO6-2, LO6-3 During Heaton Company's first two years of operations, it reported absorption costing net operating income as follows: Year 1...
-
A property manager is hired to rent out a client's single-family home. There are two applicants that apply. The first individual is a single male who has had a job for one month and is receiving cash...
-
Tank level control pressure The water level control system, seen in Figure 5, is designed to control the level of water in the tank (T). The aim of the system is to control the rate with which the...
-
Respond to the ethical judgments required based on the following scenarios. Scenario 1. Assume you have collected a sample using MUS and that you have evaluated that sample to calculate a total...
-
What are the three basic components of the ODBC architecture?
-
Use MS Excel to connect to the Ch02_InsureCo MS Access database using ODBC, and retrieve all of the CUSTOMERs.
-
What trade-offs are involved in building highly distributed data environments?
-
The position of a particle undergoing simple harmonic motion is given by \(x(t)=20 \cos (8 \pi t)\), where \(x\) is in millimeters and \(t\) is in seconds. For this motion, what are the (a)...
-
Fill in the blanks to make the following statements correct. a. It is difficult to compare two or more data series when absolute numbers and different units are used. For that reason we construct...
-
Fill in the blanks to make the following statements correct. a. On a graph with Y on the vertical axis and X on the horizontal axis, the slope of a straight line is calculated as ___________. b. In...
Study smarter with the SolutionInn App