Completion requirements
Unit 5: Introduction to SQL
5a. Describe SQL and summarize its basic operators
- What is SQL, and what are some of its most common uses in managing databases?
- What are some standard operators of the SQL SELECT command, and how are they used?
SQL is a communication programming language that has been around for decades. It is the standard language for relational database management systems. Organizations cannot have an effective data management program without SQL. SQL is a universal and standard language that interfaces with relational databases. SQL is used to communicate, analyze, and provide results from the data fields stored in a relational database.
A query is a question or inquiry to a data set within a database, commonly referred to as a database query. SQL queries require a SELECT statement informing the system to look for specific data. Therefore, SQL query statements retrieve records asked from a database table. The SELECT statement is probably the most commonly used SQL statement employed by end users of database systems and is worthy of your careful attention. The SELECT statement will include operators. An operator manipulates individual data items and returns a result. SQL is an industry-standard language that consists of user-defined and system-defined functions and queries.
In a DBMS, common operations like creating tables and their structures can be implemented with SQL. The language can also add, modify, and delete data from the database structure. SQL can also be used to run extractions and queries to facilitate the transformation of raw data into formatted information for use in decision support applications.
The American National Standards Institute (ANSI) adopted the official SQL standard in 1986. Then, the International Organization for Standardization (ISO) adopted SQL IN 1987. SQL is a standardized programming language used to perform various operations that manage relational database management systems (RDBMS). For example, if you are asked to identify and calculate from a table of customers whose last name is "Jones'', SQL is a programming language used to communicate this command or query to the database.
There are many advantages to learning SQL. SQL is a universal language and intersects almost every industry. SQL is open-source and easier to learn compared to other programming languages. Open-source is code that is made freely available for possible modification and redistribution. You can manage millions of rows of data using SQL. Remember, RDBMS are designed to store millions of rows of data, and SQL is the language that lets you manage enormous amounts of data.
This is the syntax of a typical SQL command:
CREATE TABLE <tablename>
(
ColumnName, Datatype, Optional Column Constraint,
ColumnName, Datatype, Optional Column Constraint,
Optional table Constraints
);
SELECT FirstName, LastName, phone
FROM Employees
ORDER BY LastName
To review, see Data Manipulation Language.
5b. Use relational views to simplify database processing
- What are database views, and how can they be used?
- What is the difference between a dynamic view and a static view?
Database views can be either static or dynamic. A dynamic view draws data from one or more tables and would include all the columns in those tables. Dynamic views are updated automatically if related or extended objects are created or changed. A static view draws data from multiple tables using the SELECT command and WHERE clauses. The WHERE clause filters records based on specified criteria. Static views must be manually updated when related or extended objects are created or changed.
To review, see Aggregate Functions and Views in SQL.
5c. Use data definition language (DDL) commands to create tables
- How is SQL used to create the database and tables?
- How is SQL used as a data definition language?
- CREATE (generates a new table)
- ALTER (changes a table)
- DROP (removes a table from the database)
To review, see More on SQL.
Unit 5 Vocabulary
This vocabulary list includes the terms that you will need to know to successfully complete the final exam.- ALTER
- CREATE
- database query
- DROP
- data definition language (DDL)
- dynamic view
- open-source
- operator
- SELECT
- static view
- WHERE