Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Background: ( Stepsatbottom *) 1. CREATE TABLE statements: a. Define columns using four data types: CHAR, VARCHAR, DATE, DATETIME b. Specify NOT NULL to the

image text in transcribed
image text in transcribed
image text in transcribed
Background: ( Stepsatbottom *) 1. CREATE TABLE statements: a. Define columns using four data types: CHAR, VARCHAR, DATE, DATETIME b. Specify NOT NULL to the column in primary key c. Specify CONSTRAINT and PRIMARY KEY (pk) d. Specify CONSTRAINT, FOREIGN KEY (fk), REFERENCES BaseTable (pk), referential integrity ON DELETE and ON UPDATE actions. e. Syntax: CREATE TABLE TableName ( colName COL_TYPE [COL_SPECIFIER] [... , CONSTRAINT pk_TableName_keyName PRIMARY KEY (colName [,] ) [, CONSTRAINT fk_TableName_keyName FOREIGN KEY (colName [,] ) REFERENCES BaseTableName (primaryKey) ON DELETE ACTION ON UPDATE ACTION] [,]) 2. INSERT INTO statements: a. Populate your tables with real data. b. Syntax: INSERT INTO TableName VALUES ( colValue [..])[] BMGT 402 Lab 2 c. Example 1: INSERT INTO Student VALUES ('111111111', 'Bob Smith') d. Example 2: INSERT INTO Enroll VALUES ('111111111', 'BMGT402', '2021-11-30') Objectives: For this lab, you will create tables and insert data into the SQL Server. 1. You will need to define four tables as shown in the picture below and insert the data. 2. Assume that these tables might already exist in your BMGT402_DB_Student_nnn database space so be sure to DROP TABLEs before you begin the creation process. 3. You will need to use CREATE TABLE commands to define your tables. 4. Remember to properly define PRIMARY KEYs and FOREIGN KEYS. 5. After they are all defined, use INSERT INTO commands to add the data pictured below. Objectives: For this lab, you will create tables and insert data into the SQL Server. 1. You will need to define four tables as shown in the picture below and insert the data. 2. Assume that these tables might already exist in your BMGT402_DB_Student_nnn database space so be sure to DROP TABLEs before you begin the creation process. 3. You will need to use CREATE TABLE commands to define your tables. 4. Remember to properly define PRIMARY KEYS and FOREIGN KEYs. 5. After they are all defined, use INSERT INTO commands to add the data pictured below. Four tables and their data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago