SQL-101-Basics
  • Introduction
  • Part 1: Transact-SQL
    • 1.0: Getting Started with T-SQL
    • 1.1: Create Database
    • 1.2: Drop Database
    • 1.3: Create Table
    • 1.4: Insert
    • 1.5: Update
    • 1.6: Read
    • 1.7: Alter
    • 1.8: Customer Table
    • 1.9: Diagramming Notation
    • 1.10: Foreign Keys
    • 1.11: Join
    • 1.12: Solutions
  • Part 2: PostgreSQL
    • 2.0: Getting Started with PostgreSQL
    • 2.1: Create Database
    • 2.2: Drop Database
    • 2.3: Create Table
    • 2.4: Insert
    • 2.5: Update
    • 2.6: Read
    • 2.7: Alter
    • 2.8: Customer Table
    • 2.9: Diagramming Notation
    • 2.10: Foreign Keys
    • 2.11: Join
    • 2.12: Solutions
  • Part 3: T-SQL Challenges
    • 3.0: Introduction
    • 3.1: Challenge 1
    • 3.2: Challenge 2
    • 3.3: Challenge 3
    • 3.4: Challenge 4
    • 3.5: Solutions
  • Part 4: PostgreSQL Challenges
    • 4.0: Introduction
    • 4.1: Challenge 1
    • 4.2: Challenge 2
    • 4.3: Challenge 3
    • 4.4: Challenge 4
    • 4.5: Solutions
  • Part 5: Resources
    • 5.0: Resources
Powered by GitBook
On this page
  1. Part 1: Transact-SQL

1.0: Getting Started with T-SQL

PreviousPart 1: Transact-SQLNext1.1: Create Database

Last updated 7 years ago

One of the flavors of SQL is T-SQL (Transact-SQL), which is used with MSSQL in Visual Studio. The Microsoft reference docs for T-SQL can be found . If you are looking for general documentation regarding Visual Studio, you can follow .

In Part One, you will create a SQL Library to practice learning the basics of SQL. Rather than giving you step by step instructions, there will be challenges, tips, and requirements for the exercises you need to complete.

After completing Part One, you should have a better understanding of the following concepts:

  • Writing basic SQL queries in T-SQL

  • Creating tables with SQL

  • Inserting seed data

When you are finished, you’ll have a database that looks like this:

Once you have Visual Studio up and running, go to the "View" menu in the toolbar, and click on "SQL Server Object Explorer" as shown below. This will open a new window so you can view and access your databases.

Your screen should now look something like the image below. Don't worry if they are not identical. For example, you might not have a "Projects" folder, and that is fine.

Notice the icon circled in yellow. This icon will create a new query, which is where you will write your SQL statements. The icon is faded because this option is not currently available to you.

  • Click on the white triangle next to "SQL Server." This will show what servers you can access.

  • Click on the white triangle next to the server where your database is stored. It will start with "(localdb)\MSSQLLocalDB." This will expose three folders - "Databases," "Security," and "Server Objects."

  • Click on the triangle next to the "Databases" folder. This will show all the databases you can connect to.

  • Click on the database you want to work with. Once you have selected a database, you can create a new query; the icon circled in yellow is now accessible. Use the image below as a guide. Your screen will not look identical because you have different databases on your computer.

Clicking on the "New Query" icon will open a new window. This is where you will write your SQL statements.

Since MSSQL is built in to Visual Studio, there are no additional programs that need to be installed. However, if you need to install Visual Studio, you can follow along with .

Please continue to .

this video
Part 1.1: Create Database
here
this link
SQL Server Object Explorer Completed Database
SQL Server Object Explorer
SQL Server All Servers
SQL Server All Databases