Section 2 Flashcards
A database model is a conceptual framework for database systems, with three parts:
-Data structures that prescribe how data is organized
-Operations that manipulate data structures
-Rules that govern valid data
What is a Tuple
It is an ordered collection of elements enclosed in parentheses Ex: (a,b,c) and (c,b,a) are different, since tuples are ordered.
A table
Has a name, a fixed tuple of columns, and a varying set of rows
A column
Has a name and a data type
A row
Is an unnamed tuple of values. Each corresponds to a column and belongs to the column’s data type
A data type
Is a named set of values, from which column values are drawn
Join
Combines two tables by comparing related columns
Union
Selects all rows of two tables
Aggregate
Computes functions over multiple table rows, such as sum and count
Business rules
Are based on business policy and specific to a particular database
SQL
Is the standard language for relational databases, and is commonly supported in non-relational databases
Type: Literals
Definition: ?
Examples: ?
Description: Explicit values that are string, numeric, or binary. Strings must be surrounded by single quotes or double quotes.
Binary values are represented with x ‘0’ where 0 is any hex value.
Ex: ‘String’, “String”, 123, x’0fa2’
Type: Keywords
Description:?
Ex:?
Description: Words with special meaning.
Ex: SELECT, WHERE, FROM
Type: Identifiers
Description: ?
Ex: ?
Description: Objects from the database like tables, columns, etc.
Ex: City, Name, Population
The SQL language is divided into five sublanguages
-Data definition language(DDL)
-Data Query Language(DQL)
-Data Manipulation Language(DML)
-Data control Language(DCL)
-Data Transaction Language(DTL)
Data Definition Language
Defines the structure of the data