Perform the following functions using the following commands on the tables created(see tables below) 2. Paste SQL and results for each. For the UPDATE command perform Select * and provide screenshot of the results. Explain in at least 'one' sentence the business problem statement for 'each' of these queries. Please do not use all these commands on similar tables. You need to diversify so that all your tables get involved in this assignment. 1. UPDATE using WHERE (ampersand (&) in the clause) - 2. SELECT using ROUND function - 3. NON-EQUALITY join of two tables using the JOIN...ON - 4. OUTER JOIN of two tables (LEFT or RIGHT join) - 5. Create a new table (copy of existing table from your project) - then UPDATE one of row of the table and perform MERGE to keep them in sync -
Perform the following functions using the following commands on the tables created(see tables below) 2. Paste SQL and results for each. For the UPDATE command perform Select * and provide screenshot of the results.
Explain in at least 'one' sentence the business problem statement for 'each' of these queries.
Please do not use all these commands on similar tables. You need to diversify so that all your tables get involved in this assignment.
1. UPDATE using WHERE (ampersand (&) in the clause) -
2. SELECT using ROUND function -
3. NON-EQUALITY join of two tables using the JOIN...ON -
4. OUTER JOIN of two tables (LEFT or RIGHT join) -
5. Create a new table (copy of existing table from your project) - then UPDATE one of row of the table and perform MERGE to keep them in sync -
My tables:
CREATE TABLE product_order_tbl (
order_num CHAR(9) NOT NULL,
product_no VARCHAR2(3) NOT NULL,
product_description VARCHAR2(21) NOT NULL,
product_unit_price NUMBER(5,2) NOT NULL,
CONSTRAINT orderproduct_num_CK PRIMARY KEY (order_num, product_no)
);
CREATE TABLE product_info (
product_no VARCHAR2(3) NOT NULL,
product_description VARCHAR2(21) NOT NULL,
CONSTRAINT product_no_pk PRIMARY KEY (product_no)
);
CREATE TABLE customer_tbl (
customer_name VARCHAR2(10) NOT NULL,
billing_address VARCHAR2(14) NOT NULL,
billing_zip CHAR(5) NOT NULL,
billing_city VARCHAR2(8) NOT NULL,
CONSTRAINT customer_name_pk PRIMARY KEY (customer_name)
);
CREATE TABLE order_info (
order_num VARCHAR(9),
order_date DATE NOT NULL,
customer_name VARCHAR2(10) NOT NULL,
order_address VARCHAR2(30) NOT NULL,
order_city VARCHAR2(9) NOT NULL,
order_zip CHAR(5) NOT NULL,
CONSTRAINT order_pk PRIMARY KEY (order_num),
CONSTRAINT customer_name_fk FOREIGN KEY (customer_name) REFERENCES customer_tbl(customer_name)
);
SUBJECT: MYSQL
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images