Free Essay

Database Management

In:

Submitted By Amemendoza
Words 673
Pages 3
Written Assignment 3
Explain the SQL commands Union, Intersect, and Minus with concepts like union-compatibility, and syntax alternatives such as IN/NOT IN and various JOIN options
Database Management CIS-311

There are many different SQL commands. This assignment will focus on UNION, INTERSECT, and MINUS. UNION combines unique rows returned by two SELECT statements. UNION ALL functions in the same way as UNION except that it also returns duplicates. INTERSECT gives you rows that are found in both queries by eliminating rows that are only found in one or the other. An INTERSECT is simply an inner join where we compare the tuples of one table with those of the other, and select those that appear in both while weeding out duplicates. MINUS returns the rows that are in the first query but not the second by removing the rows that are only found in the second query. There are three primary SQL commands involved when implementing a Union, Intersection and difference relational operators. As you may know, SQL data manipulation commands are set-oriented which are involved in operating over entire sets of rows and columns in tables at once. The UNION, INTERSECT, and MINUS statements make sure these operations occur. Union, Intersect and Minus only work properly if relations are Union-Compatible, which is based on the names of the relation attributes that must be the same and their data types must be alike. Being compatible does not mean the data types have to be exactly the same. For example, both data types can be used to store numeric values such as NUMBER and SMALLINT as well as character (string) values such as VARCHAR and CHAR. An SQL IN statement can be used with where clause to list a set of matching records of a table. We can use SQL IN query with a NOT combination to filter out some records. We can link or collect data from two different tables using the IN command. An SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them. One common type of join is INNER JOIN. This is a simple join. An SQL INNER JOIN return all rows from multiple tables where the join condition is met. A LEFT JOIN returns all rows where there is at least one match in both tables. A LEFT JOIN returns all rows from the left table and matching rows from the right table. A RIGHT JOIN returns all rows from the right table and matching rows from the left table. A FULL JOIN returns all rows when there is a match in one of the tables. Inner joins return rows only when there is at least one row from both tables that matches the join condition. Inner joins eliminate the rows that do not match with a row from the other table. Outer joins, however, return all rows from at least one of the tables or views mentioned in the FROM clause, as long as those rows meet any WHERE or HAVING search conditions. All rows are retrieved from the left table referenced with a left outer join, and all rows from the right table referenced in a right outer join. All rows from both tables are returned in a full outer join. An EQUI JOIN performs a JOIN against equality or matching column, or columns values of the associated tables and an equal sign is used as comparison operator in the WHERE clause to refer equality. The SQL NATURAL JOIN is a type of EQUI JOIN and is structured in such a way that, columns with same name of associate tables will appear once only In a NATURAL JOIN, the associated tables have one or more pairs of identically named columns and of the same data type.The ON clause is not used in a NATURAL JOIN.

NOTE: Since all information contained in this assignment is found in more than 3 sources, which makes it common knowledge, I did not use citations.

Similar Documents

Premium Essay

Database Management

...PT2540 Database Management Systems Database can serve as a very important tool that companies use to track and store data. There are many different kinds of databases you need to make sure that the database is compatible with the operating system. It is always best to research the database to determine if it will fulfil all your needs of your database. While reviewing the four different databases such as the Oracle 11G, MySQL, IBM DB2, and Microsoft Sql Server 2008 which are all impressive databases, I chose to implement the IBM DB2 database system for Wildwood apartments. The key features that IBM DB2 has are table partitioning, database portioning, massively parallel processing (MPP), Continuous Ingest, Multidimensional clustering (MDC), Aggregates, Multi-Temperature Data Management, Mixed Workload Management, and Control over Workloads. DB2 has a number of performance optimization capabilities that give you the insight and ability to optimize workload execution. (DB2 for Linux, UNIX, and Windows) IBM DB2 meets the requirements for Wild Wood Apartments database so the managers can input the lease information, rent payment, maintenance request and with ease complete there quarterly reports. These capabilities can save you money and lower your risks by helping you to do more work with your existing hardware, ensure Service Level Agreements (SLAs) are met or exceeded and increase DBA productivity. (DB2 for Linux, UNIX, and Windows) The database is user friendly...

Words: 628 - Pages: 3

Premium Essay

Database Management

...Database Management System OLAP (On-Line Analytical Processing) The main reason of using OLAP to answer queries is speed. Relational databases store entities in discrete tables if they have been properly normalized. This structure is good for operational databases but for complex multi-table queries is comparatively slow. A better model for querying but worse for operational use is the dimensional database. OLAP take a snapshot of a relational database and restructures it into dimensional data. The queries can then be run against this. It has been claimed that for complex queries OLAP can produce a result in around 0.1% of the time for the same query on relational data. For example a set of customers can be grouped by city, by district or by country; so with 50 cities, 8 districts and two countries there are three hierarchical levels with 60 members. These customers can be considered in relation to products; if there are 250 products with 20 categories, three families and three departments then there are 276 product members. With just these two dimensions there are 16,560 possible aggregations. As the data considered increases the number of aggregations can quickly total tens of millions or more. The second terminology that I research was Data Warehouse and Data Mart. Data Warehouse and Data Mart is corporate memory. Let's take this other terminology and break it in two part; one Data Warehouse and the second one Data Mart. Starting by Data Warehouse, academics will...

Words: 699 - Pages: 3

Premium Essay

Database Management

...1 Introduction to Databases LESSON 1 Database Learning Objectives: On completion of Lesson 1, you should have been able to: 1. Describe the role of a database system 2. Briefly describe the evolution of database systems and the limitations of conventional file processing systems 3. Describe the three schema architecture for database and explain the difference between conceptual , external and physical schemas 4. Define the functions of a database administrator Keywords and Phrases LEARNER Database Database System Entities Conceptual Model Logical Model Physical Model Constraints Metadata Database Management System File System Indexing Introduction This module introduces the reader to the different concepts of databases. It also tackles a brief history how automated databases came into existence. A number of advantages is discussed why the evolution of database management system is very much appreciated by system developers nowadays. 2 What is a Database ? Let us try to get the answers from the different Database Management System book authors. Answer from Pratt/Adamski: o A Database (DB) is structure that can store information about: 1. multiple types of entities, 2. the attributes that describe those entities; and 3. the relationships among the entities Answer from Elmasri/Navathe: o A Database (DB) is collection of related data - with the following properties: 1. A DB is logically coherent and has some relevant meaning 2. A DB is designed, built...

Words: 6349 - Pages: 26

Premium Essay

Database Management

...Businesses of all sizes organize their data records into collections called databases. Databases are a self-describing collection of integrated records and they can vary vastly in size and complexity. A byte is a character of data that is grouped into columns, or fields. These are in turn grouped into rows, which are also called records. A group of similar rows or records is called a table or file. A database is a collection of tables plus relationships among the rows in those tables, plus special data (metadata) that describes the structure of the database (Kroenke 2010). Databases are designed for three main purposes: to organize, store, and retrieve information as efficiently and effectively as possible. The components of a database are data, hardware, software, and users (Faubl 2011). A database just by itself is not useful to companies. Database application systems make database data more accessible and useful, as well as more user-friendly. Users can then use a database application that will provide them with forms such as formatted reports, queries, and application programs. Each of these will then use the database management system to process the database tables (Kroenke 2010). A database management system (DBMS), sometimes just called a database manager, is a program that lets one or more computer users create and access data in a database. The DBMS manages requests so that users and other programs are free from having to understand where the data is physically...

Words: 419 - Pages: 2

Premium Essay

Database Management

...CIV E 603: Information Modeling and Database Systems Lecture 1 1 What to Study?  Introduction to Data base  Relational Model  Database design  Structured Query Language (SQL) 22 Let’s begin the journey !! …. in to fascinating world of databases 23 Today’s outline  Database Management System (DBMS)  Entity-Relationship (ER) Model 24 What is a database?  Many people would like to call it organization… 25 What is a database? Database is a structured collection of related data. Many name it efficiency… 26 A database is  A home for data – since that is where data stay…  A manager for data – since data are organized neatly…  A GOOGLE for data – since a particular record can be found in a snap…  A guardian for data – since a database rejects malicious accesses…  … 27 What is a Database? Database: is a collection of related data Data: known facts that can be recorded and that have implicit meaning Properties of database: • represents some aspect of the real world (mini-world -UoD) • logically coherent collection of data with some inherent meaning. A random assortment of data cannot correctly be referred to as a database. • designed, built, and populated with data for a specific purpose. It has an intended groups of users. 28 What is a Database? A database can be of any size and of varying complexity. • For example, the list of...

Words: 2400 - Pages: 10

Premium Essay

Database Management

...redundancy. Relational DataBase tables – relational model emerged due to list problems. It is a collection of separate tables. Table holds data for only one theme, not multiple. When evaluating a database design, consider mod actions: insert/delete/update. Structured Query Language SQL – leading tech for data definition and manipulation. Can reconstruct lists from their underlying tables, query for specific data conditions, perform computations, can update/delete/insert data. Database System four components: * Database – collection of related tables and other structures * Database Management System DBMS – computer program used to create, process, and administer the database. Receives requests encoded in SQL and translates them into action on the database. Large complicated program licensed by software vendors. * Database Application – Set of one or more computer programs that serves as an intermediary between the user and the DBMS, These programs read or modify data by sending SQL statements to the DBMS. * Users – use the DB Application to keep track of things. Use forms to read, enter, and query data. Database – defined as self-describing (a description of the structure if the database is contained within the database itself) relational collection of tables. Metadata – data about the structure of the a database. (IE names of tables, names of columns, and the tables in which they belong, properties of tables and columns) Database contents – user data...

Words: 2798 - Pages: 12

Premium Essay

Database Management

...CIS 260 Home Work # 1 Due to: 21/3/2013 Chapter 1: Review Questions 1.1. Define the following terms: data, database, DBMS, database system, database catalog, program-data independence, user view, DBA, end user, canned transaction, meta-data, and transaction-processing application. 1.2. What four main types of actions involve databases? Briefly discuss each. 1.3. Discuss the main characteristics of the database approach and how it differs from traditional file systems. 1.4. What are the responsibilities of the DBA and the database designers? 1.5. What are the different types of database end users? Discuss the main activities of each. 1.6. Discuss the capabilities that should be provided by a DBMS. 1.7. Discuss the differences between database systems and information retrieval systems. Chapter 2: Review Questions 2.1. Define the following terms: data model, database schema, database state, internal schema, conceptual schema, external schema, data independence, DDL, DML, SDL, VDL, query language, host language, data sublanguage, database utility, catalog, client/server architecture, three-tier architecture, and n-tier architecture. 2.2. Discuss the main categories of data models. What are the basic differences between the relational model, the object model, and the XML model? 2.3. What is the difference between a database schema and a database state? 2.4. Describe the three-schema architecture. Why do we need mappings between schema levels? How do different schema definition...

Words: 1108 - Pages: 5

Premium Essay

Database Management System

...DATABASE S YSTEMS DESIGN, IMPLEMENTATION, AND MANAGEMENT CARLOS CORONEL • STEVEN MORRIS • PETER ROB Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Database Systems: Design, Implementation, and Management, Ninth Edition Carlos Coronel, Steven Morris, and Peter Rob Vice President of Editorial, Business: Jack W. Calhoun Publisher: Joe Sabatino Senior Acquisitions Editor: Charles McCormick, Jr. Senior Product Manager: Kate Mason Development Editor: Deb Kaufmann Editorial Assistant: Nora Heink Senior Marketing Communications Manager: Libby Shipp Marketing Coordinator: Suellen Ruttkay Content Product Manager: Matthew Hutchinson Senior Art Director: Stacy Jenkins Shirley Cover Designer: Itzhack Shelomi Cover Image: iStock Images Media Editor: Chris Valentine Manufacturing Coordinator: Julio Esperas Copyeditor: Andrea Schein Proofreader: Foxxe Editorial Indexer: Elizabeth Cunningham Composition: GEX Publishing Services © 2011 Cengage Learning ALL RIGHTS RESERVED. No part of this work covered by the copyright herein 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...

Words: 189848 - Pages: 760

Premium Essay

Database Management System

...Examination Paper of Data Base Management Systems IIBM Institute of Business Management Examination Paper Subject Code- E1010 Database Management Systems Section A: Objective Type (20 marks)    This section consists of Multiple Choice Questions / True & False. Answer all the questions. Each Question carries 1 mark. MM.100 Multiple Choices: 1. Structured Query Language (SQL) is the language for working with a. DDBMS b. RDBMS c. Both (a) & (b) d. None of the above 2. Decomposition in database design means a. Breaking one table into multiple tables b. Breaking two table into multiple tables c. Composing multiple tables into one table d. None of the above Locking helps a. Hiding the database b. To solve concurrency problems c. Both (a) & (b) d. None of the above 3. 4. Database optimizer a. Enhances the speed of query execution b. Minimizes the speed of query execution c. Is a program d. None of the above 5. Data is __________. a. Raw facts b. Processed information c. Both (a) & (b) d. None of the above 6. Mobile computing means a. Ability to use computer while on still b. Ability to use computer while on move c. Calculation with the help of mobile d. None of the above 1 IIBM Institute of Business Management Examination Paper of Data Base Management Systems 7. Operation Data Store (ODS) provides a. Situation sensitive decision support & operational reporting b. Time sensitive decision support & operational reporting c. Both (a) & (b) d. None of the above 8. Transaction...

Words: 831 - Pages: 4

Premium Essay

Database Management System: Legacy Database Systems

...Legacy Database Systems What is a Database? Data is collection of facts and figures which can be processed to produce information whereas a database is a collection of related data. For Example, Name of a student, age, class and the subjects can be counted as data for recording purposes. And the names, telephone numbers, and addresses of the people which have been recorded in an indexed address book or stored on a portable hard drive using software such as Microsoft Access or Excel. This collection of related data having an absolute meaning is a database. Databasе Managеmеnt Systеm: Database Management System or DBMS refers to the mechanism of storing and reclaiming users’ data with uttermost efficiency along with the sеcurity fеaturеs....

Words: 1258 - Pages: 6

Premium Essay

Relational Database Management

...Database Design: Relational Database Management Systems Marvin E. Eubanks CIS111: Introduction to Relational Database Management Systems Strayer University Professor: Emelda Ntinglet-Davis November 22, 2011 Introduction Regardless of the size of a company or business, the employees are usually considered the most important asset. However, data should rank equally important as the employees do. It is very vital that a company’s data is stored and maintained as accurately and as quickly as possible. Having a Database Management System allows a business to do just this. Database Management System (DBMS) Webopedia (2011), states it simply: “A DBMS is simply the software program on a computer that is used to store and manipulate data.” Manipulation of data consists of adding new data such as adding personal information about an employee; deleting unwanted data such as deleting the personal information of an employee who has quit or been terminated; or changing existing data such as changing the pay rate of an employee who has been promoted. Advantages to having a DBMS are it aides in data security, data integrity, data sharing, data concurrence, data independence, and data recovery to name a few. Database management systems are important because it allows businesses to manage data more efficient and effective; query language allows quick responses to ad hoc queries; improves access to more data; and reduces the chance that data will be inconsistent. Features...

Words: 899 - Pages: 4

Premium Essay

Database Management Concepts

...DATABASE MANAGEMENT CONCEPTS 1. The DBA asks for your help in planning the data archive for the following Premiere Products database:     Rep (RepNum, LastName, FirstName, Street, City, State, Zip, Commission, Rate)     Customer (CustomerNum, CustomerName, Street, City, State, Zip, Balance, CreditLimit, RepNum)     Orders (OrderNum, OrderDate, CustomerNum)     OrderLine (OrderNum, PartNum, NumOrdered, QuotedPrice)     Part (PartNum, Description, OnHand, Class, Warehouse, Price) Determine which data from the database to archive; that is, for each table, specify whether data needs to be archived. If it does, specify which data, when it should be archived, and whether it should be archived with data from another table. 2. The DBA denormalized some of the data in the Premiere Products database to improve performance, and one of the resulting tables is the following: Customer (CustomerNum, CustomerName, Street, City, State, Zip, Balance, CreditLimit, RepNum, RepName) Which field or fields cause the table to no longer be in third normal form? In which normal form is the denormalized table? 3. Does your school have a formal disaster recovery plan? If it does, describe the general steps in the plan. If it does not, describe the informal steps that would be taken if a disaster occurred. For the following exercises, you will answer problems and questions from management at Premiere Products. You do not use the Premiere Products database for any of these exercises. ...

Words: 471 - Pages: 2

Premium Essay

Maximum Security in Database Management

...Maximum Security in Database Management Maximum Security in Database Management Rackspace Introduction In the current world there people and organization experience un-eventualities and risk of their confidential information. My organization, Rackspace, is a hosting and cloud system organization. For this company it is vital that information is stored in data bases that are run by organizations, locally hosted on personal computers. Intruders can access this information if it is not properly secured. Therefore the purpose of this study is to inform about the current savvy technologies that can be applied to completely thwart intruders from accessing such delicate information within Rackspace. Part 1: Project Identification and Business Environment For this project to go on in a smooth and effective manner different individuals must carry on certain specified task. For Rackspace, this means that every person must hold on to a responsibility to properly and pursue it to the end. Some of the responsibilities are interdepended and other are depended. In case of an interdependent responsibility there will be a proper communicated channel of events that will ensure that information is traversed from one source to another to smoothen up events. Therefore, the following a list of responsible individuals who will implement the process of securing the database of an organization. Company Chief Executive Officer Responsible for overseeing the success of...

Words: 3927 - Pages: 16

Premium Essay

Database Management Systems

...Database Management System Basith Shaik Southern New Hampshire University September 7, 2015 Abstract The intent of this paper is to design and propose a database management system solution to Grandfield College for tracking software installed. I have analyzed the organizational issues and needs and developed conceptual, logical, and physical designs of DBMS solution. In order to implement the solution, substantial research had been done on best practices in design, available products, and the legal and ethical standards to which we must adhere during design. This paper includes Business rules, Conceptual, Logical, and Physical database designs, Recommendations on best DBMS required for Grandfield College, Data model, Legal Compliance, Ethical Practices, Security Needs and Security Plan Keywords: Grandfield College, Database Design, Recommendations, Business Rules, Data model, Security Plan Database Management System Grandfield College is in need of Database Management System as law requires that any business, including a school, track its software. It is important to know what software the school owns, in what versions, and what the license agreement for that software is. For this purpose I have developed a Software Tracking database for Grandfield College. Problem Grandfield College is in need of a database for effectively tracking faculty and staff computers, the software installed on those systems, User access to each computer, and requests for new software installation...

Words: 4672 - Pages: 19

Premium Essay

Portfolio Management Database Design

...Stock Portfolio Management The following exercises are designed to provide you more practice with querying an Access database. To begin this exercise, retrieve the file PortfolioManagment.accdb from Blackboard (found in the Learning Module called Databases & Access -> Presentation & Data Files). Open the database file. Design Challenges 1. Open the Client table. How many records does it have? ______ How many fields does it have? ______ 2. What is the primary key for the Client table? 3. Set the primary key for the Stock table. 4. Review the data types assigned to the Stock Purchase table. One data type is incorrect. Please correct the data type and save the change. 5. Set the primary key for the Stock Purchase table. 6. Create a form for the Client table that allows easy entry of a new client. 7. Using your form you just created, add yourself to the Client table. Call the form Client Entry Form. 8. Add your favorite stock to the Stock table. Make up data if you do not know specifically what exchange or current price it trades at. 9. Buy 100 shares of the stock that you just added to the Stock table. Query Challenges 10. Select the Stock table. Create a query called NYSE Stocks that lists all stock tickers traded on the NYSE. The resulting query should be sorted by the stock’s name. 11. Select the Stock table. Create a query called Expensive Stocks that lists all stocks whose stock price is greater...

Words: 437 - Pages: 2