SlideShare a Scribd company logo
Excel and SQL Quick Tricks for Merchandisers Learn simple SQL queries to extract data from your SmartSite SQL tables Excel functions to edit your data with little effort Show and talk about real scenarios Update your SQL tables with the updated information to eliminate manual Content work Leah Fernelius
Software Needs for Microsoft SQL and Microsoft Excel Microsoft SQL Server 2008 Express  – Free at http:// www.microsoft.com /express/Database/  (on right side) Enable the ability to query and update your SmartSite SQL tables Contact Ability Support or your hosting company for connection information Microsoft Office Excel  – any current version All Excel files created will need to be saved as .XLS
SQL Query Components Every SQL query must have at least two components SELECT  – control the data elements (columns) desired, such as, the item number or short description FROM  – identify the table that contains the desired data Narrowing criteria and functions WHERE  – narrow the desired data outcome Equal:  = Less Than:  < Greater Than:  > Not Equal to:  <> Contains:  like   Doesn’t Contain:  not like Note: ‘like’ and ‘not like’ are used with the wildcard of %
Microsoft SQL Management Tools Connect to your SQL server Select the desired database
Common SmartSite Tables Common SmartSite Tables acBrands acGroups acItems acItemText MCEcom_Order MCEcom_ShoppingCart_LineItems MCEcom_User_Address Expand ‘Tables’ to see all of the SmartSite tables
Helpful Microsoft Excel Functions CONCATENATE:  =CONCATENATE(A1,” “,B1) Use to add data to the front, end, or put to fields together into one, such as First Name and Last Name into one field COUNT:  =COUNT(A1:A20) Counts the number of cells that contain numbers.  COUNTIF:  =COUNTIF(B2:B25, “SmartSite”) Counts the number of cells in a range with a single criterion. EXACT:  =EXACT(A2,B2) Compares two text strings returning TRUE for an exact match or FALSE if otherwise. EXACT is case-sensitive
Helpful Microsoft Excel Functions  Cont. LEFT:  =LEFT(B2,3) Returns the first character or characters in a text string. If a number is not entered, then just the first character will be returned. If a number is entered, then the first positions for that count will be returned LEN:  =LEN(A4) Counts the number characters in a text string MID:  =MID(A2,1,5) Returns a specific number of characters from a text string, starting at a defined point. The example is for cell A2, first position, return 5 characters
Helpful Microsoft Excel Functions  Cont. PROPER:  =PROPER(B2) Capitalizes the first letter in a text string and converts all other letters to lowercase. Great for product descriptions from an OMS. REPLACE:  =REPLACE(C2,3,2,”10”) Replaces part of a text string, based on the number of characters specified, with the new text. C2 is the old text, 3 is the position to start at, 2 is the number of positions to remove, and “10” is the new text RIGHT:  =RIGHT(A2,4) Returns the last character or characters in a text string. If a number is not entered, then only the last character will be returned. If a number is entered, then the last positions for that count will be returned
Helpful Microsoft Excel Functions  Cont. SUBSTITUTE:  =SUBSTITUTE(B2,”MPW”,”Mack’s”) Substitutes new text for old text. “MPW” is the old text and “Mack’s” is the new text UPPER:  =UPPER(C2) Convert text from mixed or lower to all upper case VLOOKUP:  see handout available
Scenarios Query the data in SQL Copy the queried data into Excel Manipulate the data in Excel using functions Review manipulated data Scenario One
Update Excel Data in SQL Excel File Requirements for upload to SQL One identifying row such as an item number, item ID or EDP  The file must contain column headings Save the file as .xls SQL Requirements Permissions to write to or update the database
Update Excel Data in SQL  Cont. Log into the SQL Server with the SQL tool installed Navigate to the desired database Right click on the desired database selecting: Tasks > Import Data The SQL Server Import and Export Wizard will open
Update Excel Data in SQL  Cont. Click ‘Next’ for the screen below In the Data Source Field select Microsoft Excel
Update Excel Data in SQL  Cont. Browse to the file to be imported to update SQL Verify the correct Excel Version displays in the drop down.  If using MS Excel 2007 be sure the 2007 version displays Check box marked for ‘First row has column names’ Click ‘Next’
Update Excel Data in SQL  Cont. Destination: should be defaulted to ‘SQL Server Native Client 10.0’ Server name: will be the name of the SQL server Authentication: access information for SQL  Database: should default to the database that was clicked to start this task Click ‘Next’
Update Excel Data in SQL  Cont. Select the radio button for ‘Copy data from one or more tables or views’ Click ‘Next’
Update Excel Data in SQL  Cont. Since the saved spreadsheet has only one sheet, check the box for ‘Sheet1$’ as shown In the Destination cell remove the text ‘Sheet1$’ and enter the desired temp. table name
Update Excel Data in SQL  Cont. Edit Mapping: allows for the review of the Source and Destination mappings Preview: display the data that will be imported
Update Excel Data in SQL  Cont. Edit Mapping window Review the Source and Destination columns shown Click ‘OK’
Update Excel Data in SQL  Cont. Preview Window Display the data to be imported into the temp table Click ‘OK’ to close the window
Update Excel Data in SQL  Cont. After the review of the data click ‘Next’ to move to Save and Run the data Click Next on the Save and Run the data window will start the process to import the data from Excel
Update Excel Data in SQL  Cont. Success import will result in all ‘Success’ in Status Review data, click ‘Finish’
Update Excel Data in SQL  Cont. Close the SQL Server Import and Export Wizard Go back to the SQL Server Management Studio window Click on ‘New Query’ Confirm desired database is in the drop down
Update Excel Data in SQL  Cont. Write the UPDATE script to insert the data in the temp table to the desired table Click ‘Execute’ or hit ‘F5’ on keyboard to run the script When script has run a message will appear to show how many rows were affected Query the table to confirm data
You CAN do it! Enjoy your “new ability”! Questions?

More Related Content

PDF
Java Linked List Tutorial | Edureka
PPSX
Java IO, Serialization
PDF
4 pillars of OOPS CONCEPT
PPTX
Introducción a Scala
ODP
An introduction to Apache Hadoop Hive
PPTX
PPTX
Factory Method Pattern
Java Linked List Tutorial | Edureka
Java IO, Serialization
4 pillars of OOPS CONCEPT
Introducción a Scala
An introduction to Apache Hadoop Hive
Factory Method Pattern

What's hot (20)

PPTX
Vector class in C++
PPTX
Binary Search Tree
PPT
Single row functions
PPTX
Ism normalization pine valley 2012
PPTX
Templates in C++
PPT
Data Structures with C Linked List
PPTX
Apache Hive
PPTX
Python OOPs
PPTX
[OOP - Lec 01] Introduction to OOP
PPS
PPT
Sql DML
PPTX
BASE DE DATOS (modelo jerárquico - diagrama entidad-relación
PPTX
Tema3 modelo relacional - normalización
PPT
List Data Structure
PPTX
Sql joins inner join self join outer joins
PDF
MVC Architecture
PPT
Object-Oriented Analysis and Design
PPTX
SQL - DML and DDL Commands
PPT
Hashing
PDF
Python programming : Abstract classes interfaces
Vector class in C++
Binary Search Tree
Single row functions
Ism normalization pine valley 2012
Templates in C++
Data Structures with C Linked List
Apache Hive
Python OOPs
[OOP - Lec 01] Introduction to OOP
Sql DML
BASE DE DATOS (modelo jerárquico - diagrama entidad-relación
Tema3 modelo relacional - normalización
List Data Structure
Sql joins inner join self join outer joins
MVC Architecture
Object-Oriented Analysis and Design
SQL - DML and DDL Commands
Hashing
Python programming : Abstract classes interfaces
Ad

Viewers also liked (20)

PPTX
Merchandising 101 User Manual
PPT
Merchandising guide
PPT
SureMail: Notification Overlay for Email Reliability
PDF
Linux Hosting Training Course Level 1-2
PPT
Microsoft PowerPoint presentation 2.175 Mb
PPT
PDF
Slide 1
PPT
SureMail: Notification Overlay for Email Reliability
PPT
Get your website noticed by Jason King of HAVS
PPTX
setting Dns linux debian
PPS
IT Power Management Strategy
PPT
Parallels Hosting Products
PPT
PPT
PPT
Slide 1 - Parallels Plesk Control Panel 8.6.0
PPT
Managing Diverse IT Infrastructure
PPT
Class Presentation
Merchandising 101 User Manual
Merchandising guide
SureMail: Notification Overlay for Email Reliability
Linux Hosting Training Course Level 1-2
Microsoft PowerPoint presentation 2.175 Mb
Slide 1
SureMail: Notification Overlay for Email Reliability
Get your website noticed by Jason King of HAVS
setting Dns linux debian
IT Power Management Strategy
Parallels Hosting Products
Slide 1 - Parallels Plesk Control Panel 8.6.0
Managing Diverse IT Infrastructure
Class Presentation
Ad

Similar to Excel and SQL Quick Tricks for Merchandisers (20)

PPTX
Excel 2010.01 edited
PPTX
Excel 2010.01 edited
PDF
I CS AI Advanced Excel Lab Manual-23UAISP21
PPTX
Lecture 1 Intro to Excel.pptx
PDF
Handouts how to use microsoft access to combine cost and usage data for ejour...
DOCX
Page 5 of 7Delete this text and type your name hereThis fi.docx
PPTX
Excel for research
DOCX
Itm310 problem solving #7 complete solutions correct answers key
DOC
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
PPTX
Lecture 1 Introduction to MS Excel.pptx
PPTX
Power Point Presentation for Introduction to Excel for understanding
DOCX
Formula of Excel for new user around the world.docx
PPTX
G10 Unit 4.pptx
PPTX
Office session10
PDF
BI Tutorial (Copying Data from Oracle to Microsoft SQLServer)
PPTX
Excel training
PPT
Microsoft Excel Project 1 Presentation
PPTX
DML Statements.pptx
PPT
Introduction to micro soft Training ms Excel.ppt
PPTX
UNIT 1 (3).pptx....................................
Excel 2010.01 edited
Excel 2010.01 edited
I CS AI Advanced Excel Lab Manual-23UAISP21
Lecture 1 Intro to Excel.pptx
Handouts how to use microsoft access to combine cost and usage data for ejour...
Page 5 of 7Delete this text and type your name hereThis fi.docx
Excel for research
Itm310 problem solving #7 complete solutions correct answers key
ORACLE PL/SQL TUTORIALS - OVERVIEW - SQL COMMANDS
Lecture 1 Introduction to MS Excel.pptx
Power Point Presentation for Introduction to Excel for understanding
Formula of Excel for new user around the world.docx
G10 Unit 4.pptx
Office session10
BI Tutorial (Copying Data from Oracle to Microsoft SQLServer)
Excel training
Microsoft Excel Project 1 Presentation
DML Statements.pptx
Introduction to micro soft Training ms Excel.ppt
UNIT 1 (3).pptx....................................

More from webhostingguy (20)

PPT
File Upload
PDF
Running and Developing Tests with the Apache::Test Framework
PDF
MySQL and memcached Guide
PPT
Novell® iChain® 2.3
PDF
Load-balancing web servers Load-balancing web servers
PDF
SQL Server 2008 Consolidation
PDF
What is mod_perl?
PDF
What is mod_perl?
PDF
Master Service Agreement
PPT
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PDF
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
PPT
Web design for business.ppt
PPT
OLUG_xen.ppt
PDF
Reseller's Guide
PDF
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
PDF
Getting Started Guide
PDF
"BEST MONEY TV HOST" CONSUELO MACK Launches Fifth Season on ...
PDF
Best Practises: Java OGSI Hosting Environment Design
PDF
Host Based Security Best Practices
File Upload
Running and Developing Tests with the Apache::Test Framework
MySQL and memcached Guide
Novell® iChain® 2.3
Load-balancing web servers Load-balancing web servers
SQL Server 2008 Consolidation
What is mod_perl?
What is mod_perl?
Master Service Agreement
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Web design for business.ppt
OLUG_xen.ppt
Reseller's Guide
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Getting Started Guide
"BEST MONEY TV HOST" CONSUELO MACK Launches Fifth Season on ...
Best Practises: Java OGSI Hosting Environment Design
Host Based Security Best Practices

Excel and SQL Quick Tricks for Merchandisers

  • 1. Excel and SQL Quick Tricks for Merchandisers Learn simple SQL queries to extract data from your SmartSite SQL tables Excel functions to edit your data with little effort Show and talk about real scenarios Update your SQL tables with the updated information to eliminate manual Content work Leah Fernelius
  • 2. Software Needs for Microsoft SQL and Microsoft Excel Microsoft SQL Server 2008 Express – Free at http:// www.microsoft.com /express/Database/ (on right side) Enable the ability to query and update your SmartSite SQL tables Contact Ability Support or your hosting company for connection information Microsoft Office Excel – any current version All Excel files created will need to be saved as .XLS
  • 3. SQL Query Components Every SQL query must have at least two components SELECT – control the data elements (columns) desired, such as, the item number or short description FROM – identify the table that contains the desired data Narrowing criteria and functions WHERE – narrow the desired data outcome Equal: = Less Than: < Greater Than: > Not Equal to: <> Contains: like Doesn’t Contain: not like Note: ‘like’ and ‘not like’ are used with the wildcard of %
  • 4. Microsoft SQL Management Tools Connect to your SQL server Select the desired database
  • 5. Common SmartSite Tables Common SmartSite Tables acBrands acGroups acItems acItemText MCEcom_Order MCEcom_ShoppingCart_LineItems MCEcom_User_Address Expand ‘Tables’ to see all of the SmartSite tables
  • 6. Helpful Microsoft Excel Functions CONCATENATE: =CONCATENATE(A1,” “,B1) Use to add data to the front, end, or put to fields together into one, such as First Name and Last Name into one field COUNT: =COUNT(A1:A20) Counts the number of cells that contain numbers. COUNTIF: =COUNTIF(B2:B25, “SmartSite”) Counts the number of cells in a range with a single criterion. EXACT: =EXACT(A2,B2) Compares two text strings returning TRUE for an exact match or FALSE if otherwise. EXACT is case-sensitive
  • 7. Helpful Microsoft Excel Functions Cont. LEFT: =LEFT(B2,3) Returns the first character or characters in a text string. If a number is not entered, then just the first character will be returned. If a number is entered, then the first positions for that count will be returned LEN: =LEN(A4) Counts the number characters in a text string MID: =MID(A2,1,5) Returns a specific number of characters from a text string, starting at a defined point. The example is for cell A2, first position, return 5 characters
  • 8. Helpful Microsoft Excel Functions Cont. PROPER: =PROPER(B2) Capitalizes the first letter in a text string and converts all other letters to lowercase. Great for product descriptions from an OMS. REPLACE: =REPLACE(C2,3,2,”10”) Replaces part of a text string, based on the number of characters specified, with the new text. C2 is the old text, 3 is the position to start at, 2 is the number of positions to remove, and “10” is the new text RIGHT: =RIGHT(A2,4) Returns the last character or characters in a text string. If a number is not entered, then only the last character will be returned. If a number is entered, then the last positions for that count will be returned
  • 9. Helpful Microsoft Excel Functions Cont. SUBSTITUTE: =SUBSTITUTE(B2,”MPW”,”Mack’s”) Substitutes new text for old text. “MPW” is the old text and “Mack’s” is the new text UPPER: =UPPER(C2) Convert text from mixed or lower to all upper case VLOOKUP: see handout available
  • 10. Scenarios Query the data in SQL Copy the queried data into Excel Manipulate the data in Excel using functions Review manipulated data Scenario One
  • 11. Update Excel Data in SQL Excel File Requirements for upload to SQL One identifying row such as an item number, item ID or EDP The file must contain column headings Save the file as .xls SQL Requirements Permissions to write to or update the database
  • 12. Update Excel Data in SQL Cont. Log into the SQL Server with the SQL tool installed Navigate to the desired database Right click on the desired database selecting: Tasks > Import Data The SQL Server Import and Export Wizard will open
  • 13. Update Excel Data in SQL Cont. Click ‘Next’ for the screen below In the Data Source Field select Microsoft Excel
  • 14. Update Excel Data in SQL Cont. Browse to the file to be imported to update SQL Verify the correct Excel Version displays in the drop down. If using MS Excel 2007 be sure the 2007 version displays Check box marked for ‘First row has column names’ Click ‘Next’
  • 15. Update Excel Data in SQL Cont. Destination: should be defaulted to ‘SQL Server Native Client 10.0’ Server name: will be the name of the SQL server Authentication: access information for SQL Database: should default to the database that was clicked to start this task Click ‘Next’
  • 16. Update Excel Data in SQL Cont. Select the radio button for ‘Copy data from one or more tables or views’ Click ‘Next’
  • 17. Update Excel Data in SQL Cont. Since the saved spreadsheet has only one sheet, check the box for ‘Sheet1$’ as shown In the Destination cell remove the text ‘Sheet1$’ and enter the desired temp. table name
  • 18. Update Excel Data in SQL Cont. Edit Mapping: allows for the review of the Source and Destination mappings Preview: display the data that will be imported
  • 19. Update Excel Data in SQL Cont. Edit Mapping window Review the Source and Destination columns shown Click ‘OK’
  • 20. Update Excel Data in SQL Cont. Preview Window Display the data to be imported into the temp table Click ‘OK’ to close the window
  • 21. Update Excel Data in SQL Cont. After the review of the data click ‘Next’ to move to Save and Run the data Click Next on the Save and Run the data window will start the process to import the data from Excel
  • 22. Update Excel Data in SQL Cont. Success import will result in all ‘Success’ in Status Review data, click ‘Finish’
  • 23. Update Excel Data in SQL Cont. Close the SQL Server Import and Export Wizard Go back to the SQL Server Management Studio window Click on ‘New Query’ Confirm desired database is in the drop down
  • 24. Update Excel Data in SQL Cont. Write the UPDATE script to insert the data in the temp table to the desired table Click ‘Execute’ or hit ‘F5’ on keyboard to run the script When script has run a message will appear to show how many rows were affected Query the table to confirm data
  • 25. You CAN do it! Enjoy your “new ability”! Questions?

Editor's Notes

  • #7: CONCATENATE: A1 would be the First Name, then I have a space “ “, then B1 is the Last Name COUNT: In the example from cells A1 thru A20 there is a mixture of text and numbers. Maybe only 5 cells have numbers, thus the result of 5 will be returned COUNTIF: Use to count the number of times a specific search term was used NOTES: You can use the wildcard characters ? matches any single character, * matches any sequence of characters Criteria are not case sensitive EXACT
  • #9: Be sure to get the note in regards to Proper when there is a word such as ‘hancock’s’ the Proper will change it to ‘Hancock’S’
  • #11: Talk about Scenarios (have them all setup before hand)
  • #25: Explain script components