Introduction to Relational Database David Gerbing School of Business

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Relational Database David Gerbing School of Business Introduction to Relational Database David Gerbing School of Business Administration Portland State University Table of Contents SECTION I BASIC RELATIONAL DATABASE CONCEPTS ..... 1 Introduction ............................................................................................................................................................ 2 Database Management Systems ......................................................................................................................... 2 History ................................................................................................................................................................ 3 Database Structure ................................................................................................................................................ 4 Tables ................................................................................................................................................................. 4 Limitations of Representing Disparate Data Types with a Single Table ........................................................... 5 One-to-Many Relationships across Multiple Tables .......................................................................................... 7 Forms .................................................................................................................................................................... 12 Database Analysis ................................................................................................................................................ 13 Queries ............................................................................................................................................................. 14 Reports ............................................................................................................................................................. 14 Example: The Invoicing Database ..................................................................................................................... 16 Invoicing Structure ........................................................................................................................................... 16 OrderLine subform ........................................................................................................................................... 18 Database Design and Use .................................................................................................................................... 19 References ............................................................................................................................................................. 21 Further Reading ............................................................................................................................................... 21 Endnotes ........................................................................................................................................................... 21 © David W. Gerbing, 2013 Section I Basic Relational Database Concepts This section introduces the basic vocabulary and central concepts of a relational database, including the tables that store the data and the one-to-many relationships that link the data across tables. This section also introduces the data analysis techniques of queries and reports. These concepts are applied to the description of an invoicing database. Relational Database Introduction Databases store and organize data. The names, addresses, and phone numbers in a phone book constitute a database, as does a collection of recipes stored on a set of index cards. A database is a stored, structured, integrated and retrievable set of data. Today most organizations and businesses store their databases on computer systems. Computerized databases include accounting applications such as invoicing, accounts receivable, and accounts payable. Other business examples include sales management applications organized around lists of customers and potential customers, inventory control, and the pictures and descriptions of a company’s products available for sale over the Internet. Database Management Systems The concept of a DBMS. An application program and related files for managing a computerized database form a Database Management System (DBMS). As Table 1 illustrates, a DBMS allows a user to (a) enter and modify the data, (b) organize the data, and then (c) retrieve and/or summarize the data. Table 1. Database activities. Activity Examples change a customer’s order Manipulate Data enter a new student into the class roster delete a student from the class roster locate all past due invoices Organize Data sort a list of students by their last name locate all students registered for a particular class calculate total sales over the last year by zip code Retrieve and/or Summarize Data list students in a class on the computer screen create a disk file of students in the class print a listing of students in the class DBMS programs span a wide range of power and usability. A desktop DBMS runs on a personal computer for only a single user. A server DBMS allows simultaneous access to one set of data by multiple users at different computers. The individual users or clients connect to the server computer that stores the data that all users access. A small office or departmental server DBMS may allow a dozen users to simultaneously access the database. The most powerful server DBMS programs run on the largest mainframe computers and allow 2 Gerbing © 2013 I. Database Concepts hundreds, thousands, or even tens of thousands of users, all simultaneously modifying, processing, and retrieving data. Some specific DBMS programs. The most widely installed DBMS at the personal computer level is Microsoft Accessi, restricted to the Windows family of operating systems. The most widely used DBMS that runs on both Windows and Macintosh personal computers is Filemaker Pro. PC Magazineii (2012) named FileMaker Pro 12 as Editor’s Choice for Best Personal Database. One reason for this high rating is that Filemaker Pro is simpler to use than MS Access but still delivers much of the power of the more sophisticated and correspondingly more difficult to use DBMS. Filemaker also more easily generalizes from one to hundreds of users, whereas Access is limited to only several users at a time. Large companies and organizations run their database systems on mainframe computers. Examples include airline reservation systems, bank records, and student records for large universities. The most widely installed large-scale DBMS is Oracleiii. The large-scale DBMS with the second highest number of installations is IBM’s DB2iv. Microsoft’s entry into the large-scale database field is SQL Serverv, which is often integrated with a graphical user-interface provided by MS Access (or similar product such as 4D). Versions of these large- scale systems also run on smaller computers. The Unix world offers several powerful commercial and open-source (free) DBMS’s. Perhaps the most powerful and full-featured open-source database that runs on Windows and Unix (and therefore Macintosh) is PostgreSQLvi. MySQL is another popular open-source product, particularly for working with data on web sites such as customer lists and products offered for salevii. MySQL is more of a file manager than a true relational database, a kind of database- light. SQLite is a very small free, open source database that is widely used in many applications. For example, SQLite is at the core of many iPhone applications, providing the structure for storing and organizing data. History An IBM researcher, Ted Codd, proposed the concept of a relational database in 1970. Based on Codd’s work, IBM developed the first versions of the standard relational database programming language called SQL. IBM, however, already sold a type of commercially successful database that preceded the relational database, so the company did not innovate for fear of undermining their existing product. Larry Ellison seized the opportunity in the early 1980s and founded Oracle Corporation, which offered the first commercial relational database Gerbing © 2013 3 Relational Database based on the SQL language. Oracle’s database market preeminence continues todayviii,ix. Appearing in 1985 on the Macintosh, 4D was one of the first database programs for a personal computer. 4D was also the very first database application to offer a graphical user interface – when all other mainframe and PC databases were limited to text interfaces. Database Structure Different DBMS’s organize data differently. The most common type of database structure is the relational database. A relational database stores all data in a series of related tables. Some forms of databases (hierarchical and network) predate the relational database, and a newer form of database structure, the object-oriented database, is emerging. However, the vast majority of contemporary databases, including those previously discussed such as Microsoft Access and 4D, follow the relational model. Tables Entity Type Fields A table organizes data by columns and Customer Last First Addr1 Records rows. The table in Smith John 22 NE 22nd St Table Figure 1 contains Jackson Sally 33 NE 33rd St data for two customers. An actual Figure 1. Database table with two records (Customers). Customer database table may contain data for millions of customers. All of the data in a table describes a particular type
Recommended publications
  • Database Systems Administrator FLSA: Exempt
    CLOVIS UNIFIED SCHOOL DISTRICT POSITION DESCRIPTION Position: Database Systems Administrator FLSA: Exempt Department/Site: Technology Services Salary Grade: 127 Reports to/Evaluated by: Chief Technology Officer Salary Schedule: Classified Management SUMMARY Gathers requirements and provisions servers to meet the district’s need for database storage. Installs and configures SQL Server according to the specifications of outside software vendors and/or the development group. Designs and executes a security scheme to assure safety of confidential data. Implements and manages a backup and disaster recovery plan. Monitors the health and performance of database servers and database applications. Troubleshoots database application performance issues. Automates monitoring and maintenance tasks. Maintains service pack deployment and upgrades servers in consultation with the developer group and outside vendors. Deploys and schedules SQL Server Agent tasks. Implements and manages replication topologies. Designs and deploys datamarts under the supervision of the developer group. Deploys and manages cubes for SSAS implementations. DISTINGUISHING CAREER FEATURES The Database Systems Administrator is a senior level analyst position requiring specialized education and training in the field of study typically resulting in a degree. Advancement to this position would require competency in the design and administration of relational databases designated for business, enterprise, and student information. Advancement from this position is limited to supervisory management positions. ESSENTIAL DUTIES AND RESPONSIBILITIES Implements, maintains and administers all district supported versions of Microsoft SQL as well as other DBMS as needed. Responsible for database capacity planning and involvement in server capacity planning. Responsible for verification of backups and restoration of production and test databases. Designs, implements and maintains a disaster recovery plan for critical data resources.
    [Show full text]
  • The Relational Data Model and Relational Database Constraints
    chapter 33 The Relational Data Model and Relational Database Constraints his chapter opens Part 2 of the book, which covers Trelational databases. The relational data model was first introduced by Ted Codd of IBM Research in 1970 in a classic paper (Codd 1970), and it attracted immediate attention due to its simplicity and mathematical foundation. The model uses the concept of a mathematical relation—which looks somewhat like a table of values—as its basic building block, and has its theoretical basis in set theory and first-order predicate logic. In this chapter we discuss the basic characteristics of the model and its constraints. The first commercial implementations of the relational model became available in the early 1980s, such as the SQL/DS system on the MVS operating system by IBM and the Oracle DBMS. Since then, the model has been implemented in a large num- ber of commercial systems. Current popular relational DBMSs (RDBMSs) include DB2 and Informix Dynamic Server (from IBM), Oracle and Rdb (from Oracle), Sybase DBMS (from Sybase) and SQLServer and Access (from Microsoft). In addi- tion, several open source systems, such as MySQL and PostgreSQL, are available. Because of the importance of the relational model, all of Part 2 is devoted to this model and some of the languages associated with it. In Chapters 4 and 5, we describe the SQL query language, which is the standard for commercial relational DBMSs. Chapter 6 covers the operations of the relational algebra and introduces the relational calculus—these are two formal languages associated with the relational model.
    [Show full text]
  • SQL Vs Nosql: a Performance Comparison
    SQL vs NoSQL: A Performance Comparison Ruihan Wang Zongyan Yang University of Rochester University of Rochester [email protected] [email protected] Abstract 2. ACID Properties and CAP Theorem We always hear some statements like ‘SQL is outdated’, 2.1. ACID Properties ‘This is the world of NoSQL’, ‘SQL is still used a lot by We need to refer the ACID properties[12]: most of companies.’ Which one is accurate? Has NoSQL completely replace SQL? Or is NoSQL just a hype? SQL Atomicity (Structured Query Language) is a standard query language A transaction is an atomic unit of processing; it should for relational database management system. The most popu- either be performed in its entirety or not performed at lar types of RDBMS(Relational Database Management Sys- all. tems) like Oracle, MySQL, SQL Server, uses SQL as their Consistency preservation standard database query language.[3] NoSQL means Not A transaction should be consistency preserving, meaning Only SQL, which is a collection of non-relational data stor- that if it is completely executed from beginning to end age systems. The important character of NoSQL is that it re- without interference from other transactions, it should laxes one or more of the ACID properties for a better perfor- take the database from one consistent state to another. mance in desired fields. Some of the NOSQL databases most Isolation companies using are Cassandra, CouchDB, Hadoop Hbase, A transaction should appear as though it is being exe- MongoDB. In this paper, we’ll outline the general differences cuted in iso- lation from other transactions, even though between the SQL and NoSQL, discuss if Relational Database many transactions are execut- ing concurrently.
    [Show full text]
  • Applying the ETL Process to Blockchain Data. Prospect and Findings
    information Article Applying the ETL Process to Blockchain Data. Prospect and Findings Roberta Galici 1, Laura Ordile 1, Michele Marchesi 1 , Andrea Pinna 2,* and Roberto Tonelli 1 1 Department of Mathematics and Computer Science, University of Cagliari, Via Ospedale 72, 09124 Cagliari, Italy; [email protected] (R.G.); [email protected] (L.O.); [email protected] (M.M.); [email protected] (R.T.) 2 Department of Electrical and Electronic Engineering (DIEE), University of Cagliari, Piazza D’Armi, 09100 Cagliari, Italy * Correspondence: [email protected] Received: 7 March 2020; Accepted: 7 April 2020; Published: 10 April 2020 Abstract: We present a novel strategy, based on the Extract, Transform and Load (ETL) process, to collect data from a blockchain, elaborate and make it available for further analysis. The study aims to satisfy the need for increasingly efficient data extraction strategies and effective representation methods for blockchain data. For this reason, we conceived a system to make scalable the process of blockchain data extraction and clustering, and to provide a SQL database which preserves the distinction between transaction and addresses. The proposed system satisfies the need to cluster addresses in entities, and the need to store the extracted data in a conventional database, making possible the data analysis by querying the database. In general, ETL processes allow the automation of the operation of data selection, data collection and data conditioning from a data warehouse, and produce output data in the best format for subsequent processing or for business. We focus on the Bitcoin blockchain transactions, which we organized in a relational database to distinguish between the input section and the output section of each transaction.
    [Show full text]
  • Reactive Relational Database Connectivity
    R2DBC - Reactive Relational Database Connectivity Ben Hale<[email protected]>, Mark Paluch <[email protected]>, Greg Turnquist <[email protected]>, Jay Bryant <[email protected]> Version 0.8.0.RC1, 2019-09-26 © 2017-2019 The original authors. Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. 1 Preface License Specification: R2DBC - Reactive Relational Database Connectivity Version: 0.8.0.RC1 Status: Draft Specification Lead: Pivotal Software, Inc. Release: 2019-09-26 Copyright 2017-2019 the original author or authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Foreword R2DBC brings a reactive programming API to relational data stores. The Introduction contains more details about its origins and explains its goals. This document describes the first and initial generation of R2DBC. Organization of this document This document is organized into the following parts: • Introduction • Goals • Compliance • Overview • Connections • Transactions 2 • Statements • Batches • Results • Column and Row Metadata • Exceptions • Data Types • Extensions 3 Chapter 1.
    [Show full text]
  • Examples of Relational Database Model
    Examples Of Relational Database Model Discerning Ajai never dally so hardheadedly or die-cast any macaronics warily. Flutiest Noble necessitating: he syllabicating his magnificoes inexplicably and deprecatorily. Taliped Ram zeroes, his decerebration revving strangle verbally. Several products exist to support such databases. Simply click the image would make changes online. Note that a constraint implies an index on the same label and property. So why should we use a database? Gain new system that data typing sql programs operate, documents can write business logic in relational database examples of organization might like i have all elements which is. In sql and domains like spreadsheet, difference and gathering data? DRDA enables network connected relational databases to cooperate to fulfill SQL requests. So what is our use case? And because these databases are expensive, you tend to put everything in there. Individual tables to? It will take us a couple of weeks going over these skills and concepts. When there is a one to one relationship, one of two actions typically occur. In database examples of relational model was one. Graph models and graph queries are two sides of pain same coin. Some research data stores replicate a given blob across multiple server nodes, which enables fast parallel reads. Why relational structure of relational schema? Each model database model? But what if item prices were negotiated on each order or there were special promotions? Other data on database relational databases went from. The domain is better user not relational model support multiple bills in other. There is called relation which columns? In english as a model developed procedures for example, music collection of models are generic visual basic skill every tuple, it natural join.
    [Show full text]
  • Relational Database Fundamentals
    05_04652x ch01.qxp 7/10/06 1:45 PM Page 7 Chapter 1 Relational Database Fundamentals In This Chapter ᮣ Organizing information ᮣ Defining database ᮣ Defining DBMS ᮣ Comparing database models ᮣ Defining relational database ᮣ Considering the challenges of database design QL (pronounced ess-que-ell, not see’qwl) is an industry-standard language Sspecifically designed to enable people to create databases, add new data to databases, maintain the data, and retrieve selected parts of the data. Various kinds of databases exist, each adhering to a different conceptual model. SQL was originally developed to operate on data in databases that follow the relational model. Recently, the international SQL standard has incorporated part of the object model, resulting in hybrid structures called object-relational databases. In this chapter, I discuss data storage, devote a section to how the relational model compares with other major models, and provide a look at the important features of relational databases. Before I talk about SQL, however, I need to nail down what I mean by the term database. Its meaning has changed as computers have changed the way people record and maintain information. COPYRIGHTED MATERIAL Keeping Track of Things Today, people use computers to perform many tasks formerly done with other tools. Computers have replaced typewriters for creating and modifying documents. They’ve surpassed electromechanical calculators as the best way to do math. They’ve also replaced millions of pieces of paper, file folders, and file cabinets as the principal storage medium for important information. Compared to those old tools, of course, computers do much more, much faster — and with greater accuracy.
    [Show full text]
  • A Survey of Ledger Technology-Based Databases
    future internet Article A Survey of Ledger Technology-Based Databases Dénes László Fekete 1 and Attila Kiss 1,2,* 1 Department of Information Systems, ELTE Eötvös Loránd University, 1117 Budapest, Hungary; [email protected] 2 Department of Informatics, J. Selye University, 945 01 Komárno, Slovakia * Correspondence: [email protected] Abstract: The spread of crypto-currencies globally has led to blockchain technology receiving greater attention in recent times. This paper focuses more broadly on the uses of ledger databases as a traditional database manager. Ledger databases will be examined within the parameters of two categories. The first of these are Centralized Ledger Databases (CLD)-based Centralised Ledger Technology (CLT), of which LedgerDB will be discussed. The second of these are Permissioned Blockchain Technology-based Decentralised Ledger Technology (DLT) where Hyperledger Fabric, FalconDB, BlockchainDB, ChainifyDB, BigchainDB, and Blockchain Relational Database will be examined. The strengths and weaknesses of the reviewed technologies will be discussed, alongside a comparison of the mentioned technologies. Keywords: ledger technology; permissioned blockchain; centralised ledger database 1. Introduction Citation: Fekete, D.L.; Kiss, A. A In recent years, we have been witness to the rise of multiple new ledger technologies. Survey of Ledger Technology-Based Since Satosi Nakamoto wrote the Bitcoin white paper [1] in 2009, many different systems Databases. Future Internet 2021, 13, that endeavour to provide decentralization and trustless collaboration have been developed 197. https://doi.org/10.3390/ based on blockchain technology. Of late, a great amount of research and academia has been fi13080197 focused on the further development and reformation of the basis of blockchain in an attempt to solve the issues that continue to arise [2–4].
    [Show full text]
  • March 2017 Report
    BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 6 Professional Graduate Diploma in IT ADVANCED DATABASE MANAGEMENT SYSTEMS March 2017 Answer any THREE questions out of FIVE. All questions carry equal marks. Time: THREE hours Answer any Section A questions you attempt in Answer Book A Answer any Section B questions you attempt in Answer Book B The marks given in brackets are indicative of the weight given to each part of the question. Calculators are NOT allowed in this examination. Section A Answer Section A questions in Answer Book A A1 Examiner's General Comments This was a fairly popular question, attempted by around half of the candidates, with two-thirds of the attempts achieving pass level marks. Therefore, the performance was generally quite good with a wide range of marks, some candidates producing near correct solutions. The definition of a true distributed database system is that it consists of a collection of geographically remote sites of physical databases, connected together via some kind of communication network, in which a user at any site can access data anywhere in the network exactly as if the data were all stored in one single database at the user’s own site. a) Explain the problems associated with achieving a true distributed database in practice. 12 marks ANSWER POINTER Fragmentation of tables requires maintenance of unique keys across horizontal fragments and consistency of primary keys that are reflected in vertical fragments. Also increased network traffic occurs as many fragments may need to be consulted to perform one query.
    [Show full text]
  • Introduction to Relational Databases and SQL
    11 Introduction to Relational Databases and SQL Chapter Overview This chapter defines the basic terms of relational databases and the various kinds of datatypes available in popular database-management systems. The chapter also discusses the history and significance of Structured Query Language (SQL), the universal lan- guage for reading and writing data from relational databases. Chapter Objectives In this chapter, we will: ❍ Study the terms and concepts of relational databases ❍ Study the basic concepts of datatypes ❍ Learn about the history and importance of SQL as a database language ❍ Learn how to issue SQL commands using common database engines Database Concepts Relational databases have been around for 30 years, but they were not the original kind of database, nor are they the newest kind of database. XML and object-oriented data structures have evolved in recent years. But relational databases are still by far the most popular kind of database available and will be for some time to come. Before we get into the details of using SQL (Structured Query Language), it is important to understand some of the history and terminology associated with relational databases. The first computerized database-management systems were very different from the relational database systems we see today in products such as Oracle, SQL Server, and MySQL. In the 1970s, two data models were commonly used: hierarchical and network. 1 2 Chapter One—Introduction to Relational Databases and SQL Hierarchical Databases The hierarchical model dates back to the early 1960s and is the oldest of the database models. The most popular hierarchical database management system was IBM’s IMS, which is still in use today.
    [Show full text]
  • Mssql Database Schema Diagram
    Mssql Database Schema Diagram Unconcealing Hendrik sometimes lown his love-tokens inestimably and amalgamating so scantly! Forkiest and evidentiary Tod pacifying his Calder bespeaks roll widdershins. Unequaled Christos redecorate compulsively. To select either by establishing pairings of database schema objects structure To visualize a database you never create one explain more diagrams illustrating some or all refer the tables columns keys and relationships in manual For any couple you have create as many database diagrams as strong like this database vault can guard on any process of diagrams. Entity Data Modeling with Visual Studio James Serra's Blog. Entity Relationship Diagrams ERDs Lucidchart. SchemaSpy. SQL Server Database Diagram Tool in Management Studio. How know you diagram a SQL database? SQL Server How to export Database Diagram to Excel. Documentation script Introducing schema documentation in SQL Server. Diagrams Data model definition Define data model manually with YAML Extract data model from R data frames Reverse-engineer SQL Server Database. Tables are the brown primary building blocks of a database A Table is very much house a pit table or spreadsheet containing rows records arranged in different columns fields At the intersection of notice and outside row cost the individual bit of fair for easy particular record called a cell. Display views in database diagram SQLServerCentral. Above is follow simple example saw a schema diagram It shows three tables along with primitive data types relationships between the tables as specific as there primary keys and foreign keys. In this ER Diagram view log can become table fields and relationships between tables in data database andor schema graphically It also allows adding foreign key.
    [Show full text]
  • A Methodology for Evaluating Relational and Nosql Databases for Small-Scale Storage and Retrieval
    Air Force Institute of Technology AFIT Scholar Theses and Dissertations Student Graduate Works 9-1-2018 A Methodology for Evaluating Relational and NoSQL Databases for Small-Scale Storage and Retrieval Ryan D. Engle Follow this and additional works at: https://scholar.afit.edu/etd Part of the Databases and Information Systems Commons Recommended Citation Engle, Ryan D., "A Methodology for Evaluating Relational and NoSQL Databases for Small-Scale Storage and Retrieval" (2018). Theses and Dissertations. 1947. https://scholar.afit.edu/etd/1947 This Dissertation is brought to you for free and open access by the Student Graduate Works at AFIT Scholar. It has been accepted for inclusion in Theses and Dissertations by an authorized administrator of AFIT Scholar. For more information, please contact [email protected]. A METHODOLOGY FOR EVALUATING RELATIONAL AND NOSQL DATABASES FOR SMALL-SCALE STORAGE AND RETRIEVAL DISSERTATION Ryan D. L. Engle, Major, USAF AFIT-ENV-DS-18-S-047 DEPARTMENT OF THE AIR FORCE AIR UNIVERSITY AIR FORCE INSTITUTE OF TECHNOLOGY Wright-Patterson Air Force Base, Ohio DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited. AFIT-ENV-DS-18-S-047 The views expressed in this paper are those of the author and do not reflect official policy or position of the United States Air Force, Department of Defense, or the U.S. Government. This material is declared a work of the U.S. Government and is not subject to copyright protection in the United States. i AFIT-ENV-DS-18-S-047 A METHODOLOGY FOR EVALUATING RELATIONAL AND NOSQL DATABASES FOR SMALL-SCALE STORAGE AND RETRIEVAL DISSERTATION Presented to the Faculty Department of Systems and Engineering Management Graduate School of Engineering and Management Air Force Institute of Technology Air University Air Education and Training Command In Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy Ryan D.
    [Show full text]