{"id":24676400,"url":"https://github.com/anuppm9917/bank_database_management_mysql","last_synced_at":"2026-04-18T09:33:28.846Z","repository":{"id":251577688,"uuid":"837819351","full_name":"anuppm9917/Bank_Database_Management_MySQL","owner":"anuppm9917","description":"The bank database manages customer, account, branch, and loan data. It supports operations like sorting, joining tables, and filtering records by criteria, aiding in efficient banking data management and analysis.","archived":false,"fork":false,"pushed_at":"2024-08-04T06:33:39.000Z","size":338,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T12:14:53.948Z","etag":null,"topics":["database","database-management","mysql","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anuppm9917.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-04T06:07:37.000Z","updated_at":"2024-08-04T06:45:48.000Z","dependencies_parsed_at":"2024-08-04T07:27:31.608Z","dependency_job_id":"7668b108-e895-4a5e-bdc5-140b7c2654bf","html_url":"https://github.com/anuppm9917/Bank_Database_Management_MySQL","commit_stats":null,"previous_names":["anuppm9917/bank_database_mysql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuppm9917%2FBank_Database_Management_MySQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuppm9917%2FBank_Database_Management_MySQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuppm9917%2FBank_Database_Management_MySQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuppm9917%2FBank_Database_Management_MySQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anuppm9917","download_url":"https://codeload.github.com/anuppm9917/Bank_Database_Management_MySQL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244835575,"owners_count":20518263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","database-management","mysql","sql"],"created_at":"2025-01-26T12:14:57.581Z","updated_at":"2026-04-18T09:33:23.787Z","avatar_url":"https://github.com/anuppm9917.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bank Database Management with SQL\n# Description\n\nThis project demonstrates various SQL queries performed on a bank database, showcasing essential database management skills. The queries cover a range of functionalities, from data retrieval and sorting to complex joins and aggregations. This project is ideal for those looking to deepen their understanding of SQL and database interactions within the banking sector.\n\n**Database Structure**\n\nThe bank database consists of the following tables:\n\n**Customer Table:**\n\ncustid: Customer ID\n\nfname: First Name\n\nmname: Middle Name\n\nlname: Last Name\n\ncity: City\n\nmobileno: Mobile Number\n\noccupation: Occupation\n\ndob: Date of Birth\n\n**Account Table:**\n\nacnumber: Account Number\n\ncustid: Customer ID (Foreign Key)\n\naod: Account Open Date\n\nastatus: Account Status\n\n**Branch Table:**\n\nbid: Branch ID\n\nbcity: Branch City\n\n**Loan Table:**\n\nloanid: Loan ID\n\ncustid: Customer ID (Foreign Key)\n\nbid: Branch ID (Foreign Key)\n\nloan_amount: Loan Amount\n\n**SQL Queries for Bank Database**\n\nThis document provides detailed descriptions of various SQL queries executed on a bank database. Each query is designed to perform specific operations, from data retrieval and sorting to complex joins and aggregations.\n\n**Queries Description**\n\n**1. Ordering Customers by Year of Birth and First Name**\n\nSELECT custid, fname, mname, dob\n\nFROM customer\n\nORDER BY EXTRACT(YEAR FROM dob), fname ASC;\n\n**2. Concatenating Middle Name or Last Name**\n\nThis query selects customer details and concatenates the middle name or the last name, depending on the availability of the middle name.\n\nSELECT custid, fname, IF(mname IS NOT NULL, mname, lname) AS cust_name\n\nFROM customer;\n\n**3. Joining Account and Customer Tables**\n\nThis query joins the account and customer tables to retrieve account numbers along with the respective customer details and account open date.\n\nSELECT account.acnumber, customer.custid, customer.fname, customer.lname, account.aod\n\nFROM account\n\nINNER JOIN customer ON account.custid = customer.custid;\n\n**4. Counting Customers in a Specific City**\n\nThis query counts the number of customers residing in Delhi.\n\nSELECT (SELECT COUNT(city) FROM customer WHERE city = 'Delhi') AS Cust_Count;\n\n**5. Selecting Accounts Opened After a Certain Date**\n\nThis query retrieves customer and account details for accounts opened after the 15th day of any month.\n\nSELECT account.custid, customer.fname, account.acnumber\n\nFROM account, customer\n\nWHERE account.custid = customer.custid AND DAY(aod) \u003e 15;\n\n**6. Distinct Customer Details Based on Occupation**\n\nThis query retrieves distinct customer details for customers whose occupation is not business, service, or student.\n\nSELECT DISTINCT customer.fname, customer.city, account.acnumber\n\nFROM account, customer\n\nWHERE account.custid = customer.custid AND NOT(occupation='business' OR occupation='service' OR occupation='student');\n\n**7. Counting Branches by City**\n\nThis query counts the number of branches in each city.\n\nSELECT bcity, COUNT(*) AS Count_Branch\n\nFROM branch\n\nGROUP BY bcity;\n\n**8. Active Accounts Details**\n\nThis query retrieves account details for accounts that are active.\n\nSELECT account.acnumber, customer.fname, customer.lname\n\nFROM account, customer\n\nWHERE account.custid = customer.custid AND astatus = 'Active';\n\n**9. Loan Information with Customer and Branch Details**\n\nThis query retrieves loan details along with the respective customer and branch information.\n\nSELECT customer.custid, customer.fname, branch.bid, loan.loan_amount\n\nFROM ((loan INNER JOIN customer ON loan.custid = customer.custid)\n\nINNER JOIN branch ON loan.bid = branch.bid);\n\n**10. Terminated Accounts Details**\n\nThis query retrieves details of accounts that have been terminated.\n\nSELECT account.acnumber, customer.custid, customer.fname, customer.lname, account.astatus\n\nFROM account, customer\n\nWHERE customer.custid = account.custid AND astatus = 'Terminated';\n\nThese queries cover a wide range of database operations and are useful for managing and analyzing data within a banking context. They can be executed in any SQL client that supports MySQL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuppm9917%2Fbank_database_management_mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanuppm9917%2Fbank_database_management_mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuppm9917%2Fbank_database_management_mysql/lists"}