From f8ec0204b6b173e5a23946bd0fff6f58d71423f9 Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Wed, 8 Jul 2020 14:21:20 -0400 Subject: [PATCH 1/3] Querries part1-3 done --- Mondira_Roy.sql | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Mondira_Roy.sql diff --git a/Mondira_Roy.sql b/Mondira_Roy.sql new file mode 100644 index 0000000..cf268ee --- /dev/null +++ b/Mondira_Roy.sql @@ -0,0 +1,27 @@ +/*Part-1*/ + +select productName,productLine,buyPrice from products; + +select productName as "Name",productLine as "Product Line",buyPrice as "Buy Price" from products; + +select productName as "Name",productLine as "Product Line",buyPrice as "Buy Price" from products +order by buyPrice DESC; + +/*Part-2*/ +select contactFirstName,contactLastName,city from customers where country='Germany'; + +select contactFirstName as 'First Name',contactLastName as 'Last Name',city as 'City' from customers where country='Germany'; + +select contactFirstName as 'First Name',contactLastName as 'Last Name',city as 'City' from customers where country='Germany' +order by contactLastName; + +/*Part-3*/ + + +/*Part-4*/ + + +/*Part-5*/ + + +/*Part-6*/ \ No newline at end of file From 6e587b065e16f1b79a6044de624d25fc2896babd Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Wed, 8 Jul 2020 17:17:49 -0400 Subject: [PATCH 2/3] Query assignment completed --- Mondira_Roy.sql | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Mondira_Roy.sql b/Mondira_Roy.sql index cf268ee..d9644b1 100644 --- a/Mondira_Roy.sql +++ b/Mondira_Roy.sql @@ -16,12 +16,30 @@ select contactFirstName as 'First Name',contactLastName as 'Last Name',city as ' order by contactLastName; /*Part-3*/ +select DISTINCT status from orders; +SELECT DISTINCT(status) AS Status +FROM orders +ORDER BY status ASC; /*Part-4*/ +select * from payments where paymentDate > '2005-01-01'; +select * from payments where paymentDate > '2005-01-01' order by paymentDate; /*Part-5*/ +select lastName, firstName,email,jobTitle from employees Inner Join offices on employees.officeCode = offices.officeCode +where city='San Francisco' ; +select lastName, firstName,email,jobTitle from employees Inner Join offices on employees.officeCode = offices.officeCode +where city='San Francisco' order by lastName; + +/*Part-6*/ +select productName,ProductLine,productScale, productVendor from products where productLine LIKE '%cars'; + +select productName,productLine,productScale, productVendor +from products +where productLine LIKE '%cars' +GROUP BY productLine +ORDER BY productName; -/*Part-6*/ \ No newline at end of file From dafaf35889652dfb805e1cf996c63b07236a0924 Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Wed, 8 Jul 2020 17:26:02 -0400 Subject: [PATCH 3/3] Part 6 revisited --- Mondira_Roy.sql | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Mondira_Roy.sql b/Mondira_Roy.sql index d9644b1..314fd4f 100644 --- a/Mondira_Roy.sql +++ b/Mondira_Roy.sql @@ -37,9 +37,7 @@ where city='San Francisco' order by lastName; /*Part-6*/ select productName,ProductLine,productScale, productVendor from products where productLine LIKE '%cars'; -select productName,productLine,productScale, productVendor -from products -where productLine LIKE '%cars' -GROUP BY productLine -ORDER BY productName; - +SELECT productName, productLine, productScale, productVendor +FROM products +WHERE productLine LIKE '%cars' +ORDER BY productLine DESC, productName ASC;