Question

In: Computer Science

Test-case Queries (DML) At least 10 test queries (pertaining to warehouse management) You must use the...

Test-case Queries (DML)

At least 10 test queries (pertaining to warehouse management)

You must use the following clauses in one or more of your test queries :

[ FROM, WHERE, GROUP BY, HAVING, ORDER BY ]

You must use the following statement options in one or more of your test queries :

[ column aliases, computed columns, SQL’s DISTINCT clause, JOIN ON syntax ]

You must use at least one of the special operators in one or more of your test queries :

[ BETWEEN, IN, LIKE, IS NULL, NOT ]

You must use at least one of the aggregate functions in one or more of your test queries :

[ Count, MIN, MAX, SUM, AVG ]

Solutions

Expert Solution

Hello, Student I hope you are doing great in lockdown.

Here is Test-case Queries for the following test cases, if still you have any doubt then feel free to ask in comment section, I am always happy to help you.

Please upvote.

What is DML?

DML stands for data manipulation language.

DML is a computer programming language used for adding , deleting, and updating data in a database.

Q1) You must use the following clauses in one or more of your test queries :

[ FROM, WHERE, GROUP BY, HAVING, ORDER BY ]

FROM - Provides the Data Source for the Query

WHERE - Filters Out Rows From the Data Source Based on Boolean Validation Conditional Expression

GROUP BY - GROUP BY query groups rows that have the same value into summary rows.

HAVING - HAVING was added to sql because the WHERE keyword could not be used with aggregate functions.

ORDER BY - Sort the result-set in ascending or descending order.

Queries: -

SELECT Salesperson, AVG(TotalSale)
 FROM SALES
 GROUP BY Salesperson;

SELECT * FROM Customers
ORDER BY Country;

SELECT * FROM Customers
WHERE Country='Mexico';

SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country
HAVING COUNT(CustomerID) > 5
ORDER BY COUNT(CustomerID) DESC;

Q2) You must use the following statement options in one or more of your test queries :

[ column aliases, computed columns, SQL’s DISTINCT clause, JOIN ON syntax ]

SQL Aliases: - used to give a table, or a column in a table, a temporary name and used to make column names more readable.

column aliases: -

SELECT CustomerID AS ID, CustomerName AS Customer FROM Customers;

computed columns:- Also known as Generated columns,columns are computed based on predefined expressions.

CREATE TABLE test.Product (
id INT NOT NULL AUTO_INCREMENT,
amount DECIMAL(10,2) NULL,
sold_out DECIMAL(10,2) NULL,
faulty DECIMAL(10,2) NULL,
remain_amount DECIMAL(10,2) NULL,
PRIMARY KEY (id));

DISTINCT:- DISTINCT clause is used to remove duplicate records from the table and fetch only the unique records.

-- SELECT DISTINCT officer_name, address FROM officers;

Q3) You must use at least one of the special operators in one or more of your test queries :

[ BETWEEN, IN, LIKE, IS NULL, NOT ]

BETWEEN - selects values within a given range

SELECT * FROM Products WHERE Price BETWEEN 10 AND 20;

IN - IN operator allows you to specify multiple values in a WHERE clause

SELECT * FROM Customers WHERE Country IN ('Germany', 'France', 'UK');

LIKE - used in a WHERE clause to search for a specified pattern in a column

SELECT * FROM Customers WHERE CustomerName LIKE 'a%';

IS NULL - column value does not exist. (server based query)

NOT - The NOT operator displays a record if the condition is NOT TRUE

SELECT * FROM Customers WHERE NOT Country='Germany';

Q4) You must use at least one of the aggregate functions in one or more of your test queries :

[ Count, MIN, MAX, SUM, AVG ]

Count-  COUNT() function returns the number of rows in a table satisfying the criteria specified in the WHERE clause.

SELECT COUNT(ProductID) FROM Products;

MIN - MIN() function gives the minimum value of the selected column.

SELECT MIN(Price) AS SmallestPrice FROM Products;

MAX - MAX() function gives the maximum value of the selected column.

SELECT MAX(Price) AS LargestPrice FROM Products;

SUM - SUM() function returns the total sum

SELECT SUM(Quantity) FROM OrderDetails;

AVG - AVG() function returns the average value

SELECT AVG(Price) FROM Products;

I have included 20 test queries to understand everything.

Please do not forget to hit that like or thumbs-up button, it really motivates me<3

Thank you!!

Have a nice day:)


Related Solutions

Section 1.You must use sub-queries to answer section 1questions.Q1:  List the length of the...
Section 1. You must use sub-queries to answer section 1 questions. Q1:  List the length of the longest track in the 'metal' genre. Q2: List the artistid, artistname and entrydate of all artists whose entrydate is earlier than everyone who has a 'directmail' leadsource. Q3: List the artistid, artistname and entrydate of all artists whose entrydate is earlier than anyone who has a 'directmail' leadsource. Q4:  List the artistname and entrydate of the artist with the earliest entry date. Q5:  ...
Use at least 10 of the following terms in an essay. You should not define the...
Use at least 10 of the following terms in an essay. You should not define the terms in the essay, but rather use the terms to create a story. 1. Asymmetric information 2. Asset stripping 3. Thatcherism 4. Perfect markets 5. Inequality 6. Seniority wages 7. Mittelstand 8. Flexicurity 9. Externalities 10. Laissez-faire 11. Monopoly 12. Incentives 13. Capture of regulatores 14. Crony capitalism 15. Commanding heights 16. Privatization 17. Economic mobility 18. Rule of law 19. Seigniorage 20. Intensive...
EXCEL: Complete the loan amortization schedule in the green cells below. You must use at least...
EXCEL: Complete the loan amortization schedule in the green cells below. You must use at least one of the following formulas (PMT, IPMT, PPMT) in your solution. Years Periods per year 30 12 Period PMT Interest Principal Paid Balance Annual Interest Rate Lump Sum 0 350,000.00 1 0.08 2 0.08 3 0.08 10,000.00 4 0.08 5 0.08 6 0.08 7 0.08 8 0.08 9 0.08 10 0.08 11 0.08 12 0.08 13 0.085 14 0.085 15 0.085 16 0.085
Case Questions/Information: The responses to the case questions must be typed. You must turn a printed...
Case Questions/Information: The responses to the case questions must be typed. You must turn a printed copy by the beginning of class on the day that the case is due. You may work alone or in a group of up to 4 students. Only 1 copy of the case is required for any groups, but please be sure that all students’ names are included on that copy. You should use an Excel spreadsheet to show your calculations. Any text responses...
When you perform a test of hypothesis, you must always use the 4-step approach: i. S1:the...
When you perform a test of hypothesis, you must always use the 4-step approach: i. S1:the “Null” and “Alternate” hypotheses, ii. S2: manually calculate value of the test statistic, iii. S3: specify the level of significance and the critical value of the statistic, iv. S5: use appropriate decision rule and then reach a conclusion about not rejecting or rejecting the null hypothesis. S5: If asked to calculate p–value,do so and relate the p-value to the level of significance in reaching...
Can anyone provide an example of when you would use Fisher’s least significant difference test and...
Can anyone provide an example of when you would use Fisher’s least significant difference test and example of when you would use Tukey’s honestly significant difference test? How do these 2 tests differ?
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience...
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience of running an auto-parts business as a supplier in a major city of Australia. The current warehouse management system is not able to handle highly dynamic procedures that can help them move and store inventory at peak efficiency and lowest cost. Jack and Daniel have decided to develop a new Auto-Parts Warehouse Management System where its functionality can be applied throughout all core warehouse...
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience...
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience of running an auto-parts business as a supplier in a major city of Australia. The current warehouse management system is not able to handle highly dynamic procedures that can help them move and store inventory at peak efficiency and lowest cost. Jack and Daniel have decided to develop a new Auto-Parts Warehouse Management System where its functionality can be applied throughout all core warehouse...
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience...
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience of running an auto-parts business as a supplier in a major city of Australia. The current warehouse management system is not able to handle highly dynamic procedures that can help them move and store inventory at peak efficiency and lowest cost. Jack and Daniel have decided to develop a new Auto-Parts Warehouse Management System where its functionality can be applied throughout all core warehouse...
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience...
Case Study: Auto-Parts Warehouse Management System Jack Greig and Daniel Cox have several years of experience of running an auto-parts business as a supplier in a major city of Australia. The current warehouse management system is not able to handle highly dynamic procedures that can help them move and store inventory at peak efficiency and lowest cost. Jack and Daniel have decided to develop a new Auto-Parts Warehouse Management System where its functionality can be applied throughout all core warehouse...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT