IT 330 Database Design and Management Lab 4: Attach Database Write DML SQL Objective: o INSERT o SELECT o COMMIT o UPDATE o ROLLBACK o DELETE Answer…
IT330 Database Design and Management
Lab4: Attach Database Write DML SQL
Objective:
- DML commands such as:
o INSERT
o SELECT
o COMMIT
o UPDATE
o ROLLBACK
o DELETE
Submission requirements:
LAB:
1a. if the AdventureWorks2012 database is not already attached:
- Attaching the database
Location:C:\DBs
Database name:AdventureWorks2012_Data.mdf
TABLE | attribute | data type | Null? | Key |
YourName_STORES | StoreCode | char(5) | Not Null | PK |
Name | varchar(40) | Not Null | ||
Address | varchar(40) | Not Null | ||
City | varchar(20) | Not Null | ||
State | char(2) | Not Null | ||
Zip | char(5) | Not Null | ||
SALES | OrderNumber | varchar(20) | Not Null | PK |
StoreCode | char(5) | Not Null | FK (ref Table: YourName_STORES) | |
OrderDate | date | Not Null | ||
Quantity | int | Not Null | ||
Terms | varchar(12) | Not Null | ||
TitleID | int | Not Null |
StoreCode = IT330, Name =Test_YourName, Address = 1234 Somewhere Street, City = Here, State = MA, Zip = 00333.
OrderNumber = TESTORDER, StoreCode = IT330, OrderDate = 01/01/2014, Quantity = 10, Terms = NET 30, TitleID
= 1234567
References:
The following is referenced from Microsoft:
Database Notations tap the full power of Visio
How to create a Crow’s Foot ER Diagram
- Open Microsoft Visio
- Click the File menu, select New, then Database, and then Crow’s Foot Database Notation
- Drag and drop Shapes onto Drawing to create Diagram
- Double-click Entities to adjust properties such as Name, Column, and Primary Key
- Double-click Relationships to adjust properties such as Name