![]() There are 2 Tables: user_financial_detail, transaction_log. If the user is overdrawn by more than the credit limit, return 'YES' in this column. It documents MySQL 5.7 through 5.7.44, as well as NDB Cluster releases based on version 7.5 of through 5.7.43-ndb-7.5.31, respectively. The credit_limit_breached column should contain either 'YES' or 'NO'. Including MySQL NDB Cluster 7.5 and NDB Cluster 7.6. Write a query that prints this information for all the users present in the table user_finincial_detail in the following format: name | vpa | current_balance | credit_limit_breached ERROR 1064 (42000) at line 1: You have an error in your SQL syntax check the manual that corresponds to your MySQL server version for the right syntax to. statement of the script version of MySQL 5. VWB wants to find out the current balance of all the users who have ever transacted and check whether they have breached their credit limit. Since MySQL 8.0 this query is much easier, using the ROWNUMBER function: SELECT name, year, month FROM ( SELECT name, year, month, ROWNUMBER() OVER (PARTITION BY name ORDER BY year DESC, month DESC) AS rn FROM example ) t WHERE rn < 2. ![]() The VWB records all such transactions in the table transaction_log, storing information such as the sender's vpa, receipient's vpa and the amount transferred. It maintains its customer details like name, vpa and credit limit in the table user_financial_detail.Įach user can easily transfer money from his/her account to another VWB user's account by using his/her uniquely assigned vpa and receipt user's vpa. Virtual World Bank (VWB) helps its users in making online payments using virtual payment address (vpa). SET max (SELECT count () FROM Hackers h, Challenges c WHERE h.hackerid c.hackerid GROUP BY h.hackerid, h.name ORDER BY count () DESC LIMIT 1) SELECT h.hackerid, h. My solution could use some CTEs to clean it up. Build skills-based coding tests with tech problems a developer would encounter on the job and hire the team behind your next big idea. Coursera: Learn SQL Basics for Data Science I am not sure if this is HackerRanks issue or mine. Start free trial Focus on what really matters: the code.edureka: SQL Essentials Training & Certification.Please make use of my blog posts for learning purposes only and feel free to ask your questions in the comment box below in case of any doubt. It will help you learn and understand SQL in a better way. ![]() Here I am providing my solution to the problem 'Bank Accounts Summary'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |