Session 2: Preparing to code in SQL

grayscale photo of computer laptop near white notebook and ceramic mug on table
Photo by Negative Space on Pexels.com
This is Session Two: Preparing to code in SQL. I will cover the tools needed to get started with SQL. Like anything you will need to practice running SQL queries. You will need a data base and a SQL Server to practice. 
So here are your steps to prepare your self to start coding in SQL:

Step 1:Download the SQL Server Manager. Read this linked article below to learn how and what to download. The author does a pretty good job detailing what the steps are. Disclaimer: I am not affiliated with the author or the company.

https://www.datacamp.com/community/tutorials/how-to-install-sql-server
Note: If you are a newbie, it can get frustrating going through all the steps above. Do not give up.

Step 2: Create a Database and a Table
Think of a database as a parent and a table as a child. A data base can have multiple tables as in Excel A database can be treated as an excel workbook and the tabs as tables. 

To create the database, enter the following code like so:

CREATE DATABASE BAKS_database

SQL Database



Click on Execute and you should get a message that says command completed succesfully. 

Now onto the next step of creating the table, copy and paste the following code:


CREATE TABLE training (
	class_name nvarchar(50),
	price int
)

You will see the same the success message after you execute the query. 
SQL Table

Before we go on further let's understand the different data types. You may have noticed that the code mentioned above has an int and nvarchar(50). Each data element needs to be assigned a data type. SQL needs to know whether the data elements are numbers, characters etc. 

Provided below is a grid of data types that are specific to 






In the next session, we will create a table and populate the table. 

Comment below if you have questions. I would love to hear from as to how this went for you.

1 Comment

Comments are closed