An open API service indexing awesome lists of open source software.

https://github.com/ghazaleze/mydatabaselab

IUT database lab, SQL
https://github.com/ghazaleze/mydatabaselab

sql-server-management-studio tsql

Last synced: 3 months ago
JSON representation

IUT database lab, SQL

Awesome Lists containing this project

README

          

# MyDataBaseLab :smiley:

> I'm passing this database lab from home because of COVID-19 :mask:.
> I wish good health for people all over the world :heart:
> If you have a question or idea, check the [Discussions](https://github.com/GhazaleZe/MyDataBaseLab/discussions/1)

## Requirements:
- I'm using **Microsoft SQL Server** and **Visual Studio Code** on Ubuntu and **Microsoft SQL Server Management Studio 18** on windows for this lab.
- I worked on **adventure worker 2012** database that is available [in this link](https://github.com/microsoft/sql-server-samples/releases).

## Lab1:

This session contains 2 questions. Question 1 just asked for creating 7 tables concerning primary keys and foreign keys. Question 2 has 3 parts:
- Part1: A **select** which displays *Department* information of a student whose student number is **"123"**.
- Part2: A **select** for adding 1 to all grades.
- Part3: A **select** which displays students that didn't take "DB".

## Lab2 :sleepy: :
> adventure worker 2012

This session contains 5 questions.
1. A query to select all orders with these conditions:
- TotalDue is between 100000 and 500000
- The order is from France or a country in North America.
-Status is 5
2. A query to select information on each product that's clear in the .sql file.
3. A query to display a territory that has the most sale for each product.
4. A query for creating a table named *NAmerica_Sales*:
- has the same view of question1
- only insert records from North America
- add a column to this table that can only get values: "High", "Mid", "Low"
- fill the above column with comparing Due of each product with average(clear in .sql)
5. Queries for increasing the salary of the employees and give them a Level concerning their salaries.

## Lab3 :

1.
- Create a Server Login.
- Create a role named Role1.
- Add the Role1 to the log in you've created earlier.
- 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.
2.
- In the AdventureWorks2012 database create a user with Role2 that has the permission of security admin.
- Give Role2 the permission of reading.

## Lab4 :wink: :
> adventure worker 2012

1. Run the first query in the lab4 file and explain in detail that what the last column in the result is.
2. 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.

Screenshot (741)

3. 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.

Screenshot (742)
Screenshot (743)

## Support:
Reach out to me at ghazalze@yahoo.com.