{"id":23118633,"url":"https://github.com/fabiliria280802/bd2-est-ndar","last_synced_at":"2026-03-16T18:33:22.555Z","repository":{"id":153560589,"uuid":"629760634","full_name":"fabiliria280802/BD2-est-ndar","owner":"fabiliria280802","description":"This project is a SQL script developed by ITIZ-2201 - DATABASE II students for various class exercises. The script automates the creation and configuration of a database named LabX, including the definition of custom data types, validation rules, tables, triggers, and a stored procedure to manage exam result entries.","archived":false,"fork":false,"pushed_at":"2025-03-22T00:47:08.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T01:26:17.185Z","etag":null,"topics":["database","microsoft-sql-server","sql"],"latest_commit_sha":null,"homepage":"","language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiliria280802.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-04-19T01:16:42.000Z","updated_at":"2025-03-22T00:48:09.000Z","dependencies_parsed_at":"2023-05-19T16:00:30.086Z","dependency_job_id":null,"html_url":"https://github.com/fabiliria280802/BD2-est-ndar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiliria280802%2FBD2-est-ndar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiliria280802%2FBD2-est-ndar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiliria280802%2FBD2-est-ndar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiliria280802%2FBD2-est-ndar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiliria280802","download_url":"https://codeload.github.com/fabiliria280802/BD2-est-ndar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247108607,"owners_count":20884931,"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","microsoft-sql-server","sql"],"created_at":"2024-12-17T05:19:10.054Z","updated_at":"2026-03-16T18:33:22.511Z","avatar_url":"https://github.com/fabiliria280802.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LabX Database Project\n\n## Overview\n\nThis project is a SQL script developed by ITIZ-2201 - DATABASE II students for various class exercises. The script automates the creation and configuration of a database named **LabX**, including the definition of custom data types, validation rules, tables, triggers, and a stored procedure to manage exam result entries.\n\n## Features\n\n- **Database Creation**  \n  - Checks if the **LabX** database already exists and deletes it if necessary, then creates a fresh instance.\n\n- **Custom Data Types \u0026 Validation Rules**  \n  - **`correo`**: A custom data type for storing email addresses.  \n  - **`cedulaIdentidad`**: A custom data type for storing Ecuadorian identity card numbers.  \n  - **Validation Rules**:  \n    - **`cedulaIdentidad_rule`**: Ensures that the identity card number adheres to the Ecuadorian format and verification algorithm.\n    - **`correo_rule`**: Validates that email addresses conform to required standards (e.g., proper format, valid length for both username and domain).\n\n- **Table Creation \u0026 Triggers**  \n  - **Tables**:  \n    - **Paciente**: Stores patient information such as identity card, name, email, phone, date of birth, and blood type.  \n    - **Examen**: Contains details of medical exams, including exam name, normal value ranges, fasting indicator, and days to deliver the result.  \n    - **Resultado**: Records exam results, linking patients and exams via foreign keys. It also validates the sequence of dates (order, exam, and delivery dates).\n  - **Triggers**:  \n    - Ensure data integrity by preventing unauthorized or direct changes to critical fields like `usuarioRegistro` (system user) and `fechaRegistro` (record timestamp).\n\n- **Stored Procedure**  \n  - **`ingresoResultado`**:  \n    - Facilitates the insertion of exam results into the **Resultado** table by accepting the exam name, patient's identity card, and relevant date values.\n    - Verifies the existence of both the exam and the patient before performing the insertion.\n\n- **Sample Data Insertion**  \n  - Provides example insertions into the **Paciente** and **Examen** tables.\n  - Demonstrates the use of the stored procedure to insert an exam result.\n\n## How to Use\n\n1. **Execute the Script**:  \n   Run the SQL script on your SQL Server. The script will:\n   - Create the **LabX** database.\n   - Define custom data types and validation rules.\n   - Create the required tables and triggers.\n   - Set up the stored procedure for inserting exam results.\n   - Insert sample data to help you get started.\n\n2. **Customize**:  \n   Modify the sample data, validation rules, or table definitions as needed to fit your project's requirements.\n\n## Authors\n\n- ITIZ-2201 Students\n- University of the Americas\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiliria280802%2Fbd2-est-ndar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiliria280802%2Fbd2-est-ndar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiliria280802%2Fbd2-est-ndar/lists"}