* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Download Dressmaker
Extensible Storage Engine wikipedia , lookup
Relational algebra wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Oracle Database wikipedia , lookup
Navitaire Inc v Easyjet Airline Co. and BulletProof Technologies, Inc. wikipedia , lookup
Ingres (database) wikipedia , lookup
Microsoft Access wikipedia , lookup
Team Foundation Server wikipedia , lookup
Tandem Computers wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Clusterpoint wikipedia , lookup
Database model wikipedia , lookup
Relational model wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Case Study 5: MS SQL SERVER 2005 – Management Studio – Create tables via SQL Script DRESSMAKER EXAMPLE MS SQL SERVER 2005 Management Studio – Create tables via SQL Script DressMaker Database EXAMPLE The following guide shows how to convert an entity relationship diagram (ERD) for DressMaker to a SQL database using SQL scripting. SQL Coding Exercises ER Modelling Exercise 1 – Review the DressMaker ERD. SCHEMA - PHYSICAL Exercise 2 –Loading the physical schema for DressMaker ERD. SCHEMA - LOGICAL Exercise 3 –Create the logical schema for DressMaker ERD. SQL Exercise 4 –SQL commands. ACCESS SQL PROJECT Exercise 5 - workstation—server database MODEL SOLUTIONS Provided for 1 and 2 within exercises. FOR ICA PURPOSES THE ERD MUST BE FURTHER DEVELOPED. PROVIDE SQL CODE FOR NEW TABLES. CONSTRAINTS TO FULLY UTILISED WERE POSSIBLE. PROVIDE SQL CODE TO INSERT MEANINGFUL DATA INTO NEW TABLES PROVIDE ALL SQL CODE FOR LOGICAL VIEWS. ALL SQL DDL and DML CODE EXAMPLES TO BE PROVIDED. FOR HIGHER GRADE CONSIDER PRODUCING A FULL DEMO GUIDE OF EXCERSISE 5. THESE SHOULD ALL BE DOCUMENTED. PROVIDING EVIDENCE IN THE FORM OF SCREEN SHOTS Mansha Nawaz DATA VIEW BEFORE SQL CODE IN QUERY ANALYSER RESULTING DATA VIEW. Dressmaker EXAMPLE Case Study 5: 1 Case Study 5: MS SQL SERVER 2005 – Management Studio – Create tables via SQL Script DRESSMAKER EXAMPLE ER Modeling Exercise 1 – Review the DressMaker ERD - Data Model SCHEMA - PHYSICAL Exercise 2 –Loading the physical schema for DressMaker ERD. SQL Server Physical Schema is the set of SQL commands required for Table Definitions. Once you create a database SQL commands or Script files are loaded into a New Script interface and executed to create the tables for the ERD’s. As you work through the exercises examine the SQL code provided which has been written in notepad. Also note the SQL code for … the allocation of primary and foreign keys. the validation checks and constraints. a. Run MS SQL Server 2005 and create a new database called DRESSMAKER. Click on the database in the Object Window pane before executing any of the SQL commands. Failure to do so means all the created tables etc will appear in the master database. b. Click on the link below to automatically load the SQL code into a New Query window . The SQL code builds the above ERD and is also provided in the appendix of this document. sql.QA.dressmaker.create.sql Mansha Nawaz Dressmaker EXAMPLE Case Study 5: 2 Case Study 5: MS SQL SERVER 2005 – Management Studio – Create tables via SQL Script DRESSMAKER EXAMPLE Also provided are the drop commands to remove the tables sql.QA.dressmaker.drop.sql c. Examine the SQL code structure and contents of each table. Execute the SQL Code by clicking . Expand the DRESSMAKER database – Tables and note the tables have been created. d. Use the DRESSMAKER ERD to check the structure and contents of each table, as well as the relationships between them. Click on Database Diagrams and create a new diagram to represent the ERD. e. Click on the link below to automatically load the SQL code into a New Query window . The SQL code inserts data into the tables and is also provided in the appendix of this document. sql.QA.dressmaker.insert.sql f. Examine the SQL code structure and contents of inserting sample data into each table. Execute the SQL Code by clicking . Expand the DRESSMAKER database – Tables and note the tables have data inserted. Select table. and use the following commands to examine the content of each SELECT * FROM tablename g. The SQL code for sql.QA.dressmaker.create.sql has been written in notepad. However MS SQL Server 2005 can generate the SQL Script Code itself. Right click the database DRESSMAKER and Script Database > Create To > New Query Editor Window . Compare the auto generated code with that written in notepad. Compare, contrast and familiarise yourself with the SQL code. SCHEMA - LOGICAL Exercise 3 – Derive all the required logical schemas for DressMaker ERD. SQL Server logical Schema are the SQL commands required for View Definitions. These commands are loaded into the QA interface and executed to create the views derived from the ERD’s. Using the Create View command write the SQL code which will produce the determined logical views for the case study. SQL Mansha Nawaz Dressmaker EXAMPLE Case Study 5: 3 Case Study 5: MS SQL SERVER 2005 – Management Studio – Create tables via SQL Script DRESSMAKER EXAMPLE Exercise 4 –SQL commands SUPPORT: SQL Lecture Material The following online SQL lecture material provides an overview of SQL DDL and DML code. You may refer to them to overview any SQL code syntax covered in the above case studies. They will assist in tackling the SQL guides & case studies and are provided as part of the Database & SQL lecture booklet. Scm-Intranet SQL User Guides powerpoint SQL Overview Word SQL Concepts Demonstrate your knowledge of SQL by providing SQL code for the following statements using the above database. Consider providing evidence in the form of screen shots The SQL code should be based on typical queries which would be required for this case study. DDL commands DML commands a. CREATE INDEX b. CREATE VIEW c. CREATE TRIGGER d. e. f. g. h. i. j. k. l. m. n. SELECT SELECT & FROM WHERE CLAUSE ORDER BY DISTINCT BETWEEN and LIKE IN and NOT IN JOIN Tables CREATE TRIGGER DELETE UPDATE ACCESS - SQL Exercise 5 –Produce a MS Access and MS SQL Server project based on this case study MS SQL Server Project - linking MS SQL server (physical tables) to MS Access workstation (logical views) Mansha Nawaz Dressmaker EXAMPLE Case Study 5: 4