SQL query代写 The above query uses a built-in WEEK() function of MySQL, it returns the number of week from the starting of the specific year

SQL query代写
SQL query代写

1).

The company had 10 trades during 8/5/2019 to 8/10/2019. The 10 trades involve 4 companies, namely “ABC”, “CDE”, “FGH” and “3CDE”. Among the 10 trades, the company is on the BUY side 5 times, with quantity-price pairs (200 – 41, 601 – 60, 200 – 62, 300 – 40 and 2100 71). The total value of BUYs is 217760. The company is on the SELL side 4 times with pairs (600 – 70, 600 – 70, 300 – 30 and 1100 – 63) and a total value of 162300. The X side has 300 quantity and a price of 61 per share, thus 18300 in total.SQL query代写

2).

SQL query代写
SQL query代写

 

3).

The expected result table contains all the columns of the original table and a new Tier column based on the quantity. The following picture is the result for the query.SQL query代写

SQL query代写
SQL query代写

1).

2
2

 

 

 

2).

The above query uses a built-in WEEK() function of MySQL(version 4.0 or up), it returns the number of week from the starting of the specific year(takes the t_date as the parameter, it returns the number of weeks of the trade record).  Then the query select side column and sum up all the quantities for each side(B, S, X).SQL query代写

The following picture is the result for the query.

3
3

 

 

 

 

1).

This query joins two tables using Cusomers.customer_id and Orders.customer_id.

4
4

 

 

Exact Results for the above SQL query:

5
5

2).

Assumptions: This SQL query assumes that for every record in ORDERS, there is a unique customer in CUSTOMERS corresponding to it. This assumption may not hold since ORDERS table gets updated at the end of every day and CUSTOMERS table gets updated at the end of every week. So, there is a chance that an order from ORDERS has a customer_id that is not in the CUSTOMERS table.SQL query代写

3).

If the business has no extra information about the order.Then the following query can be used to narrow the search. It returns all the completed orders.

6

 

 

 

Sample Output:

7
7

Now Assume the user knows the date of the mistake, we can add another filter into the where clause:

8
8

 

 

 

Sample Output:

9
9

If the user knows the customer name corresponding to this wrong order, we can use the following query:

10
10

 

 

 

Sample Output:

SQL query代写
SQL query代写

 

4).

Assumption: If the user knows which date the order is processed mistakenly. Then the following query can be used to narrow the search:SQL query代写

A).

The first SQL query statement is valid in the syntax, but the result is meaningless. The expected results of the query is a table containing information for each gender(F/M) the number of customers and the number of distinct customers based on counting customerIDs in the Customers table (CustomerIDs may be duplicated although the customerIDs should theoretically be the primary key – the unique identifier for each record – so the two count should have the same number). But the query also sums all the distinct customerID, which does not make sense, because the customerID is a unique identifier for customers. Summing up customers IDs gives no information about the data.SQL query代写

The following picture is the result for the query on the Customers table.

SQL query代写
SQL query代写

B).

The second SQL query statement is valid and provides meaningful results. The expected results of the query is a table containing information for each gender(F/M) the number of customers and the number of distinct customers based on counting customerIDs in the Customers table just like the query above. The result table also contains the number of distinct ages of customers for each gender.SQL query代写

The following picture is the result for the query on the Customers table.

SQL query代写
SQL query代写

How to make a cup of tea:

To make a cup of tea, you need to prepare a clean kettle, a cup, a tea bag or 1 teaspoon of loose tea, some milk, and sugar. SQL query代写

First, fill an empty kettle with 500ml fresh, cold water and bring the water to a boil. Next, rinse out the cup with boiling water before place the tea bag. If you prefer to use loose tea, spoon in 1 teaspoon per cup. Then you need to pour water into your cup. Leave room for milk if you wish to add that. Let your tea steep for three minutes. Add milk and sugar if you wish after removing the tea bag or loose tea. Now a cup of tea is ready, and you can enjoy it.SQL query代写

 

更多其他:Essay代写  研究论文代写  代写CS  数据分析代写  Assignment代写  prensentation代写 Case study代写  文学论文代写  商科论文代写

合作平台:天才代写 幽灵代写  写手招聘

 

 

1 Comment