Create an Azure SQL DB – CREATE DATABASE dbName; GO
- Log into the Azure portal at https://portal.azure.com. Enter Azure SQL in the top middle search box, click Azure SQL, and then click the + Create button to display the Select SQL Deployment Option blade in Figure 2.3. Click the Create button under SQL Databases and leave Single Database as Resource Type.
FIGURE 2.3 The Select SQL Deployment Option blade
2. Select the subscriptions and resource group where you want the database to reside. Enter a database name (I used brainjammer). Under the Server drop‐down box, click the Create New link to create a database server. Enter the server name (I used csharpguitar), and enter a server admin login and password. Confirm the password and select the location of the server. I recommend placing it in the same location as your resource group, but doing so is not required. Click OK.
3. Select the Locally Redundant Backup Storage radio button. This is the cheapest solution. For a production environment, you would want to have ZRS or GRS, click Review + Create, and click Create.
4. Navigate to the Azure SQL database (brainjammer in my case). Click the Connection Strings link in the navigation menu and you will see different tabs that provide examples of connection strings.
5. Navigate back to the Overview blade. Click the Set Server Firewall link. Notice that the Allow Azure Services And Resources To Access This Server is defaulted to ON. Also notice there is a link named + Add Client IP; click that link and then click Save.
6. From the Connect With drop‐down, select Azure Data Studio. Click the New Connection link and enter the connection details for your database (Figure 2.4). Click Connect.
FIGURE 2.4 Azure Data Studio
7. Select New Query and download/open the brainjammer.sql file, located in the folder Chapter02/Ch02Ex01 at this location: https://github.com/benperk/ADE. Create the tables and insert the data after successfully running the SQL script, then click the Refresh button to see the window in Figure 2.5.
FIGURE 2.5 A view of data tables in Azure Data Studio
8. Right‐click the READING table, and choose Select Top 1000 to view the data in that table. Execute the following query, which pulls all the readings that have a FREQUENCY of 1 that is THETA:
SELECT F.FREQUENCY, R.VALUEFROM READING R JOIN FREQUENCY F
ON R.FREQUENCY_ID = F.FREQUENCY_IDWHERE R.FREQUENCY_ID = 1
There will be more opportunities to execute queries against this database in the “Querying Data” section later in this chapter, but there are other data structures we need to discuss first.
FIGURE 2.3 The Select SQL Deployment Option blade 2. Select the subscriptions and resource group where you want the database to reside. Enter a database name (I used brainjammer). Under the Server drop‐down box, click the Create New link to create a database server. Enter the server name (I used csharpguitar), and enter a server…
Archives
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- July 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- May 2022
- April 2022
- February 2022
- January 2022
- December 2021
- October 2021
- September 2021
- August 2021
- June 2021
- May 2021
- April 2021
Contact US