Database Basics

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

MySQL This material uses MySQL as a reference relational database system. Although the material is relevant to all relational databases, SQL syntax and many activities are based on MySQL Server release 8.0. ______________ is a leading relational database system sponsored by Oracle. MySQL is relatively easy to install and use, yet has many advanced capabilities. MySQL runs on all major operating systems, including Linux, Unix, Mac OS, and Windows. For these reasons, MySQL is one of the most popular database systems. The latest MySQL release is 8.0, available in two editions: MySQL Community, commonly called MySQL Server, is a free edition. MySQL Server includes a complete set of database services and tools, and is suitable for non-commercial applications such as education. MySQL Enterprise is a paid edition for managing commercial databases. MySQL Enterprise includes MySQL Server and additional administrative applications.

MySQL

The ________________ ________________ - ________ _____________ is a text interface included in the MySQL Server download. The Command-Line Client allows developers to connect to the database server, perform administrative functions, and execute SQL statements. To run the Command-Line Client, a user must first open a Command Prompt on Windows or a Terminal on a Mac: Windows: Click the Start button in the Taskbar, type "cmd", then click Command Prompt. Mac: Click on the Terminal application, usually found in the Applications > Utilities folder. When MySQL Command-Line Client is started with the root account, the user is prompted to enter the root account password. Then Command-Line Client attempts to connect to the database server running on the local machine.

MySQL Command-Line Client

Some developers prefer to interact with MySQL Server via a graphical user interface. __________ _________________ is installed with MySQL Server and allows developers to execute SQL commands using an editor. When MySQL Workbench is started, the user can connect to MySQL Server running on the local machine or on the network.

MySQL Workbench

The term ____________ refers to a new generation of non-relational databases. NoSQL originally meant 'does not support SQL'. However, many NoSQL databases have added support for SQL, and 'NoSQL' has come to mean 'not only SQL'.

NoSQL

Small databases that are shared by one or two users can be managed in a text file or spreadsheet. Text files and spreadsheets are inadequate, however, as databases grow in size, complexity, and use. Large, complex databases that are shared by many users have special requirements: __________________. When many users and applications simultaneously access large databases, query response time degrades rapidly. Database systems must maintain fast response times by structuring data properly on storage media and processing queries efficiently. _____________________. Many database users should have limited access to specific tables, columns, or rows of a database. Database systems must authorize individual users to access specific data. _____________. Database systems must ensure authorized users only access permissible data. Database systems must also protect against hackers by encrypting data and restricting access. ________. Database systems must ensure data is consistent with structural and business rules. Ex: When multiple copies of data are stored in different locations, copies must be synchronized as data is updated. Ex: When a course number appears in a student registration record, the course must exist in the course catalog. ______________. Computers, database systems, and individual transactions occasionally fail. Database systems must recover from failures and restore the database to a consistent state without loss of data.

Performance, authorization, security, rules, recovery

Entities, relationships, and attributes are depicted in ER diagrams: ________________ represent entities. Entity names appear at the top of rectangles. ________ between rectangles represent relationships. _________ inside rectangles and below entity names represent attributes. ER diagrams are usually supplemented by textual descriptions of entities, relationships, and attributes.

Rectangles, Lines, Text

Data can vary in several important ways: __________. The amount of data produced and collected can vary. Ex: A small business might track an inventory of a few thousand items, but a large commerce website might track billions of items. __________. Data may be produced as numbers, text, image, audio, or video. Ex: A phone's proximity sensor generates raw numbers, and a satellite captures images. ___________. Some data sources are private while others are made publicly available. Ex: A retail company may use private customer data to discover purchasing behavior patterns, but a government may be required by law to share certain data sets.

Scope, format, access

_________________ ____________ ________________, or SQL, is the standard query language of relational database systems. The SQL standard is sponsored by the American National Standards Institute (ANSI) and the International Standards Organization (ISO). SQL is pronounced either 'S-Q-L' or 'seekwəl', but the preferred pronunciation is 'S-Q-L'. SQL was first developed at IBM in the 1970s as an experimental query language for a prototype relational database. At the time, IBM was the dominant computer company, so SQL became the dominant relational query language. Today, all relational database systems support SQL.

Structured Query Language

Historically, data was mostly _________, encoded as continuous variations on various physical media. Ex: Audio was recorded as vibrations impressed on vinyl disks. Images were recorded as chemicals on celluloid tapes. Today, data is mostly ___________, encoded as zeros and ones on electronic and magnetic media. The shift from analog to digital data facilitated the rise of __________ ______________ ________________.

analog, digital, large computer databases.

Programming Because of data independence, relational database applications can be programmed before the physical design is in place. Applications may run slowly but will generate correct results. SQL is the standard relational query language but lacks important programming features. Ex: Most SQL implementations are not object-oriented. To write a database program, SQL is usually combined with a general-purpose programming language such as C++, Java, or Python. To simplify the use of SQL with a general-purpose language, database programs typically use an ___________________ _____________________ ___________________. An application programming interface, or API, is a library of procedures or classes that links a host programming language to a database. The host language calls library procedures, which handle details such as connecting to the database, executing queries, and returning results. Ex: JDBC is a library of Java classes that access relational databases. Dozens of database APIs are available. Each programming language supports a different API. Major programming languages like C++ and Java support several APIs.

application programming interface

The term _______________ sometimes refers to a database system rather than the data managed by the system. The meaning is usually clear from context. In this material, database is used both ways.

database

A __________________ is a collection of data in a structured format. In principle, ______________ can be stored on paper or even clay tablets. In practice, however, modern _____________ are invariably stored on computers. The _________________ structure ensures that similar data is stored in a standardized manner.

database X 4

A _______________ _______________ is responsible for securing the database system against unauthorized users. A database administrator enforces procedures for user access and database system availability.

database administrator

A ________________ ________________ determines the format of each data element and the overall database structure. Database designers must balance several priorities, including storage, response time, and support for rules that govern the data. Since these priorities often conflict, database design is technically challenging.

database designer

A ___________ ________________ develops computer programs that utilize a database. Database programmers write applications that combine database query languages and general-purpose programming languages. Query languages and general-purpose languages have significant differences, so database programming is a specialized challenge.

database programmer

Many modern databases contain trillions of bytes of data and support thousands of simultaneous users. Consequently, databases must be managed with sophisticated software tools: A ______________ ____________, also known as a database management system or DBMS, is software that reads and writes data in a database. Database systems ensure data is secure, internally consistent, and available at all times. These functions are challenging for large databases with many users, so database systems are complex. A ______________ _____________ is a specialized programming language, designed specifically for database systems. Query languages read and write data efficiently, and differ significantly from general-purpose languages such as Python, Java, and C++. A ________________ ___________________ is software that helps business users interact with database systems. Many databases are complex, and most users are not familiar with query languages. Consequently, direct database access is usually not feasible. Instead, programmers write applications to simplify the user experience and ensure data access is efficient and secure.

database system, query language, database application

A _______________ ________ is a consumer of data in a database. Database users request, update, or use stored data to generate reports or information. Database users usually access the database via applications but can also submit queries directly to the database system.

database user

MySQL Server returns an____________ _____________ and description when an SQL statement is syntactically incorrect or the database cannot execute the statement.

error code

Database software is organized in _____________. Applications interact with a query language on one layer, and a query language interacts with a database system on another layer. Other software layers, such as the operating system, are beyond the scope of this material.

layers

Logical design The ___________ ___________ phase implements database requirements in a specific database system. For relational database systems, logical design converts entities, relationships, and attributes into tables, keys, and columns. A _________ is a column used to identify individual rows of a table. Tables, keys, and columns are specified in SQL with CREATE TABLE statements. The logical design is depicted in a table diagram. Table diagrams are similar to ER diagrams but more detailed: Rectangles represent tables. Table names appear at the top of rectangles. Text within rectangles and below table names represents columns. Solid bullets (●) indicate key columns. Empty bullets (○) and arrows indicate columns that refer to keys. The logical design, as specified in SQL and depicted in a table diagram, is called a database ____________.

logical design, key, schema

Physical design The ______________ ____________ phase adds indexes and specifies how tables are organized on storage media. Ex: Rows of a table may be sorted on the values of a column and stored in sort order. Physical design is specified with SQL statements such as CREATE INDEX and, like logical design, is specific to a database system. Physical design can be depicted in diagrams. However, logical design is more important for database users and programmers, so physical design diagrams are not commonly used. In relational databases, logical and physical design affect queries differently. Logical design affects the query result. Physical design affects query processing speed but never affects the query result. The principle that physical design never affects query results is called _______ _____________________. Data independence allows database designers to tune query performance without changes to application programs. When database designers modify indexes or row order, applications run faster or slower but always generate the same results. Prior to relational databases, most database systems did not support data independence. Performance tuning often forced time-consuming changes to applications. Data independence is a major advantage of relational databases and contributed to the rapid adoption of relational technology in the 1980s.

physical design, data independence

Common queries A database system responds to queries written in a query language. A _________ is a command for a database that typically inserts new data, retrieves data, updates data, or deletes data from a database. A ________ ______________ is a computer programming language for writing database queries.

query, query language

_________________ has many alternative names, such as conceptual design, entity-relationship modeling, and requirements definition.

Analysis

A database design is a specification of database objects such as tables, columns, data types, and indexes. Database design also refers to the process used to develop the specification. For small, simple databases, the database design process can be informal and unstructured. For large, complex databases, the process has three phases: _______________ ___________ ______________ ____________ ______________ The analysis phase specifies database requirements without regard to a specific database system. Requirements are represented as entities, relationships, and attributes. An entity is a person, place, activity, or thing. A relationship is a link between entities, and an attribute is a descriptive property of an entity.

Analysis, logical design, physical design

The _______________ of a database system describes the internal components and the relationships between components. At a high level, the components of most database systems are similar: The ______ ____________ interprets queries, creates a plan to modify the database or retrieve data, and returns query results to the application. The query processor performs query optimization to ensure the most efficient instructions are executed on the data. The ____________ _____________ translates the query processor instructions into low-level file-system commands that modify or retrieve data. Database sizes range from megabytes to many terabytes, so the storage manager uses indexes to quickly locate data. The ___________________ ____________ ensures transactions are properly executed. The transaction manager prevents conflicts between concurrent transactions. The transaction manager also restores the database to a consistent state in the event of a transaction or system failure. The ________ is a file containing a complete record of all queries processed by the database. The transaction manager writes log records before applying changes to the database. In the event of a failure, the transaction manager uses log records to restore the database. The _____________, also known as a data dictionary, is a directory of tables, columns, indexes, and other database objects. Other components use catalog information to process and execute queries.

Architecture, query processor, storage manager, transaction manager, log, catalog

The four common queries are sometimes referred to as ___________ operations, an acronym for Create, Read, Update, and Delete data.

CRUD

_________ is numeric, textual, visual, or audio information that describes real-world systems. _________ is collected and processed to aid in a variety of tasks, such as forecasting weather, analyzing financial investments, and tracking the global spread of pandemics.

Data, Data

______________ ___________ have different capabilities, and component details vary significantly. Ex: Some database systems do not support transactions and therefore have no transaction manager. Ex: The storage manager implementation depends on the physical structure of data on storage media.

Database systems

________ ______________________ are not designed for these demanding requirements. The limitations of file systems became clear as business adopted computers in the 1960s. Since then, database systems have replaced file systems for large databases with many users.

File systems

An SQL statement is a database command, such as a query that inserts, retrieves, updates, or deletes data: ______________ inserts rows into a table. _____________ retrieves data from a table. ________________ modifies data in a table. __________________ deletes rows from a table. The SQL language contains many other statements for creating and deleting databases, creating and deleting tables, assigning user permissions, and so on.

INSERT, SELECT, UPDATE, DELETE

The SQL CREATE TABLE statement creates a new table by specifying the table and column names. Each column is assigned a data type that indicates the format of column values. Data types can be numeric, textual, or complex. Ex: _______ stores integer values. ___________ stores fractional numeric values. _____________stores textual values. _________ stores year, month, and day. Some data types are followed by one or two numbers in parentheses, indicating the size of the data type. Ex: VARCHAR(10) indicates ten characters. DECIMAL(10, 3) indicates ten significant digits, including three after the decimal point.

INT, DECIMAL, VARCHAR, DATE

Most leading database systems are relational. A ___________ ____________ stores data in tables, columns, and rows, similar to a spreadsheet. All data in a column has the same format. All data in a row represents a single object, such as a person, place, product, or activity. All relational database systems support the ____ _____________ _________________. SQL stands for Structured Query Language and includes statements that read and write data, create and delete tables, and administer the database system. Relational systems are ideal for databases that require an accurate record of every transaction, such as banking, airline reservation systems, and student records. The growth of the internet in the 1990s generated massive volumes of online data, called big data, often with poorly structured or missing information. Relational systems were not initially designed for _______ _________ and, as a result, many non-relational systems have appeared since 2000. The newer non-relational systems are called ___________ , for 'not only SQL', and are optimized for big data. Prior to 2000, most database systems were commercial products, developed by for-profit companies and licensed for a fee. Since 2000, an alternative licensing model, called open source, has become popular. ___________ _____________ software is software that anyone can inspect, copy, and modify with no licensing fee. NoSQL and open source systems have proliferated, and hundreds of database systems are now available. The website db-engines.com ranks systems by tracking product references on social media, internet searches, job websites, and technical websites. Internet references are an imperfect measure of product utilization, but do provide a general indication of interest and activity.

relational database, SQL query language, big data, NoSQL, Open source

When installing MySQL Server, the user must enter a password for the ________ _______________, the administrative account that has full control of MySQL. Other database user accounts may optionally be created. After installation, MySQL Server runs as a service in the background. MySQL Server automatically starts and stops when the operating system starts and stops.

root account

Transaction management is a particularly challenging requirement for database systems. A ___________________ is a group of queries that must be either completed or rejected as a whole. Execution of some, but not all, queries results in inconsistent or incorrect data. Ex: A debit-credit transaction transfers funds from one bank account to another. The first query removes $100 from one account and the second query deposits $100 in another account. If the first query succeeds but the second fails, $100 is mysteriously lost. The transaction must process either both queries or neither query. When processing transactions, database systems must: Ensure transactions are processed completely or not at all. A computer or application might fail while processing a transaction. When failing to process a transaction, the database system must reverse partial results and restore the database to the values prior to the transaction. Prevent conflicts between concurrent transactions. When multiple transactions access the same data at the same time, a conflict may occur. Ex: Sam selects a seat on a flight. Maria purchases the same seat in a separate transaction before Sam completes his transaction. When Sam clicks the 'purchase' button, his seat is suddenly unavailable. Ensure transaction results are never lost. Once a transaction completes, transaction results must always be saved on storage media, regardless of application or computer failures. The above requirements are supported in sophisticated transaction management subsystems of most database systems.

transaction,


Kaugnay na mga set ng pag-aaral

Chapter 43: Nursing Management: Lower Gastrointestinal Problems, ch.44 liver, pancreas, and biliary tract problems, MedSurg Ch. 61, Lewis Ch. 44, Chapter 43: Nursing Management: Lower Gastrointestinal Problems practice questions, Chapter 59 Chronic N...

View Set

Busc-1B Microeconomics final study guide

View Set

Trauma, Crisis, Disaster, and Related Disorders - Mental Health

View Set

NJ Laws, Rules & Regulations Common to All Lines

View Set

File Systems/File Management Quiz

View Set

7. Motsvarigheter till svenskans "det" (Choose: Write)

View Set