Premium Essay

What Is Sql

In:

Submitted By sizo
Words 762
Pages 4
C H A P T E R

3

SQL

Chapter 3 covers the relational language SQL. The discussion is based on SQL:1999. Integrity constraint and authorization features of SQL being a large language, many of its features are not covered here, and are not appropriate for an introductory course on databases. Standard books on SQL, such as Date and Darwen [1993] and Melton and Simon [1993], or the system manuals of the database system you use can be used as supplements for students who want to delve deeper into the intricacies of SQL. Although it is possible to cover this chapter using only handwritten exercises, we strongly recommend providing access to an actual database system that supports SQL. A style of exercise we have used is to create a moderately large database and give students a list of queries in English to write and run using SQL. We publish the actual answers (that is the result relations they should get, not the SQL they must enter). By using a moderately large database, the probability that a “wrong” SQL query will just happen to return the “right” result relation can be made very small. This approach allows students to check their own answers for correctness immediately rather than wait for grading and thereby it speeds up the learning process. A few such example databases are available on the Web home page of this book. Exercises that pertain to database design are best deferred until after Chapter 7.

Exercises
3.8 Consider the insurance database of Figure 3.11, where the primary keys are underlined. Construct the following SQL queries for this relational database. a. Find the number of accidents in which the cars belonging to “John Smith” were involved. b. Update the damage amount for the car with license number “AABB2000” in the accident with report number “AR2197” to $3000. Answer: Note: The participated relation relates drivers, cars, and accidents.

Similar Documents

Premium Essay

What Is the Simplest Sql Retrieval?

...of a logical operator (AND and OR). SQL: Structured Query Language is programming language is designed to managing data in relational database management system (RDBMS). CREATE TABLE: In Structure Query Language we use CREATE TABLE command to describe the layout of table. Computed Field: A field whose values you derive from existing database table is called a computed field. Computed field functions involve addition, subtraction, multiplication and division. Sub Query: Sub Query is query in a query. A Sub Query is usually added in the WHERE Clause of the SQL statement. Most of the time a sub query is when you know how to search for a value using SELECT statement, but do not know the exact value. SQL built-in function: SQL server provides many built-in functions that you can use in queries to return data or perform operations on data. Answer the following questions: 1. What is the simplest SQL retrieval? The simplest versions of the most important SQL command are SELECT, FROM statement. Then if you need to limit the result you introduce the WHERE clause. In the WHERE clause you can use operators such as LIKE, AND, OR, EQUAL, BETWEEN and IN. 2. What is the Purpose of the WHERE clause when using SELECT? WHERE clause is used with the SELECT keyword. We use WHERE clause for searching the data with a particular condition. If the data in the table matches condition then it returns the specific value of that particular data. 3. What are data types and why are they important...

Words: 632 - Pages: 3

Premium Essay

Pos410 R12 Course Syllabus

... |POS/410 Version 12 | | |SQL for Business | Copyright © 2010, 2009, 2008, 2007, 2006 by University of Phoenix. All rights reserved. Course Description This course covers Structured Query Language (SQL) that provides a unified language that lets you query, manipulate, or control data in a business applications environment. Policies Faculty and students/learners will be held responsible for understanding and adhering to all policies contained within the following two documents: University policies: You must be logged into the student website to view this document. Instructor policies: This document is posted in the Course Materials forum. University policies are subject to change. Be sure to read the policies at the beginning of each class. Policies may be slightly different depending on the modality in which you attend class. If you have recently changed modalities, read the policies governing your current class modality. Course Materials Vieira, R. (2009). Beginning Microsoft SQL Server 2008 Programming. Indianapolis, IN: Wiley Publishing, Inc. Software Microsoft SQL Severer 2008 (Virtual Desktop) Supplemental Resource Rob, P., & Coronel, C. (2009). Database systems: Design, implementation, and management (8th ed.). Boston: Course Technology...

Words: 2401 - Pages: 10

Premium Essay

Cis Database Processing

...2.1 What is a business intelligence (BI) system? Business intelligence (BI) systems are applications and technologies for gathering, storing, 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...

Words: 448 - Pages: 2

Premium Essay

Cisp351

... 2.1 What is a business intelligence (BI) system? 2.2 What is an ad-hoc query? 2.3 What does SQL stand for, and what is SQL? 2.4 What does SKU stand for? What is an SKU? 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 SQL statements in this chapter? 2.9 What features have been added to 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 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 tables so that you can answer some of the following questions using only that table. Compare the SKU and INVENTORY tables, and determine what design flaw is included in INVENTORY. Specifically, why did we include it? 2.17 Write an SQL statement to display SKU and SKU_Description. 2.18 Write an SQL statement to display SKU_Description and SKU. 2.19 Write an SQL statement...

Words: 7421 - Pages: 30

Premium Essay

Pt2520-Unit 1 Research-Exploring Programming Language

...Query Language (SQL) is a specialized language for updating, deleting, and requesting information from databases. SQL is an ANSI and ISO standard, and is the de facto database query language. A variety of established database products support SQL, including products from Oracle and Microsoft SQL Server. It is widely used in both industry and academia, often for enormous, complex datbases. (Base, 2013). SQL was developed in the 1970’s by IBM to initially manipulate and retrieve data in IBM system R. The SQL language was standardized in 1986 by the American National Standards Institute (ANSI); however, later releases were released as International Organization Standardization (ISO) standards. (Inc., 2013) Although IBM authored SQL, the first SQL implementation was provided by Oracle Corporation (then called Relational Software Inc.). Early commercial implementations were concentrated on midsized UNIX-based DBMSs, such as Oracle, Ingres, and Informix. IBM followed in 1981 with SQL/DS, the forerunner to DB2, which debuted in 1983. (Unknown, 2010) ANSI published the first SQL standard (SQL-86) in 1986. An international version of the standard issued by ISO appeared in 1987. A significant update to SQL-86 was released in 1989 (SQL-89). Virtually, all relational DBMSs that you encounter today support most of the 1986 standard. (Unknown, 2010) In 1992, the standard was revised again (SQL-92), adding more capabilities to the language. Because SQL-92 was s superset of SQL-89, older database...

Words: 802 - Pages: 4

Premium Essay

Goodman

...1.) You are developing a project that contains multiple SQL Server Integration Services (SSIS) packages. The packages will be deployed to the SSIS catalog. One of the steps in each package accesses an FTP site to download sales transaction data. You create project parameters to store the username and password that are used to access the FTP site. You need to ensure that the username and password values are encrypted when they are deployed. What should you do? A. set the Sensitive property of the parameters to True. B. Set the ProtectionLevel property of the package to EncryptSensitiveWithUserKey. C. Change the parameters to package parameters. D. Change the project to the Legacy Deployment model. Answer: A 2.) You develop a SQL Server Integration Services (SSIS) package that imports SQL data into a data warehouse every night. The SQL data contains many misspellings and variations of abbreviations. To import the data, a developer used the Fuzzy Lookup transformation to choose the closest-matching string from a reference table of allowed values. The number of rows in the reference table is very large. If no acceptable match is found, the Fuzzy Lookup transformation passes a null value. The current setting for the Fuzzy Lookup similarity threshold is 0.50. Many values are incorrectly matched. You need to ensure that more accurate matches are made by the Fuzzy Lookup transformation without degrading performance. What should you do? A. Change the Exhaustive property to True...

Words: 5340 - Pages: 22

Premium Essay

Unit 1 Research Assignment 1: Exploring Programming Language

...Language (SQL) is a specialized language for updating, deleting, and requesting information from databases. SQL is an ANSI and ISO standard, and is the de facto database query language. A variety of established database products support SQL, including products from Oracle and Microsoft SQL Server. It is widely used in both industry and academia, often for enormous, complex datbases. (Base, 2013). SQL was developed in the 1970’s by IBM to initially manipulate and retrieve data in IBM system R. The SQL language was standardized in 1986 by the American National Standards Institute (ANSI); however, later releases were released as International Organization Standardization (ISO) standards. (Inc., 2013) Although IBM authored SQL, the first SQL implementation was provided by Oracle Corporation (then called Relational Software Inc.). Early commercial implementations were concentrated on midsized UNIX-based DBMSs, such as Oracle, Ingres, and Informix. IBM followed in 1981 with SQL/DS, the forerunner to DB2, which debuted in 1983. (Unknown, 2010) ANSI published the first SQL standard (SQL-86) in 1986. An international version of the standard issued by ISO appeared in 1987. A significant update to SQL-86 was released in 1989 (SQL-89). Virtually, all relational DBMSs that you encounter today support most of the 1986 standard. (Unknown, 2010) In 1992, the standard was revised again (SQL-92), adding more capabilities to the language. Because SQL-92 was s superset of SQL-89, older...

Words: 803 - Pages: 4

Premium Essay

Teach Yourself Sql

...Teach Yourself SQL in 21 Days, Second Edition Table of Contents: Introduction Week 1 at a Glance Day 1 Introduction to SQL Day 2 Introduction to the Query: The SELECT Statement Day 3 Expressions, Conditions, and Operators Day 4 Functions: Molding the Data You Retrieve Day 5 Clauses in SQL Day 6 Joining Tables Day 7 Subqueries: The Embedded SELECT Statement Week 1 in Review Week 2 at a Glance Day 8 Manipulating Data Day 9 Creating and Maintaining Tables Day 10 Creating Views and Indexes Day 11 Controlling Transactions Day 12 Database Security Day 13 Advanced SQL Topics Day 14 Dynamic Uses of SQL Week 2 in Review Week 3 at a Glance Day 15 Streamlining SQL Statements for Improved Performance Day 16 Using Views to Retrieve Useful Information from the Data Dictionary Day 17 Using SQL to Generate SQL Statements Day 18 PL/SQL: An Introduction Day 19 Transact-SQL: An Introduction Day 20 SQL*Plus Day 21 Common SQL Mistakes/Errors and Resolutions Week 3 in Review Appendixes A Glossary of Common SQL Statements B Source Code Listings for the C++ Program Used on Day 14 C Source Code Listings for the Delphi Program Used on Day 14 D Resources E ASCII Table F Answers to Quizzes and Excercises © Copyright, Macmillan Computer Publishing. All rights reserved. Teach Yourself SQL in 21 Days, Second Edition Acknowledgments A special thanks to the following individuals: foremost to my loving wife, Tina, for her tolerance and endless support, to Dan Wilson for his...

Words: 128515 - Pages: 515

Premium Essay

Databases in Use

...in use:- 1. Mysql What is MS SQL? It is a relational web hosting database that is used to store web site information like blog posts or user information. MS SQL is the most popular type of database on Windows servers. It is not free but it has many advanced features that make it suitable for businesses. What is MS SQL capable of? In basic terms, an MS SQL database is capable of storing any type of that you want. It will let you quickly store and retrieve information and multiple web site visitors can use it at one time. You will use SQL statements to accomplish all of this. In more technical terms, most versions of MS SQL have the following features: • Buffer management • Logging and Transaction • Concurrency and locking • Replication services • Analysis services • Notification services • Integration services • Full text search service • Stored procedures • Triggers • Views • Sub-SELECTs (i.e. nested SELECTs) What is MS SQL used for? MS SQL is the database of choice for web applications on a Windows platform (using .NET or ASP). These languages make is extremely easy to connect to a MS SQL database. It is also used for many popular content management systems and other scripts. Learn more about what is MS SQL on its official website. They have comprehensive learning material. You should also check out the SQL tutorial on W3Schools and some articles on the SQL Community Server blog. If you are looking for a web host that supports MS SQL, look at our comparison...

Words: 2647 - Pages: 11

Free Essay

Sql Server Tools

...SQL Server 2008 Tools Tool Windows Facilitate the development and modification of database objects, as well as effective management of SQL server. Object Explorer * Explore database objects on a server. * It is a tool used to initiate most database mgt tasks. * It is arranged in a standard tree view with different groups of objects nested in folders * There is ability to create scripts based on actions performed in the graphical designs because of SQL server mgt studio is exposed through object explorer. Code Editor * It provides the ability to open, edit, or create new queries. Types of queries supported by the editor are- * Db engine queries * Analysis Services MDX Queries * Analysis Services DMX Queries * Analysis Services XMLA Queries * SQL Server Compact It is essentially a word processor. It provides color coding of syntax, multiple query windows, and partial code execution when you highlight the desired code and click on the execute button or press. Solution Explorer Microsoft SQL Server Management Studio provides two containers for managing database projects such as scripts, queries, data connections, and files: solutions and projects.  * A project is a set of files, plus related metadata such as connection information. The files in a project depend on which Microsoft SQL Server component the project is for. For example, a SQL Server project may contain data definition language (DDL) queries...

Words: 1464 - Pages: 6

Free Essay

Unit 1 Research Paper

...revisions of the SQL standard. * SQL Server version 1.0: SQL Server version 1.0 is a 16 bit server modeled in the year 1989 for supporting OS/2. * SQL Server version 1.1: SQL Server version 1.1 is also a 16 bit server designed in the year 1991 to support OS/2. * SQL Server version 4.2: SQL Server version 4.2 was released in the year 1992. SQL 4.2 is bundled with IBM OS/2 1.3 version. * SQL Server version 4.21: In the year 1993, Microsoft server 4.21 came into existence. SQL 4.21 was the first version of SQL Server that supports Windows NT. * SQL Server version 6.0: In 1995, SQL Server version 6.0 was introduced. After Windows NT, Sybase and Microsoft parted and worked on their individual design. SQL Server version 6.0 was the chief version aimed in provision of Windows NT by Microsoft. * SQL Server version 6.5: SQL Server version 6.5 got released in the year 1996. * SQL Server version 7.0: SQL Server version 7.0 was the rewritten version from Sybase legal code. The code name of SQL Server version 7.0 is Sphinx. SQL Server version 7.0 was introduced in 1998. In 1999, SQL Server version 7.0 with OLAP tools came into site. * SQL Server version 8.0 / SQL Server version 2000: SQL Server version 2000 was the first one made of IA-64 architecture. Several advancements have been made in SQL Server version 2000 which improved its performance. Later in the year 2003, SQL Server version 2000 with 64-bits was released. * SQL Server version 9.0/ SQL Server version...

Words: 1606 - Pages: 7

Premium Essay

Student

...Triana March 12, 2014 * What are the two major components of SQL and what functions do they serve? To answer this question we first have to understand what is SQL and how is it important for computer programming. Based on the information I found researching on this subject, SQL is nothing more than a database programming language designed for managing data held in a relational database management system also know as RDBMS. SQL also became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987. One of the major components of SQL is the data definition language or DDL, which manages table and index structure. This component is simply used for defining the database structure. DDL are the create, alter, rename, drop, and truncate statements which will be better explained in another question of this assignment. The other major component is data manipulation language or DML, which is used for retrieving and updating data. Said component is the subset of SQL also used to add and delete data with the use of insert, update, delete, and merge. This database language is immensely useful in the field of computer engineering. Managing data is one of the many important tasks an engineer will have to perform in his or her career. Obtaining this knowledge will ensure a much successful career for years to come. * What are the advantages and disadvantages of SQL? Like everything in...

Words: 675 - Pages: 3

Free Essay

Sql Defrag

...WHITEPAPER By Juan Rogers With an Introduction to SQL defrag manager SQL SERVER FRAGMENTATION EXPLAINED TM SUMMARY approach to identifying and resolving index fragmentation in SQL Server Warning: This white paper will get a bit technical as it is intended for DBAs who want to truly understand the details and key components of fragmentation in SQL Server. » How to judge the improvements gained by defragmenting your server » » The pros and cons of various approaches to managing fragmentation » The mechanics behind performance robbing data voids » How fragmentation affects performance » The difference between disk and SQL Server internal and external fragmentation The following is a summary of the key topics covered in this paper: monitoring and managing index fragmentation. This technical white paper will help you understand SQL Server fragmentation OVERVIEW As the data in Microsoft SQL Server tables changes their indexes change. Over time these indexes become fragmented. This fragmentation will adversely affect performance. This technical white paper provides information to help you understand the detailed mechanics behind fragmentation. It will also help you understand the methods and approaches for performing defragmentation so you can improve your SQL Server’s performance. SUMMARY WEB TWITTER FACEBOOK LINKEDIN EMEA APAC MEXICO BRAZIL US www.idera.com www.twitter.com/Idera_Software www.facebook...

Words: 3053 - Pages: 13

Free Essay

Database Design

...Clarify unclear natural language statements * Fill remaining gaps in discussions * Distinguish data and operations Requirement Analysis First step: filter essential information vs unimportant details * Essentials * There are customers, suppliers, and media content * Identify age of audience for rentals * Customers have a customer identification number * Four weeks maximal rental time. * Unimportant details * "...Rentals since a few months" * "... John Wayne.." * Names of the categories (but categories are important!) * Upcoming releases * Note: what is important depends on the application * Clarify unclear statements * Video club: admission / annual fee? * Charge per rental: price for one day the minimum? * Fill gaps * Any discounts? * What happens after...

Words: 1876 - Pages: 8

Premium Essay

Mr. 893723974

...Introduction to SQL LEARNING OBJECTIVES After studying this chapter, you should be able to: ■ Concisely define each of the following key terms: relational DBMS (RDBMS), catalog, schema, data definition language (DDL), data manipulation language (DML), data control language (DCL), scalar aggregate, vector aggregate, base table, virtual table, dynamic view, and materialized view. ■ ■ ■ ■ ■ Visit www.pearsonhighered.com/ hoffer to view the accompanying video for this chapter. Interpret the history and role of SQL in database development. Define a database using the SQL data definition language. Write single-table queries using SQL commands. Establish referential integrity using SQL. Discuss the SQL:1999 and SQL:2008 standards. INTRODUCTION Pronounced “S-Q-L” by some and “sequel” by others, SQL has become the de facto standard language for creating and querying relational databases. (Can the next standard be the sequel to SQL?) The primary purpose of this chapter is to introduce SQL, the most common language for relational systems. It has been accepted as a U.S. standard by the American National Standards Institute (ANSI) and is a Federal Information Processing Standard (FIPS). It is also an international standard recognized by the International Organization for Standardization (ISO). ANSI has accredited the International Committee for Information Technology Standards (INCITS) as a standards development organization; INCITS is working on the next version of the SQL standard...

Words: 22483 - Pages: 90