Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the console, write SQL queries to answer the following questions: 1. List all columns for the LGBrand table, ordered by BRAND_TYPE 2. For this

image text in transcribedimage text in transcribed

Use the console, write SQL queries to answer the following questions: 1. List all columns for the LGBrand table, ordered by BRAND_TYPE 2. For this same table, report the number of brands manufactured for each BRAND_TYPE. The columns should be renamed to more reasonable names. 3. List for each state the number of customers who have non-zero balances. 4. For 3, show only states with more than 100 customers. 5. For 4, order the output by State in reverse alphabetic order 6. For 3, show only states with more than 100 customers, ordered by number of customers (fewest first). 7. List the number of products purchased for each Brand Type, in the State of Maine (ME) 8. Modify query 7 to show state/brand type product sales less than 10. 9. Who is the newest employee and how long have they been with the company? List only the one employee. LGVENDOR LGDEPARTMENT LGBRAND BRAND_ID DECIMAL (4,0) BRAND_NAME VARCHAR(100) BRAND_TYPE VARCHAR(20) Indexes VEND_ID DECIMAL(6,0) VEND NAME VARCHAR(255) VEND_STREET VARCHAR(50) VEND_CITY VARCHAR(50) VEND_STATE VARCHAR(2) VEND_ZIP VARCHAR(5) Indexes DEPT_NUM DECIMAL(5,0) DEPT_NAME VARCHAR(50) DEPT_MAIL_BOX VARCHAR(3) DEPT_PHONE VARCHAR(9) EMP_NUM DECIMAL(6,0) Indexes LGSUPPLIES PROD SKU VARCHAR(15) VEND_ID DECIMAL(6,0) Indexes LGSALARY HISTORY EMP NUM DECIMAL(6,0) SAL FROM DATE SAL END DATE SAL_AMOUNT DECIMAL (10,2) Indexes LGEMPLOYEE EMP_NUM DECIMAL(6,0) EMP_FNAME VARCHAR(20) EMP_LNAME VARCHAR(25) EMP_EMAIL VARCHAR(25) EMP_PHONE VARCHAR(20) EMP_HIREDATE DATE EMP_TITLE VARCHAR(45) EMP_COMM DECIMAL(2,2) DEPT_NUM DECIMAL(5,0) Indexes LGPRODUCT PROD SKU VARCHAR(15) PROD DESCRIPT VARCHAR(255) PROD TYPE VARCHAR(255) PROD_BASE VARCHAR(255) PROD_CATEGORY VARCHAR(255) PROD_PRICE DECIMAL(10,2) PROD QOH DECIMAL(10,0) PROD_MIN DECIMAL(10,0) BRAND_ID DECIMAL (4,0) Indexes LGCUSTOMER CUST_CODE DECIMAL(38,0) CUST_FNAME VARCHAR(20) CUST_LNAME VARCHAR(20) CUST_STREET VARCHAR(70) CUST_CITY VARCHAR(50) CUST_STATE CHAR(2) CUST_ZIP CHAR(5) CUST_BALANCE DECIMAL(8,2) Indexes LGLINE INV NUM DECIMAL(38,0) LINE_NUM DECIMAL (10,0) PROD_SKU VARCHAR(15) LINE QTY DECIMAL (10,0) LINE PRICE DECIMAL(8,2) Indexes LGINVOICE INV_NUM DECIMAL(38,0) INV_DATE DATE #CUST_CODE DECIMAL(38,0) INV_TOTAL DECIMAL(11,2) EMPLOYEE_ID DECIMAL (6,0) Indexes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions