From 18465f2347cdbf0879eceafd2db779a4ec999541 Mon Sep 17 00:00:00 2001 From: Michal Stromko Date: Thu, 29 Apr 2021 19:49:48 +0000 Subject: [PATCH] =?UTF-8?q?Nahr=C3=A1t=20soubory=20do=20=E2=80=9Epages/stu?= =?UTF-8?q?dents/2019/michal=5Fstromko/vp2021/dokumentacia/prilohy?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dokumentacia/prilohy/Insert_table.sql | 19 ++++ .../dokumentacia/prilohy/create_table.sql | 8 ++ .../dokumentacia/prilohy/sql_database.sh | 47 +++++++++ .../dokumentacia/prilohy/sql_database_out.txt | 98 +++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/Insert_table.sql create mode 100644 pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/create_table.sql create mode 100644 pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database.sh create mode 100644 pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database_out.txt diff --git a/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/Insert_table.sql b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/Insert_table.sql new file mode 100644 index 000000000..c5713c2bf --- /dev/null +++ b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/Insert_table.sql @@ -0,0 +1,19 @@ +INSERT INTO students + ([StudentId], [Name], [Surname], [Email], [StartStudy], [SubjectName]) +VALUES +(1, N'Martin', N'Wencel',N'martin.wencel@student.tuke.sk',2018, N'bp2021'), +(2,N'Martin', N'Jancura',N'martin.jancura@student.tuke.sk',2017, N'bp2021'), +(3,N'Oleh', N'Bilykh',N'oleh.bilykh@student.tuke.sk',2018, N'bp2021'), +(4,N'Ondrej', N'Megela',N'ondrej.megela@student.tuke.sk',2018, N'bp2021'), +(5,N'Than Trung', N'Thanh',N'than.thanh.tuke.sk',2018, N'bp2021'), +(6,N'Martin', N'NaN1',N'martin.jnan1@student.tuke.sk',2018, N'bp2021'), +(7,N'Dmytro', N'Ushatenko',N'dmytro.ushatenko@student.tuke.sk',2018, N'bp2020'), +(8,N'Patrik', N'Pavlišin',N'patrik.pavlisin@student.tuke.sk',2018, N'bp2020'), +(9,N'Stanislav', N'Matsunych',N'stanislav.matsunych@student.tuke.sk',2018, N'bp2020'), +(10,N'Jakub', N'Maruniak',N'jakub.maruniak@student.tuke.sk',2016, N'bp2019'), +(11,N'Ján', N'Holp',N'jan.holp@student.tuke.sk',2016, N'bp2019'), +(12,N'Dmytro', N'Ushatenko',N'dmytro.ushatenko@student.tuke.sk',2018, N'bp2019'), +(13,N'Lukáš', N'Pokrývka',N'lukas.pokryvka@student.tuke.sk',2016, N'bp2019'), +(14,N'Dominik', N'Nagy',N'dominik.nagy@student.tuke.sk',2016, N'dp2022'), +(15,N'Maroš', N'Haraus',N'maros.haraus@student.tuke.sk',2016, N'dp2020') +GO \ No newline at end of file diff --git a/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/create_table.sql b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/create_table.sql new file mode 100644 index 000000000..e2ffcf910 --- /dev/null +++ b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/create_table.sql @@ -0,0 +1,8 @@ +CREATE TABLE students +( + StudentId INT NOT NULL PRIMARY KEY, + Name [NVARCHAR](50) NOT NULL, + Surname [NVARCHAR](50) NOT NULL, + Email [NVARCHAR](50) NOT NULL, + StartStudy INT NOT NULL +) diff --git a/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database.sh b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database.sh new file mode 100644 index 000000000..9e123d8fd --- /dev/null +++ b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database.sh @@ -0,0 +1,47 @@ +# Vytvorenie sql databazy + + +# Set the resource group name and location for your server +resourceGroupName=myResourceGroup +location=eastus + +# Set an admin login and password for your database +adminlogin=azureuser +password=Azure1234567! + +# Set a server name that is unique to Azure DNS (.database.windows.net) +serverName=server-$RANDOM + +# Set the ip address range that can access your database +startip=0.0.0.0 +endip=0.0.0.0 + +# Create a resource Group +az group create --name $resourceGroupName --location $location + +# Create a server +az sql server create \ + --name $serverName \ + --resource-group $resourceGroupName \ + --location $location \ + --admin-user $adminlogin \ + --admin-password $password + +# Configure a firewall rule for server +az sql server firewall-rule create \ + --resource-group $resourceGroupName \ + --server $serverName \ + -n AllowYourIp \ + --start-ip-address $startip \ + --end-ip-address $endip + +# Create a single database with Azure CLI +az sql db create \ + --resource-group $resourceGroupName \ + --server $serverName \ + --name mySampleDatabase \ + --sample-name AdventureWorksLT \ + --edition GeneralPurpose \ + --compute-model Serverless \ + --family Gen5 \ + --capacity 2 diff --git a/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database_out.txt b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database_out.txt new file mode 100644 index 000000000..1d9ff278f --- /dev/null +++ b/pages/students/2019/michal_stromko/vp2021/dokumentacia/prilohy/sql_database_out.txt @@ -0,0 +1,98 @@ +{ + "id": "/subscriptions/34363077-8695-4c14-9ae5-dc305fe8e4ef/resourceGroups/myResourceGroup", + "location": "eastus", + "managedBy": null, + "name": "myResourceGroup", + "properties": { + "provisioningState": "Succeeded" + }, + "tags": null, + "type": "Microsoft.Resources/resourceGroups" +} +{\ Finished .. + "administratorLogin": "azureuser", + "administratorLoginPassword": null, + "fullyQualifiedDomainName": "server-22752.database.windows.net", + "id": "/subscriptions/34363077-8695-4c14-9ae5-dc305fe8e4ef/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/server-22752", + "identity": null, + "kind": "v12.0", + "location": "eastus", + "minimalTlsVersion": null, + "name": "server-22752", + "privateEndpointConnections": [], + "publicNetworkAccess": "Enabled", + "resourceGroup": "myResourceGroup", + "state": "Ready", + "tags": null, + "type": "Microsoft.Sql/servers", + "version": "12.0" +} +{ + "endIpAddress": "0.0.0.0", + "id": "/subscriptions/34363077-8695-4c14-9ae5-dc305fe8e4ef/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/server-22752/firewallRules/AllowYourIp", + "kind": "v12.0", + "location": "East US", + "name": "AllowYourIp", + "resourceGroup": "myResourceGroup", + "startIpAddress": "0.0.0.0", + "type": "Microsoft.Sql/servers/firewallRules" +} +{- Finished .. + "autoPauseDelay": 60, + "backupStorageRedundancy": "Geo", + "catalogCollation": "SQL_Latin1_General_CP1_CI_AS", + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": null, + "creationDate": "2021-04-27T08:23:55.797000+00:00", + "currentServiceObjectiveName": "GP_S_Gen5_2", + "currentSku": { + "capacity": 2, + "family": "Gen5", + "name": "GP_S_Gen5", + "size": null, + "tier": "GeneralPurpose" + }, + "databaseId": "db785b2c-f171-4386-8c89-4056785756d0", + "defaultSecondaryLocation": "westus", + "earliestRestoreDate": null, + "edition": "GeneralPurpose", + "elasticPoolId": null, + "elasticPoolName": null, + "failoverGroupId": null, + "highAvailabilityReplicaCount": null, + "id": "/subscriptions/34363077-8695-4c14-9ae5-dc305fe8e4ef/resourceGroups/myResourceGroup/providers/Microsoft.Sql/servers/server-22752/databases/mySampleDatabase", + "kind": "v12.0,user,vcore,serverless", + "licenseType": null, + "location": "eastus", + "longTermRetentionBackupResourceId": null, + "maintenanceConfigurationId": "/subscriptions/34363077-8695-4c14-9ae5-dc305fe8e4ef/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default", + "managedBy": null, + "maxLogSizeBytes": 68719476736, + "maxSizeBytes": 34359738368, + "minCapacity": 0.5, + "name": "mySampleDatabase", + "pausedDate": null, + "readScale": "Disabled", + "recoverableDatabaseId": null, + "recoveryServicesRecoveryPointId": null, + "requestedServiceObjectiveName": "GP_S_Gen5_2", + "resourceGroup": "myResourceGroup", + "restorableDroppedDatabaseId": null, + "restorePointInTime": null, + "resumedDate": null, + "sampleName": null, + "secondaryType": null, + "sku": { + "capacity": 2, + "family": "Gen5", + "name": "GP_S_Gen5", + "size": null, + "tier": "GeneralPurpose" + }, + "sourceDatabaseDeletionDate": null, + "sourceDatabaseId": null, + "status": "Online", + "tags": null, + "type": "Microsoft.Sql/servers/databases", + "zoneRedundant": false +} \ No newline at end of file