Premium Essay

Sql Query Design

In: Computers and Technology

Submitted By dianneki
Words 515
Pages 3
Assignment 1: SQL Query Design
Diane King
June 24, 2014
IT526-01 SQL Query Design
Pr4ofessor: Jon McKeeby, DSc.
Kaplan University

Part1. Install SQL Express

Part2. Questions. a. Each CHAR and VARCHAR store non binary strings characters as the maximum length allowed. The difference between the two is the maximum length allowed and how each handle trailing spaces (My SQL, n.d.). The CHAR data type is a fixed length typed and VARCHAR is a variable length data type. When the CHAR data type is used the length of strings allowed in each column definition should be from 0-225. As an example in the SQL database there is a dbo.table where tables hold a type column defined as (CHAR 12). This requires 12 characters for each value. My SQL states that values shorter than the designated length are padded spaces to that length when they are stored; and trailing spaces are removed from CHAR values when they are retrieved, so retrieved values may not be the same length as when stored (para, 2). The VARCHAR maximum numbers are up to 65-535. Any string stored in a VARCHAR column takes the number of characters required “plus one or two bites to record the strings length” (My SQL, n.d.). b. The Query gave the error: Msg 207, Level 16, State 1, Line 3
Invalid column name 'YearHired'.

c. The Query returned a error on both therefore, I’m unsure.
Msg 207, Level 16, State 1, Line 5
Invalid column name 'FileName'.
Msg 207, Level 16, State 1, Line 4
Invalid column name 'filetable'. Part3. Queries.

b.
c.
d.

e. productid | productname | supplierid | unitprice | 2 | Product RECZE | 1 | 19.00 | 16 | Product PAFRH | 7 | 17.45 | 3 | Product IMEHJ | 1 | 10.00 | 19 | Product XKXDO | 8 | 9.20 |

f.
g.
orderid | orderdate | empid | shipcity | shippeddate | 11045 | 2008-04-23 00:00:00.000 | 6 | Tsawassen | NULL | 11065 | 2008-05-01

Similar Documents

Free Essay

Distributed Systems

...Server Training (16 Courses) Training on how to build and manage SQL Server databases. Our SQL Server Training Courses provide the skills needed to build a solid foundation for SQL Server development. Introduction An overview of DBMS technology * How data is accessed, organized and stored * The database development process * Query and application development tools * CASE tools for database analysis and design * Tables, attributes and relationships * Primary and foreign keys * Relational integrity constraints * Manipulating data: selection, projection, join, union, intersection, difference * An integrated, active data dictionary * The query optimizer * Developing the logical data model * Mapping the data model to the relational model * Specifying integrity constraints * Defining the data in the data dictionary * Capturing entities, attributes and identifiers * Describing relationships: one-to-one, one-to-many, many-to-many * Optional and mandatory relationships * Resolving many-to-many relationships for implementation * Generating the SQL to build the database * Reverse engineering to capture the design of an existing database * SQL Programming Language Introduction 1 Days * Write SQL code based on ANSI/ISO standards to build Microsoft SQL Server or Oracle database structures * Update database content with SQL and transaction handling * Retrieve data with filter conditions and from...

Words: 1010 - Pages: 5

Free Essay

Best Practices in Data Modeling

...QlikView is Different from SQL Understand How QlikView works with(out) a Data Warehouse Not Throw Baby out with the Bathwater Adopt Applicable Data Modeling Best Practices Know Where to Go for More Information QlikView is not SQL (SQL Schemas) SQL take a large schema and queries a subset of tables. Each query creates a temporary “Schema” of only a few tables. Query result sets are independent of each other. Query 1 Query 2 QlikView is not SQL (QV Schemas) QlikView builds a smaller and more reporting friendly schema from the transactional database. This schema is persistent and reacts as a whole to user “queries”. A selection affects the entire schema. QlikView is not SQL (Aggregation and Granularity) Store Table Store A B SqrFootage 1000 800 Sales Table Store A A A B B Prod 1 2 3 1 2 Price $1.25 $0.75 $2.50 $1.25 $0.75 Date 1/1/2006 1/2/2006 1/3/2006 1/4/2006 1/5/2006 Select * From Store, Sales Where Store.Store = Sales.Store will return: SqrFootage 1000 1000 1000 800 800 Store A A A B B Prod 1 2 3 1 2 Price $1.25 $0.75 $2.50 $1.25 $0.75 Date 1/1/2006 1/1/2006 1/1/2006 1/1/2006 1/1/2006 Sum(SqrFootage) will return: 4600 If you want the accurate Sum of SqrFootage in SQL you can not join on the Sales table in the same Query! QlikView is not SQL (Benefits) • QlikView allows you to see the results of a selection across the entire schema not just a limited subset of tables. QlikView is not SQL (Benefits) • QlikView...

Words: 1267 - Pages: 6

Free Essay

Sql Ssrs Lab

...SQL Server Reporting Services Lab 1 TASKS IN THIS LAB To create a report server project 2 To create a new report definition file 2 To set up a connection 2 To define a Transact-SQL query for report data 3 To add a Table data region and fields to a report layout 4 Preview the report you have built to this point 5 Format the date field 6 Format the currency field 6 Format the header rows and table columns 7 Group data in a report 7 Add totals to the report 8 Add a grand total to the report 9 In this lab we create a basic table report based on the AdventureWorks2014 database. To create the report we use the Report designer tool with characteristics and functionality universal among products from multiple reporting applications vendors. PART I - CREATING A REPORT PROJECT Create your first report 1. Start SQL Server Data Tools. 2. On the File menu, point to New, and then click Project. 3. Select the Report Server Project. 4. For Name, type BasicReport. For location, you can leave in the default location or you can choose a location of your liking. 5. Click OK to create the project. Create a new report definition file 1. In Solution Explorer, right-click Reports, point to Add, and click New Item. 2. In the Add New Item dialog box, click Report. 3. For Name, (at the bottom of the dialog box) type SalesOrders.rdl and then click Add. The Report Designer opens and displays the new .rdl file in Design...

Words: 2275 - Pages: 10

Premium Essay

Cis Database Processing

...analyzing, and accessing information for better business decision making. 2.2 What is an ad-hoc query? An AD-HOC Query is a query which is created on the fly, for a specific Non-Generalizable one time requirement and may not be saved 2.3 What does SQL stand for, and what is SQL? SQL stands for structured query language. It is a special interfacing program that uses a certain language for sending questions to a search engine. 2.4 What does SKU stand for? What is an SKU? SKU stands for Stock Keeping Unit. A number assigned to a product by a retail store to identify the price, product options and manufacturer of the merchandise. 2.5 Summarize how data were altered and filtered in creating the Cape Codd data extraction. 2.6 Explain, in general terms, the relationships among the RETAIL_ORDER, ORDER_ITEM and SKU_DATA tables. 2.7 Summarize the background of SQL 2.8 What is SQL-92? How does it relate to the SQL statements in this chapter? 2.9 What features have been added to the SQL in versions subsequent to the SQL-92? 2.10 Why is SQL described as a data sublanguage? 2.11 What does DML stand for? What are DML statements? 2.12 What does DDL stand for? What are DDL statements? 2.13 What is the SQL SELECT/FROM/WHERE framework? 2.14 Explain how Microsoft Access uses SQL 2.15 Explain how enterprise-class DBMS products use SQL. 2.16 There is an intentional flaw in the design of the INVENTORY table used in these exercises. This flaw was purposely included in the INVENTORY...

Words: 448 - Pages: 2

Premium Essay

Databases: Identifying Index Placement

...This assignment helps you understand what table columns deserve an index through a series of exercises on a database schema. You do not type SQL in this assignment, but rather identify which columns deserve indexes, the type of index it deserves, and why. Correct placement of indexes is absolutely critical to database performance. All but the smallest of databases would have terrible performance if no indexes were assigned to any of its table columns. An index is a physical construct that serves two purposes – speeding up data retrieval and enforcing uniqueness. Indexes are not modeled in logical entity-relationship diagrams, because indexes do not operate at the logical level of abstraction, as do tables and table columns. While the primary purpose of creating an index is to speed up data access, modern relational DBMS also support a type of index that additionally enforces a uniqueness constraint. A uniqueness constraint can be assigned to a table column directly, or is indirectly assigned to a table column when it is assigned a primary key constraint. While a uniqueness constraint is a logical construct, many modern relational DBMS physically implement this constraint through an index. You might reasonably ask the question, “Why not simply add indexes to every column in the schema?” After all, then we would not need to concern ourselves with index placement. The primary reason is that while indexes speed up reading from the database, indexes slow down writing to the database...

Words: 2196 - Pages: 9

Free Essay

Sec571 Security Concerns Regarding

...Security Concerns Regarding Quality Web Design Submitted to: SE571 Principles of Information Security and Privacy Keller Graduate School of Management Submitted: April 20, 2014 Table of Contents Executive Summary 1 Company Overview 1 Security Vulnerabilities 3 Threats Through Using VPN Tunnels 3 SQL Injections 4 Recommended Solutions 5 Threats Through Using VPN Tunnels 6 SQL Injections 8 Impact on Business Processes 9 Budget 10 Summary 11 References 12 Company Overview Quality Web Design (QWD) is a web development organization that creates client side web application that distributes web content to a user in order to improve an existing web site. They have a basic Microsoft shop that uses a Visual Studio Team Foundation Service to host the image repository as well as Visual Studio to design, QA and develop their site. They are also utilizing Microsoft SQL Server and Microsoft Exchange. Security Vulnerabilities The two Security vulnerabilities that I am going to document are VPN Tunnel potential security breaches as well as SQL Injection attacks. These are the two areas that I believe the organization has not looked at as potential risks for issues. Security Vulnerabilities The first threat that I want to elaborate on is a hardware vulnerability that is inherent in the use of VPN Tunnels. The main threat mostly lies with users not utilizing the same security precautions that are used in the office. Often users are unaware that they have a direct link straight...

Words: 1671 - Pages: 7

Free Essay

Hello

...COM 330 Lab 2: Access Integrity and Queries In this lab you will connect two tables with a relationship using a foreign key and investigate simple queries using QBE and SQL using Microsoft Access™. 1. Prepare the file: a. Download the file COM330LAB02.ACCDB from the class website. b. Rename the file COM330LAB02.ACCDB to include your initials before the period. (e.x., COM330LAB02BR.ACCDB for someone who’s initials are BR. 2. Inspect the tables and create forms: c. Open the file and inspect the tables in both datasheet and table design view to become familiar with their design using the design view button on the home tab. d. Create a form to help enter data into both tables. For each table, individually highlight it in the navigation pane on the left side of the screen, and then clicking the From button in the Form Group on the Create tab of the Ribbon at the top of the window. Save the Customer table’s from as FrmCustomer and the Place table’s from as FrmPlace. 3. Establish a relationship: e. Go to the database tools tab and click the relationships button. f. Use the show table feature to add both the PLACE and CUSTOMER table. g. Drag the ZipCode column of one table unto the ZipCode column of the other table. When the relationship dialog box pops up, be certain that both tables are using the ZipCode field and that the Enforce Referential Integrity box is checked. Observe the labels of 1 and ∞ on the arc representing...

Words: 838 - Pages: 4

Premium Essay

Database Processing Ch 1 and Part of Ch 2

...com? - The largest databases used by e-commerce companies are Web-activity databases used to track customer behavior. 1.13 How do the e-commerce companies use these databases? - The e-commerce companies’ Web-activity databases are used to determine which Web page items are popular and successful, and to test if certain variations in Web page design will generate more orders. 1.14 How do digital dashboard and data mining applications differ from transaction processing applications? - Digital dashboard and data mining applications do not generate new data, but instead are used to summarize existing data to provide information to management. 1.15 Explain why a small database is not necessarily simpler than a large one. - While small databases vary from large databases in terms of the amount of data they store, they can still have the same structures and components (types of data, number of tables, and complexity of data relationships) as a large database.  A small database is not necessarily a simple database. 1.17 What are the functions of application programs? * Create and process forms        * Process end user queries        * Create and process reports...

Words: 1418 - Pages: 6

Premium Essay

Assignment 3: Understanding the Basics of Databases

...Databases Databases are used to organize a collection of data, allowing for easy access, retrieval, and use of information. The first databases were slow at processing information and inconsistent when applications would require the same information, but kept in different files. Relational databases, normalization, and Structured Query Language have improved the efficiency of databases. To be a proficient database programmer, one should have a basic understanding of rational databases, normalization, Structured Query Language, and the use of database models. Relational Database The use of shared files reduced the problem with inconsistencies but was still not an efficient in accessing information. In the 1970s, a man named Ted Codd came up with the idea of the relational model for databases (Ward & Dafoulas, 2006). Similar to a spreadsheet, the relational model was based on tables, rows, and columns. Relational databases, allows the user to compare information quickly because of the logical arrangement of data in columns. The speed at which data was accessed was made possible by the development of the structured query language (SQL) query language. Because of the uniformity of relational database, completely new tables can be created from information already in existing tables. In other words, the database uses the relationship of similar information to increase the speed and use. The process of normalization was developed to standardize databases. Normalization ...

Words: 931 - Pages: 4

Premium Essay

Ggghhh

...Database Design – Final Exam Study Guide Name ________________________________________________ Date ___________________ Part I Directions: Answer each question. 1. What are the benefits the Oracle 10g Database Environment provides for business? Oracle's 10g database management system gives businesses the ability to coordinate and share computing, application, data, storage, or network resources across dynamic and geographically dispersed organizations and in turn save time, resources and money. 2. What services and products does Oracle provide? Information Technology services and products. 3. What is a relational database? A relational database is a group of data stored in tables that are related by means of a common field. 4. What is the difference between application and system software? Provide an example. Systems software consists of low-level programs designed to interact with the computer hardware. Application Software is the code that allows end users to interact with computers, like for instance Firefox for browsing the internet, Microsoft Word for writing documents, Application Express for developing applications and also for accessing and manipulating data in an Oracle Database. 5. How is data extracted from the database? Data is extracted from the database by the SELECT statement. 6. Name two benefits of a career portfolio? • To organize the many details of one's experiences • To help with goal setting 7. What is the difference between a projection, a selection,...

Words: 2537 - Pages: 11

Premium Essay

Sql Book

...A GUIDE TO SQL Eighth Edition This page intentionally left blank A G U I D E TO S Q L Eighth Edition Philip J. Pratt Grand Valley State University Mary Z. Last University of Mary Hardin-Baylor Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States A Guide to SQL, Eighth Edition Philip J. Pratt, Mary Z. Last Vice President, Publisher: Jack Calhoun Editor-in-Chief: Alex von Rosenberg Senior Acquisitions Editor: Charles McCormick, Jr. Product Manager: Kate Hennessy Development Editor: Jessica Evans Editorial Assistant: Bryn Lathrop Marketing Director: Brian Joyner Marketing Manager: Bryant Chrzan Marketing Communications Manager: Libby Shipp Marketing Coordinator: Suellen Ruttkay Content Project Manager: Matt Hutchinson Art Director: Stacy Jenkins Shirley, Marissa Falco Cover Designer: Joseph Sherman Cover Image: Getty Images/Taxi/Chris Bell Manufacturing Coordinator: Denise Powers © 2009 Course Technology, Cengage Learning ALL RIGHTS RESERVED. No part of this work covered by the copyright hereon may be reproduced, transmitted, stored, or used in any form or by any means graphic, electronic, or mechanical, including but not limited to photocopying, recording, scanning, digitizing, taping, Web distribution, information networks, or information storage and retrieval systems, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the publisher....

Words: 48772 - Pages: 196

Free Essay

Resume

...Professional Summary: * Extensive Experience in MS SQL Server 2005/2008 and 2000 Database Administration and PL/SQL developer in Business Analyst including Planning, Deployment / Implementation and configuration. * Extensive experience in writing Complex Stored procedures as well analyzing and debugging existing complex stored procedures. * Successfully led, executed and maintained projects with multiple databases. * Implementing all kinds of SQL Server Constraints (Primary, Foreign, Unique, Check etc).  * Generating complex Transact SQL (T-SQL) queries, Sub queries, Co-related sub queries, Dynamic SQL queries * Programming in SQL Server - Using the stored procedures, Triggers, User-defined functions and Views, Common table expressions (CTEs) * Proficient in creating T-SQL (DML, DDL, DCL and TCL), Indexes, Views, Temporally Tables, Table Variables, Complex Stored Procedures, System and User Defined Functions . * Strong experience in creating complex Replication, Index, Functions, DTS packages, triggers, cursors, tables, views and other SQL joins and statements. * Expertise in Client-Server Application Development using Oracle […] PL/SQL, SQL *PLUS, TOAD and SQL*LOADER. * Experience in understanding complicated performance issues and worked with DBA's to suggest valuable ways to fix the problem  * Hands on experience working with SSIS, for ETL process ensuring proper implementation of Event Handlers, Loggings, Checkpoints, Transactions...

Words: 1001 - Pages: 5

Premium Essay

Sequel

...This week the discussion moves to an extremely important part of relational database and that SQL, it stands for Structured Query Language and is a declarative programming language intended for the management of databases. Unlike other languages that use imperative programming, with declarative programming the end-user is establishing the code that is telling the computer what you would like to happen. Structured Query Language is a relatively simple language that a majority of all relational databases utilize in order to influence data in a database (“What is SQL?,” n.d.). This leads to the question as to why SQL is such a powerful language this is because SQL make available the ability to manipulate any portion of a database through the use of simple commands. Through the use SQL programming language a plethora of functions in a database such as creating and deleting tables, updating and changing data and retrieving specific data to name a few. By probably the single most powerful expression available to the database programmer in SQL is the employment of the “JOIN” command. At this point you may be thinking to yourself what makes this directive so powerful this is because the function allows the user to process a significant amount of data in a swift and efficient manner. While many individual databases may include two or four tables meanwhile businesses may have hundreds or even thousands of table with need to process data across these table this ultimately...

Words: 479 - Pages: 2

Premium Essay

Data Base

...Database Design Table of Contents CHAPTER 1 .............................................................................................................................................. 2 INTRODUCTION ................................................................................................................................... 2 DATABASE MANAGEMENT SYSTEMS .................................................................................................. 2 Database ......................................................................................................................................... 2 Database Management System (DBMS) ......................................................................................... 2 Schemas, Instances and Data Independence.................................................................................. 3 DATA MODELS..................................................................................................................................... 3 Hierarchical Model .......................................................................................................................... 3 Network Model ............................................................................................................................... 4 Relational Model ............................................................................................................................. 5 CHAPTER 2 ............................................

Words: 4347 - Pages: 18

Premium Essay

Ndas Case Study

...H. Contact : 3180135 ext 210 ------------------------------------------------- Question In a group of 4-5 students, your team has been given a project to design a database system for Air Botswana to manage luggages for their customers. This systems wil be very useful for tracking lagguges for customers travelling with the airlines. The system should be able to cater the for the following as specified: 1. Passenger information . This should include passengers name, Indetity number, gender, date of birth, date of birth, address and any other information that your team feels might be relevant 2. Flight information . this should include flight number, airline company,departure time, arrival time, departure city, destination, passenger number, airplane number etc. 3. Luggage information. It must include luggage id,weight, owner, flight No. etc 4. Destination: country name, partuclar city of destination, airport of destination 5. Airplane information: Type, name, code Your tasks 1. Indenttify entities to store information about the given problem [10 marks] 2. Design data model for the problem and specufy all reuired parametsr [10 Marks] 3. Derive the data dictionary for the data model used [5 Marks] 4. Convert the Data Model to SQL using MySQL environment (MySQL console). Ensure that you adhere to the concept of...

Words: 981 - Pages: 4