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.1: Create Database

Previous1.0: Getting Started with T-SQLNext1.2: Drop Database

Last updated 7 years ago

Start by creating a folder outside of an existing git repository. Name the folder "SQL_Library."

  1. Open Visual Studio.

  2. Go to View, Open SQL Server Object Explorer.

  3. Open up the (localdb)\MSSQLLocalDB.

  4. Click on Databases. The New Query button should now be available (circled in purple in the screenshot below). A new window will appear. This is where you will write your SQL query (green box).

  5. Save the file in your SQL_Library folder as 0.01_CREATE_DB.sql.

  6. In 0.01_CREATE_DB.sql, write a query that creates a database called SQL_Library. To run the query, press the play button (circled in yellow). Make sure to click the blue arrow button (circled in aqua) every time you make a change to your database to refresh the view in your SQL Server Object Explorer window.

To see the solution for this challenge, click on . Then, continue to

Part 1.2: Drop Database
1.12 Solutions
T-SQL Reference Screenshot