Back to Browse

DEMO S.Q.L : PROJECT TWO.

May 19, 2026
8:07

๐Ÿš€ 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 formats

No download links available.

DEMO S.Q.L : PROJECT TWO. | NatokHD