Question

In: Computer Science

In sql: Write a query to produce a listing of unique vendor names who have at...

In sql: Write a query to produce a listing of unique vendor names who have at least one invoice with us. You are using a table view called COMPANY_INFORMATION that lists a vendor id, vendor name, term id, and term description. The second table you will reference is the invoice table that lists vendor id, invoice num, invoice number, and invoice total. Do not show duplicate results.

Solutions

Expert Solution

Use Following query to produce a listing of unique vendor names who have at least one invoice with us.

SELECT DISTINCT vendorName FROM COMPANY_INFORMATION ci JOIN Invoice i ON ci.vendorId = i.vendorId;

We can join table using vendorId and for unique names use DISTINCT keyword.


Related Solutions

1. Write a query in SQL to find the full name of the “Actors” who appeared...
1. Write a query in SQL to find the full name of the “Actors” who appeared in the movie titled Star Wars (using JOIN ). 2.Write a SQL query to find the movie Title that has received Lowest rating from reviewers, but whose actors have received an award for their contribution in movie. (Expected Output: Fantastic Beasts and Where to Find Them) 3.Write a SQL query that display the list of genres, Number of movies in that genre grouped by...
How to write a query in SQL using the Group by function to decide if the...
How to write a query in SQL using the Group by function to decide if the results of the diet worked. There are 6 columns ID, Gender, treatment, start_weight_kg, end_weight_kg, and correct change (end weight minus start weight). With the information given write a SQL to determine if the the results(correct change) worked. Question is not incomplete.
1.Write an SQL query that retrieves all pairs of suppliers who supply the same product, along...
1.Write an SQL query that retrieves all pairs of suppliers who supply the same product, along with their product purchase price if applicable. 2.Create a view SUPPLIEROVERVIEW that retrieves, for each supplier, the supplier number, the supplier name, and the total amount of quantities ordered. Once created, query this view to retrieve suppliers for whom the total ordered quantity exceeds 30. 3.Write a nested SQL query to retrieve all purchase order numbers of purchase orders that contain either sparkling or...
5. Write the SQL query that accomplishes the task in the ZAGI Retail Company Sales Department...
5. Write the SQL query that accomplishes the task in the ZAGI Retail Company Sales Department Database: 5.1.3. Display the CustomerName and CustomerZip for all customers, sort alphabetically by CustomerName. 5.1.4. Display the RegionID of regions where we have stores (use only table STORES and do not display the same information more than once). 5.1.5 Display all the information for all stores whose ReigionID value is C 5.1.8 Display the ProductID, ProductName, ProductPrice, and VendorName for all products. Sort the...
Write the names of 12 people who have, in some way, shaped who it is that...
Write the names of 12 people who have, in some way, shaped who it is that you have become. These might be from your past or your present, real or fictional, someone whom you may or may not have actually met, someone who affected you in a positive or a negative way, etc. After each name, write a sentence or two about the way(s) in which the person influenced your identity. Example: 1. Mother—She instilled a sense of responsibility in...
Write a SQL query to find the movie Title that has received Lowest rating from reviewers,...
Write a SQL query to find the movie Title that has received Lowest rating from reviewers, but whose actors have received an award for their contribution in movie. Output: Fantastic Beasts and Where to Find Them            //   THE DATABASE // DROP DATABASE IF EXISTS cs431_movie_database; CREATE DATABASE cs431_movie_database; USE cs431_movie_database; CREATE TABLE `artists` ( `artist_id` INT NOT NULL AUTO_INCREMENT, `first_name` varchar(45) NOT NULL, `last_name` varchar(45) NOT NULL, `contact_no` varchar(15) DEFAULT NULL, `Profession` TEXT DEFAULT NULL, `birth_date` datetime DEFAULT NULL,...
Write SQL queries below for each of the following: List the names and cities of all...
Write SQL queries below for each of the following: List the names and cities of all customers List the different states the vendors come from (unique values only, no duplicates) Find the number of customers in California List product names and category descriptions for all products supplied by vendor Proformance List names of all employees who have sold to customer Rachel Patterson
Step 1: Write SQL to List the information delivered (PO number, order date, vendor ID &...
Step 1: Write SQL to List the information delivered (PO number, order date, vendor ID & name, product ID & name, Product quantity) of transaction records, sorted by order date? Step 2: Write SQL For orders that were placed between 9/1/2016 and 9/30/2016, list (product IDs, product names, order dates, PO numbers) sort by order date Step 3: Write SQL and find In the month of August, which vendor received the smallest order for a product in terms of dollars?...
Create a ‘Student’ table using SQL query. The table must have at least five attributes from...
Create a ‘Student’ table using SQL query. The table must have at least five attributes from your choice with different data types.
It was published that children who have longer first names tend to achieve higher grades (%)...
It was published that children who have longer first names tend to achieve higher grades (%) in elementary school. For example, Zai (short name, only three letters) may achieve a lower grade than Kabiralina (much longer name, ten letters). A study was conducted to investigate the influence of name length on grades from a local sixth grade class. Is there such a relationship?   NAMES GRADES Aaralyn 76 Baldasarre 72 Cai 84 Daenerys 71 Ean 74 Famke 79 Gainella 73 Hakizimana...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT