Page 1 of 1

Need help with this task. Please read the task of the requirements.I have provided data sample. thanks

Posted: Sat May 14, 2022 3:22 pm
by answerhappygod
Need help with this task. Please read the task of the
requirements.I have provided data sample. thanks
Need Help With This Task Please Read The Task Of The Requirements I Have Provided Data Sample Thanks 1
Need Help With This Task Please Read The Task Of The Requirements I Have Provided Data Sample Thanks 1 (225.99 KiB) Viewed 63 times
Need Help With This Task Please Read The Task Of The Requirements I Have Provided Data Sample Thanks 2
Need Help With This Task Please Read The Task Of The Requirements I Have Provided Data Sample Thanks 2 (499.42 KiB) Viewed 63 times
Download a file solution2.sql and insert into the file the implementations of the following queries as SELECT statements of SQL. Your implementation must directly follow a comment with a specification of a subtask. The queries listed below must be implemented as SELECT statements with JOIN or LEFT / RIGHT OUTER JOIN operation. (1) Find the product number, price, and manufacturer of all products that have the keyword. Do not display repeated results. Hint: Consider the tables Product and Keyword. (2) Find the product number, price, and manufacturer of all products that have been ranked by the customers. Do not display repeated results. Hint: Consider the tables Product and Cevaluation. (3) Find the customer number and full name (fname and lname) of all customers that have created baskets of products in January 2022. Do not display repeated results. Hint: Consider the tables Customer and Pbasket. (4) Find the customer number and full name (fname and Iname) of all customers that haven't created any baskets of products so far. Hint: Consider the tables Customer and Pbasket. Use LEFT or RIGHT OUTER JOIN. (5) Find the product number, price, and manufacturer of all products that have been ranked by the customers with the highest rank. Hint: Consider the tables Product and Cevaluation. Compare the rank value with the highest rank value. (6) Find the product number, price, manufacturer, and the total number of keywords for all products. Include the products that have no keyword. Sort the data in ascending order of the total number of keywords for the products. Hint: Consider the tables Product and Keyword. Use LEFT or RIGHT OUTER JOIN. To create a report from the processing of SELECT statements, open a Terminal window, change the directory to the working directory, and start the command line interface mysql in the following way: mysql -u csit115 -p-v-c

Ubuntu 19.10-64bits-MySQL8.0.18-27-DEC-2019 (Snapshot 1) [Running] May 9 15:39 MySQL Workbench Database Server Tools Scripting Help @ dbcount X dbload X 9 Limit to 1000 rows Query 3 * dbcreate X BOS 1 2 /* 3 * SHOP 4 5. CREATE TABLE Product 6 pNunber DECIMAL (8) NOT NULL, 1 Product number 7 price DECIMAL(5,2) NOT NULL, /* Price per item manufacturer VARCHAR(30) /* Manufacturer nane +/ 9 pConnent VARCHAR(30) /* Brief connents . 10 CONSTRAINT Product_PK PRIMARY KEY (pNumber | 11 D: 12 13. CREATE TABLE Keyword 14 pNumber DECIMAL (B) NOT NULL, /* product number +/ 15 kword VARCHAR(38) NOT NULL, /* Keyword 16 CONSTRAINT Keyword PK PRIMARY KEY(pNumber, kward), 17 CONSTRAINT Keyword_FK1 FOREIGN KEY(pNumber) REFERENCES Product Number) 18 ); 19 20. CREATE TABLE Customer 21 Number DECIMAL (10) NOT NULL, /* Customer number * 22 fnane VARCHAR(30) NOT NULL /* First name + 23 Inane VARCHAR(30) NOT NULL, /* Last name 24 phone VARCHAR(20) NOT NULL, /* Phone number */ 25 email VARCHAR(50) NOT NULL, /* E-mail address + 26 fax DECIMAL (20) /* Fax number */ 27 country VARCHAR(30) NOT NULL, /* Country part of address */ 28 state VARCHAR(30) /* State part of address 29 city VARCHAR(30) NOT NULL, /* City part of address 30 pcode VARCHAR(10), /* Post cade part of address / 31 street VARCHAR(30) NOT NULL, /* Street part of address 32 houseNumber DECIMAL (6) NOT NULL, /* House number part of adress */ 33 flatNumber DECIMAL(6). /* Flat number part of address / 34 CONSTRAINT Custoner_PK PRIMARY KEY (CNumber) 35 36 37 38 - CREATE TABLE Pbasket 39 whencreated DATE NOT NULL, / + Transferred from Abasket / 40 whenfinalised TIMESTAMP NOT NULL, /* Date time when finalised 41 ccard DECIMAL (16) NOT NULL, /* Credit card used 42 CNumber DECIMAL (10) NOT NULL, + Customer number 43 CONSTRAINT Pbasket_PK PRIMARY KEY (whenfinalised), 44 CONSTRAINT PBasket FKI FOREIGN KEY(cNumber) REFERENCES Customer Number) 45 Di 46 47 Time SQL History Date # 1 2022-05-0 2010 Left

Ubuntu 19.10-64bits-MySQL8.0.18-27-DEC-2019 (Snapshot 1) [Running] May 9 15:40 MySQL Workbench Database Server Tools Scripting Help H Query 3 X dbcreate X dbcount X dbload X BEGO® Limit to 1000 rows - Q13 28 27 country VARCHAR(39) NOT NULL, /* Country part of address */ 28 state VARCHAR(30), /* State part of address */ 29 city VARCHAR(30) NOT NULL, /* City part of address 30 pcode VARCHAR(10). /* Past code part of address */ 31 street VARCHAR(30) NOT NULL /* Street part of address 32 houseNumber DECIMAL(O) NOT NULL, /* House number part of adress */ 33 Plat Number DECIMAL(6). /* Flat number part of address */ 34 CONSTRAINT Customer PK PRIMARY KEY C Number) 35 ); 36 37 38. CREATE TABLE Pbasket 39 whencreated DATE NOT NULL /* Transferred from Abasket */ 40 whenfinalised TIMESTAMP NOT NULL, /* Date time when finalised / 41 ccard DECIMAL(16) NOT NULL, /* Credit card used 42 CNumber DECIMAL (10) NOT NULL, /* Customer number 43 CONSTRAINT Pbasket_PK PRIMARY KEY(whenfinalised), 44 CONSTRAINT PBasket FKI FOREIGN KEY [Number) REFERENCES Customer (cNumber) 45 ); 46 47 48. CREATE TABLE PPC 49 when finalised TIMESTAMP NOT NULL /* Date Time when finalised 50 pNumber DECIMAL (8) NOT NULL, / Product number 51 CONSTRAINT PP_PK PRIMARY KEY (whenfinalised, pNunber), 52 CONSTRAINT PP K1 FOREIGN KEY(when finalised) 53 REFERENCES Pbasket (whenfinalised), 54 CONSTRAINT PP_FK2 FOREIGN KEY(pNumber) REFERENCES Product (pNumber) 55 56 57 58. CREATE TABLE Cevaluation 59 Number DECIMAL (19) NOT NULL, /* Customer number 60 etext VARCHAR(50) NOT NULL, /* Text af evaluation 61 erank DECIMAL (1) NOT NULL, /* Rank provided by customer 62 pNumber DECIMAL(8) NOT NULL, /* Product number ) / 63 CONSTRAINT Cevaluation PK PRIMARY KEY (CNumber, pNumber), 64 CONSTRAINT Cevaluation_FKI FOREIGN KEY (CNumber) REFERENCES Customer (cNumber), 65 CONSTRAINT Cevaluation_FK2 FOREIGN KEY(pNumber) REFERENCES Product (pNumber), 66 CONSTRAINT Cevaluation CHK CHECK erank IN (0, 1, 2, 3, 4, 5) 67 ); 68 69 20 71 72 */ 73 Time SQL History # Date 1 2022-05-C HANNA ል /