Create an Azure SQL Database single database

  1. Home
  2. Create an Azure SQL Database single database

Go back to DP-300 Tutorials

In this we will learn how to create a single database in Azure SQL Database using either the Azure portal, a PowerShell script, or an Azure CLI script. You then query the database using Query editor in the Azure portal.

Create a single database

This quickstart creates a single database in the serverless compute tier.

  • Firstly, browse to the Select SQL Deployment option page.
  • Secondly, under SQL databases, leave Resource type set to Single database, and select Create.
  • Thirdly, on the Basics tab of the Create SQL Database form, under Project details, select the desired Azure Subscription.
  • Next, for Resource group, select Create new, enter myResourceGroup, and select OK.
  • Then, for Database name enter mySampleDatabase.
  • After that, for Server, select Create new, and fill out the New server form.
  • Then, leave Want to use SQL elastic pool set to No.
  • Next, under Compute + storage, select Configure database.
  • Then, select Serverless, and then select Apply.
  • Now, on the Networking tab, for Connectivity method, select Public endpoint.
  • Next, for Firewall rules, set Add current client IP address to Yes. Leave Allow Azure services and resources to access this server set to No.
  • Select Next: Additional settings at the bottom of the page.
  • On the Additional settings tab, in the Data source section, for Use existing data, select Sample.
  • Then, select Review + create at the bottom of the page:
  • Lastly, on the Review + create page, after reviewing, select Create.

Query the database

Once your database is created, you can use the Query editor (preview) in the Azure portal to connect to the database and query data.

  • Firstly, in the portal, search for and select SQL databases, and then select your database from the list.
  • Secondly, on the page for your database, select Query editor (preview) in the left menu.
  • Then, enter your server admin login information, and select OK.
  • After that, enter the following query in the Query editor pane.

SQL
SELECT TOP 20 pc.Name as CategoryName, p.name as ProductName
FROM SalesLT.ProductCategory pc
JOIN SalesLT.Product p
ON pc.productcategoryid = p.productcategoryid;

  • After that, select Run, and then review the query results in the Results pane.
  • Lastly, close the Query editor page, and select OK when prompted to discard your unsaved edits.
Dp-300 practice tests

Clean up resources

Keep the resource group, server, and single database to go on to the next steps, and learn how to connect and query your database with different methods.

When you’re finished using these resources, you can delete the resource group you created, which will also delete the server and single database within it.

To delete myResourceGroup and all its resources using the Azure portal:

  • In the portal, search for and select Resource groups, and then select myResourceGroup from the list.
  • On the resource group page, select Delete resource group.
  • Under Type the resource group name, enter myResourceGroup, and then select Delete.
Create an Azure SQL Database single database DP-300 online course

Reference: Microsoft Documentation

Go back to DP-300 Tutorials

Menu