Hello community, can anyone provide me the answers please? I am not a MySQL guy, i know that this is not an excuse, but this is how it is. Thanks in advance.
Employee (**Employee ID**, Employee Name, Employee Last Name)
Director (**Employee Code**)
Cashier (**Employee Code**)
Customer (**Code Card**, Customer Name, Customer Name, Address)
Branch (**Branch Code**, Name, Address)
Works At (**Employee Code**, **Branch Code**)
Fund (**Fund Code**, Number, Branch Code)
Shift (**Cashier Code**, **Fund Code**, **Start**, End)
Product (**Product Code**, Description)
Available (**Product code**, **Branch Code** )
Market (**Market Code**, Timestamp, Fund Code)
Buys (**Customer ID**, **Market Code**)
Includes (**Market Code**, **Product Code**, Quantity, Unit Price)
Run the following SQL queries to SQL Server.
Which branches have the product code X? The answer has to include the branch code, branch name and address.
What is the average value of transactions in the branch store with code Y; The answer has to include the branch name, address and the average value of transactions.
What are the top three in total purchasing customers of the chain? The answer has to include the full name customer, address and amount he spent.
What are the new products that not yet launched in the branches and therefore not participate in any buy? The answer has to include the code and description of the product.
Who is the manager of each branch? The answer has to include the branch code shop and the name of the director.
Implement using trigger in MySQL, the following rules:
During the recording of shifts in the corresponding table, there should not be allowed to import, if the cashier does not work in the shop where the specific cash machine was registered.
For a cash machine, there should be not allowed to register the begining of a shift before the ending registration of the previous.
The director of a branch can not be registered as a cashier or versa.
There may not be more than one directors for the same branch.