SQL Script for the Welcome to Introduction to SQL. Further below you will find the SQL script to create and populate the tables used in the course. In order for you to run each of the examples in the course, you need to create four tables. With the exception of the Customer2 table, all of the following tables must be populated with records: Customer, ServicePlans, Orders and Customer2. Note: Important! Before reading this document, please ensure that you have read my WELCOME posting (Getting Started, Trial Software) located in the lesson one discussion area of the Introduction to SQL course. You can copy and paste the SQL script directly into
SQL Server,
or
you can use this script in other Database Management Systems (DBMSs) that contain query interfaces that you are
accustomed to using.
Note: SQL Server: Click on SQL Server to view instructions on creating the Course tables in SQL Server. Note: Microsoft Access: If you are using Microsoft Access, you must instead "Download the Course Database". Click on Microsoft Access Download. to download the Microsoft Access database.When you download the database the tables will ALREADY BE CREATED AND POPULATED with records. Microsoft Access users download the course database instead of creating the tables manually because the SQL View interface of Microsoft Access only enables you to run one SQL statement at a time. This is very time consuming, therefore the database is provided with all of the tables and data. In lesson 9 we will discuss table creation and inserting records into tables so DO NOT feel as though you missed out on anything.
Following are links to sites that supply instructions on how to locate the interface that executes SQL script in some of the more popular DBMSs.
Download the Microsoft Access "2003", "2007", "2010" "2013"or "2016" Course Database: If you are using Microsoft Access 2003, 2007, 2010, 2013, or 2016 you will download the Course Database from the following links below: If you are using Microsoft Access 2013 or 2016 you can download either the Microsoft Access 2007 or 2010 Course Database since it is compatible with the Microsoft Access 2013 and 2016 file format. Save the file to your desktop. Next, open the file from your desktop or from the pop-up box that appears after the download. Go to "SQL View" to run the queries in the lessons.
Instructions to Create the Course Database Tables: Note: SQL SERVER users must refer to the following link to create the tables: SQL Server instructions Note: Microsoft Access users will download the course database with the tables already created and populated. Click on: Microsoft Access Download In order to create and populate the Customer table,
you must first copy, paste and run
the Create Table script for the Customer table. Next, delete the
Create Table script and copy, paste and run each Insert Statement ONE
AT A TIME (Some DBMSs such as Microsoft SQL Server, allow you to run several inserts statements at the same time) to populate the Customer table. Each Insert Statement
is separated by a semi colon. **Follow the same preceding steps to create and populate the ServicePlans, and Orders tables. Create the Customer2 table, but do not populate it. The Customer2 table will be populated in lesson eight. Important: Read the important notes below before you begin.
CUSTOMER CREATE TABLE SCRIPT CREATE TABLE Customer
CUSTOMER TABLE INSERT STATEMENTS INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode) INSERT INTO Customer (CustomerID, FirstName, LastName, HomePhone, Address,
State, City, PostalCode)
|