Explore relational data offerings in Azure Flashcards
Normalization
Normalization is a term used by database professionals for a schema design process that minimizes data duplication and enforces data integrity.
Rules of Normalization
- Separate each entity into its own table.
- Separate each discrete attribute into its own column.
- Uniquely identify each entity instance (row) using a primary key.
- Use foreign key columns to link related entities.
Structured Query Language (SQL)
SQL stands for Structured Query Language and is used to communicate with a relational database. It’s the standard language for relational database management systems. SQL statements are used to perform tasks such as updating data in a database or retrieving data from a database. Some common relational database management systems that use SQL include Microsoft SQL Server, MySQL, PostgreSQL, MariaDB, and Oracle.
SQL statement types
SQL statements are grouped into three main logical groups:
- Data Definition Language (DDL)
- Data Control Language (DCL)
- Data Manipulation Language (DML)
DDL
You use DDL statements to create, modify, and remove tables and other objects in a database (table, stored procedures, views, and so on).
CREATE
Create a new object in the database, such as a table or a view.
ALTER
Modify the structure of an object. For instance, altering a table to add a new column.
DROP
Remove an object from the database.
RENAME
Rename an existing object.
DCL
Database administrators generally use DCL statements to manage access to objects in a database by granting, denying, or revoking permissions to specific users or groups.
GRANT
Grant permission to perform specific actions
DENY
Deny permission to perform specific actions
REVOKE
Remove a previously granted permission
DML
You use DML statements to manipulate the rows in tables. These statements enable you to retrieve (query) data, insert new rows, or modify existing rows. You can also delete rows if you don’t need them anymore.
The four main DML statements are:
SELECT
Read rows from a table
INSERT
Insert new rows into a table
UPDATE
Modify data in existing rows
DELETE
Delete existing rows
What is a view?
A view is a virtual table based on the results of a SELECT query. You can think of a view as a window on specified rows in one or more underlying tables.
What is a stored procedure?
A stored procedure defines SQL statements that can be run on command. Stored procedures are used to encapsulate programmatic logic in a database for actions that applications need to perform when working with data.
What is an index?
An index helps you search for data in a table. Think of an index over a table like an index at the back of a book. A book index contains a sorted set of references, with the pages on which each reference occurs. When you want to find a reference to an item in the book, you look it up through the index. You can use the page numbers in the index to go directly to the correct pages in the book. Without an index, you might have to read through the entire book to find the references you’re looking for.