Based on the two tables and the attributes below, write SQL commands for each qu
ID: 2343297 • Letter: B
Question
Based on the two tables and the attributes below, write SQL commands for each question to retrieve the data from the database tblSales tblCustomer CustomerNumber CustomerName CustomerAddress1 CustomerAddress2 CustomerCity CustomerState CustomerZipCode CustomerTelephone CustomerCreditLimit CustomerPrimaryContact InvoiceNumber InvoiceDate CustomerNumber SalesOrderNumber Required: a. How many customer records are stored in the database? b. List customers who live in New York. c. List customers with credit limits greater than $50,000 d. List sales transactions made in July, 2018 e. What's the number of total sales transactions made to each customer?Explanation / Answer
a- How many customer records are stored in the database
SQL Command for knowing number of customer records are stored is
SELECT COUNT(Customer Name) FROM tblCustomer ;
b- List customers who live in New york.
SQL Command for knowing number of customers who live in New york
SELECT Customer State, FROM tblCustomer WHERE CITY = 'New york' ;
c- List customers who credit limits grater than $50,000.
SQL Command for knowing number of customers who's credit limit is grater than $50,000
SELECT CustomerCreditLimit, FROM tblCustomer WHERE Credit limit > 50,000 ;
d. List sales transaction made in July - 18
SQL Command for knowing sales in July - 18
SELECT InvoiceDate, FROM tblSales ;
e. What the number of total sales transactions made to each customer
SELECT COUNT(Salesordernumber) FROM tblSales ;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.