Instructions for Downloading SQL Server and Creating the Course Database and Tables Note: Click on Creating the Course Database and Tables for instructions on Creating the Course Database and Tables.
Download SQL Server 2022:
Download SQL Server 2022:
https://www.microsoft.com/en-us/sql-server/sql-server-downloads
Creating the Course Database and Tables. Note: Be sure to follow each of these steps exactly to avoid errors. Make sure that you create a completely new database in the instructions below. DO NOT attempt to use an existing database.
Note: Following is a quick method to Create the Course Database and Tables. You will basically create a name for your database and then copy, paste, and execute SQL script once to create and populate your tables with data simultaneously. It is a pretty quick process.
Type the name of your database in the Database Name field and then click the OK button. (See image below.) Following are examples of potential database names: IntroductionToSQL, IntermediateSQL, AdvancedSQL
Next, click the "New Query" button. (See image below.)
Next, select your Database from the "drop down box" near the top. (Instructions below.) To select a database in SQL Server use the drop-down list menu near the top of the screen. The default database is usually set to master. Use the drop-down menu to select the database that you created above. (See image below.) After your database is created and selected, you may execute the SQL script provided below to create and populate your tables. Please proceed to the instructions below.
NOTE: Your database must already be created before proceeding with this step. (See above.) The SQL script to create and populate your tables must be executed in the white space provided on the right hand side of the SQL Server Management Studio interface. (See image below.)
To create and populate the Customer, Orders, ServicePlans, and Customer2 tables in SQL Server, Click on the link (SQL Server SQL Scripts) further below and Copy, Paste and Run (Execute) all of the SQL code (everything in the file) located in the link below in your already created SQL Server database. Execute all (everything in the file) of the script at the same time. Note: Do not execute (run) the SQL script more than once. Once you Copy and Paste the SQL code into the white space within SQL Server Management Studio click the Execute button once in SQL Server Management Studio to execute (run) the SQL code. (See image below.) Note: Use "Ctrl + A" (or Cmd + A on macOS) to Easily "SELECT ALL" of the content on the link below. After executing the script you will receive messages stating 1 row affected. This message is fine. It means that the statements were completed successfully.
When you finish, you should have one database containing four tables. Proceed to the Viewing Tables section Below to view tables.
NOTE: Delete all of the script from the screen before completing the below instructions.
To view or open any table, type the following script (Replace the table name in the script to view different tables). For example, to view the Customer table, type the following script: (See image below.) SELECT * Click the Execute button to execute (run) the SQL script.
Note: You will execute all of the SQL examples from the course in this interface (White space on the right hand side of SQL Server Management Studio).
|