DATABASE - FINALS Flashcards
(179 cards)
allows you to create database and table structures, perform basic data management chores (add, delete and modify) and perform complex queries designed to transform raw data into useful information.
Database Language
must perform such basic functions with minimal user effort, and its command structure and syntax must be easy to learn.
Database Language
must be portable; that is, it must conform to some basic standard, so a person does not have to relearn the basics when moving from one RDBMS to another.
Structured Query Language
SQL Major Components:
- Data Definition Language (DDL)
- Data Manipulation Language (DML)
- Transaction Control Language(TCL)
- Data Control Language(DCL
SQL includes commands to create database objects such as tables, indexes, and views, as well as commands to define access rights to those database objects.
Data Definition Language (DDL)
SQL includes commands to insert, update, delete and retrieve data within the database tables.
Data Manipulation Language (DML)
DML commands in SQL are executed within the context of a transaction, which is logical unit of work composed of one or more SQL statements, as defined by business rules.
Transaction Control Language (TCL)
SQL provides commands to control the processing of these statements an indivisible unit of work.
Transaction Control Language (TCL)
commands are used to control access to data objects, such as giving a one user permission to only view the certain table, and giving another use permission to change the data in the given table.
Data Control Language (DCL)
it groups the data from the SELECT table(s) and produces a single summary row for each group.
Group by Clause
is used to combine records from two or more tables in a database.
SQL Joins
based on a common field between them other keywords are combined with the SELECT statement, these keywords are:
INNER JOIN
OUTER JOIN
- Left Join
- Right Join
- Full Join
Inner Join keyword
EQUIJOIN
return rows when there is atleast one match in both tables
Inner Join or Equijoin
is an extension of Inner Join. but it does not require each record in the two joined tables to have a matching record.
Outer Join
the joined table retains each record - even if no other matching record exists.
Outer Join
Outer joins subdivide further into:
- left outer joins
- right outer joins
- full outer joins
returns all rows from the left table, even if there are no matches in the right table
Left Join
returns all the rows from the right table, even if there are no matches in the left table
Right Join
both tables are secondary(or optional), such that if rows are being matched in table A and table B, then all rows from table A are displayed even if there is no matching row in table B, and vice versa
Outer Join
returns all possible combinations of rows from the two tables
Cross Join
SELECT statement embedded within another SELECT statement
Subqueries
the results of this inner SELECT statement (or subselect) are used in the outer statement to help determine the contents of the final result.
Subqueries
Types of Subqueries
- Scalar Subquery
- Row Subquery
- Table Subquery