Azure

Azure Knowledge Studio – Create, Question And Delete In Azure SQL Database

Within the earlier articles, we’ve realized concerning the fundamentals of Azure Knowledge Studio and the way to set up it after which went by way of a step-by-step information to attach Azure Knowledge Studio to Azure SQL Database. Following the final article, this text dives in creating tables, working with queries and delete the information in Azure SQL Database from Azure Knowledge Studio.

Azure Knowledge Studio Article Collection 

  1. Azure Knowledge Studio 
  2. Azure Knowledge Studio – Connecting To Azure SQL Database
  3. Azure Knowledge Studio – Create, Question and Delete in Azure SQL SQL Database 

Azure Knowledge Studio 

Azure Knowledge Studio is principally a database instrument that’s cross-platform routinely utilized by knowledge engineers and professionals for each on-premises and cloud providers all through the working system spectrum from Home windows to macOS and Linux. There are quite a few trendy editor choices with the Azure Knowledge Studio from Code Snippets, IntelliSense, Built-in Terminal, Supply Management Integration, and extra. An awesome expertise with charting of question outcomes, customizable dashboards are supported built-in. 

Now, allow us to get into studying the way to create tables, question knowledge and delete them in Azure SQL Database from the Azure Knowledge Studio with this step-by-step tutorial. 

Step 1 

Join Azure Knowledge Studio to Azure SQL Database. As soon as it’s completed, you’ll be able to entry the Azure SQL DB from Azure Knowledge Studio as following. 

Right here, we’ve two databases; i.e., Grasp and ojashdatabase.

Step 2 

Choose the ojashdatabase by Clicking on it.

Since this can be a newly created database, we will see it’s empty.

You’ll be able to see the compute utilization visualization as of now in Azure.

Step 3 

Click on on New Question underneath the database choice you created.

Step 4 

You’ll be taken to SQL Question Editor.

Creating Database 

Step 5 

With the next SQL code within the Question Editor, we create a brand new database TutorialDB. Click on on Run to Execute the Code.

IF NOT EXISTS (
 SELECT title
 FROM sys.databases
 WHERE title = N'TutorialDB'
)
CREATE DATABASE [TutorialDB]
GO
ALTER DATABASE [TutorialDB] SET QUERY_STORE=ON
GO

The message can be up to date within the part under.

Step 6 

We are able to see, a brand new Database TutorialDB is created underneath the Server Part slightly below ojashdatabase.

Creating Desk 

Step 7 

Now, with the next code, we create a brand new Desk named Prospects with the Columns CustomerId, Title, Location, E mail with the CustomerId set because the Main Key.

-- Create a brand new desk known as 'Prospects' in schema 'dbo'
-- Drop the desk if it already exists
IF OBJECT_ID('dbo.Prospects', 'U') IS NOT NULL
DROP TABLE dbo.Prospects
GO
-- Create the desk within the specified schema
CREATE TABLE dbo.Prospects
(
 CustomerId INT NOT NULL PRIMARY KEY, -- major key column
 Title [NVARCHAR](50) NOT NULL,
 Location [NVARCHAR](50) NOT NULL,
 E mail [NVARCHAR](50) NOT NULL
);
GO

Inserting Row in Desk 

Step 8 

With the next code, we add in values corresponding to Ojash, Nepal and so forth to the respective columns of CustomerId, Title, Location and E mail.

-- Insert rows into desk 'Prospects'
INSERT INTO dbo.Prospects
 ([CustomerId],[Name],[Location],[Email])
VALUES
 ( 1, N'Ojash', N'Nepal', N'ojashshrestha1@gmail.com'),
 ( 2, N'Shiva', N'India', N'shiva0@csharpcorner.com'),
 ( 3, N'Mahesh', N'United States', N'mahesh@csharpcorner.com'),
 ( 4, N'John', N'United Kingdom', N'john@google.com')
GO 

Displaying Knowledge 

Step 9 

The values up to date within the database can now be considered with the next code. Subsequent, we Click on on Run to show the output in Outcomes part.

-- Choose rows from desk 'Prospects'
SELECT * FROM dbo.Prospects;

Deleting Knowledge from Desk 

Step 10 

With the next SQL question, we delete the information from the Prospects Desk.

-- Delete rows from desk 'Prospects'
DELETE FROM dbo.Prospects;

As soon as, we run the question, we will see that the values ie. Knowledge underneath every column is now null. 

With this we’ve learnt to create Database, create Desk and Question from Azure Knowledge Studio on the Azure SQL Database.

Step 11 

Now, we go to the Azure Portal can verify the metrics. We are able to see the visualization of the CPU billing as per the useful resource use.

We are able to additionally set the view for the visualization graphs for various metrics and aggregations.

Conclusion

Thus, on this article, we learnt by the step-by-step course of to Create Database, Desk and Question knowledge and Delete knowledge from Azure Knowledge Studio in Azure SQL Database.

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button