DEMO S.Q.L : PROJECT TWO.
๐ PROJECT 2 โ PostgreSQL DatingDB Database Analysis ๐ป Welcome to Project 2 of my SQL and PostgreSQL database development journey. In this project, I designed and built a complete relational database system called DatingDB using PostgreSQL. The goal of this project was to simulate a real-world dating application database while demonstrating professional database design principles, normalization, relational modeling, constraints, indexing, and advanced SQL techniques. This database was carefully structured to manage contact profiles, professions, relationship statuses, interests, locations, and dating preferences. Every table was connected using primary keys and foreign keys to maintain strong data integrity and efficient relationships between records. The project also includes bridge tables for many-to-many relationships, SQL views for reporting, and multiple validation rules to protect data consistency. ๐ TABLES INCLUDED IN THE PROJECT โ profession Stores unique professions such as Software Engineer, Teacher, Doctor, Designer, Entrepreneur, Nurse, Lawyer, Architect, and Marketing Manager. A UNIQUE constraint prevents duplicate profession names from being inserted into the database. โ zip_code Stores South African zip codes, cities, and provinces. The table contains all 9 provinces with 2 cities each, giving a total of 18 rows of location data. A CHECK constraint ensures that zip codes remain within the valid 4-digit range. โ status Stores relationship statuses including Single, Divorced, Widowed, and Separated. โ my_contacts The main table in the database. It stores user information including first names, last names, birthdays, gender, phone numbers, emails, professions, locations, and relationship status. โ interests Stores hobbies and interests such as Hiking, Gaming, Reading, Music, Fitness, Photography, Dancing, Painting, Cooking, and Travel. โ seeking Stores relationship goals including Friendship, Marriage, Casual Dating, Long-term Relationships, and Short-term Relationships. โ contact_interest A bridge table connecting contacts to their interests using a many-to-many relationship. Every contact in the project has at least 3 interests as required by the project guidelines. โ contact_seeking Another bridge table connecting contacts to their relationship preferences and dating goals. ๐ ADVANCED SQL FEATURES USED โ Primary Keys โ Foreign Keys โ UNIQUE Constraints โ CHECK Constraints โ Many-to-Many Relationships โ Composite Primary Keys โ Cascading Updates and Deletes โ SQL Views โ Indexes for Query Optimization โ Aggregate Functions โ STRING_AGG() โ Referential Integrity โ Data Validation Rules ๐ SQL VIEWS CREATED ๐น vw_contact_profile Combines contact details with professions, provinces, cities, zip codes, and relationship statuses into a single easy-to-query profile view. ๐น vw_contact_interests Uses STRING_AGG() to display all interests connected to each contact in one row. ๐น vw_contact_seeking Displays relationship goals and dating preferences for every contact. ๐ SAMPLE DATA INCLUDED The project contains: โ 16 contacts โ 10 professions โ 10 interests โ 5 seeking categories โ 18 South African city and province combinations โ Multiple many-to-many relationship records ๐ CONSTRAINT VIOLATION TESTS This project also demonstrates how PostgreSQL handles invalid data using intentional error tests: โ Duplicate profession insertion โ Invalid zip code insertion โ Foreign key violations โ Duplicate email violations These tests prove that the database correctly enforces integrity and validation rules. ๐ WHAT I LEARNED Through this project I improved my understanding of: ๐น Relational database design ๐น PostgreSQL development ๐น Data normalization ๐น Query optimization ๐น Constraint management ๐น Many-to-many relationships ๐น SQL reporting views ๐น Real-world database architecture ๐ TOOLS USED ๐ PostgreSQL ๐ SQL ๐ pgAdmin ๐ Relational Database Modeling This project helped me strengthen my backend development and database engineering skills while building a scalable and realistic SQL system from scratch. If you enjoy SQL, PostgreSQL, data analysis, and database development content, make sure to like, comment, and subscribe for more programming projects and tutorials. This project was created to demonstrate how professional databases are planned, structured, and tested in real-world environments. The system was designed with scalability, readability, and maintainability in mind. Every relationship was carefully connected to reduce redundancy and improve consistency across the database. By completing this project, I gained practical experience with PostgreSQL development, schema design, data validation, and relational modeling techniques used in modern software engineering careers. ๐ PLEASE LINK: If you enjoy SQL, PostgreSQL, database, software engineering, #PostgreSQL #SQL #DatabaseDesign #Programming #BackendDevelopment #DataAnalysis #SoftwareEngineering #LearnSQL #pgAdmin #DatabaseProject
Download
0 formatsNo download links available.