{"id":25733751,"url":"https://github.com/znev434/sql_advanced","last_synced_at":"2026-05-08T03:03:21.846Z","repository":{"id":279125437,"uuid":"937791171","full_name":"Znev434/SQL_Advanced","owner":"Znev434","description":"SQL_Advanced: A project demonstrating advanced SQL queries, data management, and analytics using SQLite and Flask.","archived":false,"fork":false,"pushed_at":"2025-02-23T22:29:41.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T23:24:27.953Z","etag":null,"topics":["django","flask","python","python3","sql","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Znev434.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":"2025-02-23T22:24:25.000Z","updated_at":"2025-02-23T22:30:40.000Z","dependencies_parsed_at":"2025-02-23T23:25:03.740Z","dependency_job_id":"9cac0903-0d4a-449c-bd79-0ae4cebc7318","html_url":"https://github.com/Znev434/SQL_Advanced","commit_stats":null,"previous_names":["znev434/sql_advanced"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Znev434%2FSQL_Advanced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Znev434%2FSQL_Advanced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Znev434%2FSQL_Advanced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Znev434%2FSQL_Advanced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Znev434","download_url":"https://codeload.github.com/Znev434/SQL_Advanced/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240790291,"owners_count":19858010,"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":["django","flask","python","python3","sql","sqlite3"],"created_at":"2025-02-26T04:22:37.131Z","updated_at":"2026-05-08T03:03:21.793Z","avatar_url":"https://github.com/Znev434.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Social Platform\n\nA simple web application built with Flask and SQLite, designed to manage users, posts, comments, and likes in a social media-like environment. This project showcases skills in relational database management (SQLite) and web development (Flask).\n\n## Features\n\n- **User Management**: Add and display users with unique usernames and emails.\n- **Posts**: Create and view posts linked to users.\n- **Comments**: Add and display comments for posts.\n- **Likes**: Record and view post likes with a uniqueness constraint.\n- **Analytics**: Execute advanced SQL queries, including user post counts, most commented posts, and top likers.\n- **Data Management**: Delete inactive users, old posts, and orphaned comments/likes; optimize the database.\n- **Data Export**: Export tables (users, posts, comments, likes, logs) to CSV files.\n\n## Technologies\n\n- **Python**: Programming language.\n- **SQLite**: Relational database featuring tables, foreign keys, indexes, and transactions.\n- **Flask**: Web framework for building the application.\n- **HTML/CSS**: Used for user interface design with forms and styling.\n- **Jinja2**: Templating engine for dynamic data rendering.\n\n## Project Structure\n\n```plaintext\nproject/\n├── static/\n│   └── style.css       # Interface styling\n├── templates/\n│   ├── index.html      # Home page\n│   ├── users.html      # Users page\n│   ├── posts.html      # Posts page\n│   ├── comments.html   # Comments page\n│   ├── likes.html      # Likes page\n│   ├── analytics.html  # Analytics page\n│   └── management.html # Management page\n├── database.py         # Database logic\n├── app.py              # Flask application\n└── database.sqlite     # Database file\n```\n\n## What I Achieved\n\n### SQLite\n- Designed a relational database with 5 tables, incorporating foreign keys and indexes for optimized queries.\n- Implemented CRUD operations with robust transaction handling and error management.\n- Developed advanced SQL queries for data analysis (e.g., JOIN, GROUP BY, HAVING).\n- Added functionality for exporting data to CSV and cleaning up the database (e.g., removing old posts).\n\n### Flask\n- Built a web application with a clear separation of concerns between database logic (database.py) and application logic (app.py).\n- Created dynamic endpoints with HTML forms for user input.\n- Integrated analytics and management pages that leverage comprehensive SQL functionalities.\n- Applied professional CSS styling to deliver an appealing user interface.\n\n## Example Usage\n- **Add a user**: Visit /users and add a user (e.g., \"user1\", \"user1@example.com\").\n- **Create a post**: Visit /posts and create a post (e.g., User ID 1, \"Test post\").\n- **Comment on a post**: Visit /comments to add a comment (e.g., User ID 1, Post ID 1, \"Test comment\").\n- **Like a post**: Visit /likes to like a post (e.g., User ID 1, Post ID 1).\n- **View analytics**: Check /analytics to view analytical data.\n- **Manage the database**: Use /management to perform administrative tasks.\n\n## Download\nDownload the entire project as a ZIP file by clicking the green \"Code\" button on GitHub and selecting \"Download ZIP\".\n\n## Author\nMichał Wenz","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznev434%2Fsql_advanced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznev434%2Fsql_advanced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznev434%2Fsql_advanced/lists"}