{"id":19244435,"url":"https://github.com/ghazaleze/mydatabaselab","last_synced_at":"2026-03-19T08:54:46.085Z","repository":{"id":109419640,"uuid":"255560168","full_name":"GhazaleZe/MyDataBaseLab","owner":"GhazaleZe","description":"IUT database lab, SQL","archived":false,"fork":false,"pushed_at":"2021-01-08T18:03:52.000Z","size":43,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T15:14:27.503Z","etag":null,"topics":["sql-server-management-studio","tsql"],"latest_commit_sha":null,"homepage":"","language":"TSQL","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/GhazaleZe.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":"2020-04-14T09:02:30.000Z","updated_at":"2022-04-27T21:11:28.000Z","dependencies_parsed_at":"2023-03-22T21:49:23.678Z","dependency_job_id":null,"html_url":"https://github.com/GhazaleZe/MyDataBaseLab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GhazaleZe/MyDataBaseLab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FMyDataBaseLab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FMyDataBaseLab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FMyDataBaseLab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FMyDataBaseLab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GhazaleZe","download_url":"https://codeload.github.com/GhazaleZe/MyDataBaseLab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FMyDataBaseLab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29993540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["sql-server-management-studio","tsql"],"created_at":"2024-11-09T17:23:32.464Z","updated_at":"2026-03-02T06:01:58.943Z","avatar_url":"https://github.com/GhazaleZe.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MyDataBaseLab      :smiley:\n\n\u003e I'm passing this database lab from home because of COVID-19 :mask:.  \n\u003e I wish good health for people all over the world  \t:heart:  \n\u003e If you have a question or idea, check the [Discussions](https://github.com/GhazaleZe/MyDataBaseLab/discussions/1)\n\n## Requirements:\n - I'm using **Microsoft SQL Server** and **Visual Studio Code**  on Ubuntu and **Microsoft SQL Server Management Studio 18** on windows for this lab.\n - I worked on **adventure worker 2012** database that is available [in this link](https://github.com/microsoft/sql-server-samples/releases).\n \n ## Lab1:\n \n  This session contains 2 questions. Question 1 just asked for creating 7 tables concerning primary keys and foreign keys. Question 2 has 3 parts:\n- Part1: A **select** which displays *Department* information of a student whose student number is **\"123\"**.\n- Part2: A **select** for adding 1 to all grades.\n- Part3:  A **select** which displays students that didn't take \"DB\".\n\n ## Lab2 :sleepy: :\n\u003e adventure worker 2012\n\nThis session contains 5 questions.\n1. A query to select all orders with these conditions:\n   - TotalDue is between 100000 and 500000\n   - The order is from France or a country in North America.\n   -Status is 5\n2. A query to select information on each product that's clear in the .sql file.\n3. A query to display a territory that has the most sale for each product.\n4. A query for creating a table named *NAmerica_Sales*:\n   - has the same view of question1\n   - only insert records from North America\n   - add a column to this table that can only get values: \"High\", \"Mid\", \"Low\"\n   - fill the above column with comparing Due of each product with average(clear in .sql)\n5. Queries for increasing the salary of the employees and give them a Level concerning their salaries.\n\n ## Lab3 :\n \n 1.\n - Create a Server Login.\n - Create a role named Role1.\n - Add the Role1 to the log in you've created earlier.\n - With the created login go into SQL Server and create a table in AdventureWorks2012 database; then insert some data to it and read from it.\n 2.\n - In the AdventureWorks2012 database create a user with Role2 that has the permission of security admin.\n - Give Role2 the permission of reading.\n\n## Lab4 :wink: :\n\u003e adventure worker 2012\n\n1. Run the first query in the lab4 file and explain in detail that what the last column in the result is. \n2. A query to demonstrate  **sales count** and **total sales** for each territory and its region. Furthermore,  calculate **sales count** and **total sales** for all territories in each region; finally for all regions.\n\n\u003cimg width=\"448\" alt=\"Screenshot (741)\" src=\"https://user-images.githubusercontent.com/41547574/81325530-bba33a00-90ad-11ea-9f19-747f740ae431.png\"\u003e\n\n3. A query to demonstrate **sales count** and **total sales** for each subcategory of the products and its group. Finally, it has records for demonstrating the count and values of all subcategories in each specific group.\n\n\u003cimg width=\"448\" alt=\"Screenshot (742)\" src=\"https://user-images.githubusercontent.com/41547574/81326295-dc1fc400-90ae-11ea-8bd8-cc037833a5b0.png\"\u003e\n\u003cimg width=\"448\" alt=\"Screenshot (743)\" src=\"https://user-images.githubusercontent.com/41547574/81326299-dcb85a80-90ae-11ea-80eb-0c9350afe22a.png\"\u003e\n\n## Support:\nReach out to me at ghazalze@yahoo.com.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghazaleze%2Fmydatabaselab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghazaleze%2Fmydatabaselab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghazaleze%2Fmydatabaselab/lists"}