Section 1 Flashcards
(36 cards)
What are the 3 parts of a database model?
- Data structures that prescribe how data is organized.
- Operations that manipulate data structures.
- Rules that govern valid data.
What data base model is used in SQL?
Relational Model: A model based on tabular data structure.
Set
An unordered collection of elements enclosed in braces.
Tuple
An ORDERED collection of elements enclosed in parentheses.
What does a table consist of?
A name, a fixed tuple of columns, and a varying set of rows.
A column has what?
A name and a data type.
Row
is an unnamed tuple of values. Each value corresponds to a column and belongs to the column’s data type.
Data type
is a named set of values from which column values are drawn
What is another name for Table in mathematics and Files?
Relation and File
What is another name for column?
Attribute and Field
What is anothr name for row?
Tuple and Record
What is another name for Data Type?
Domain and Data Type (Files)
What are the relational rules?
-Unique primary key
-Unique column names
- No duplicate rows
DDL (Data Definition Language
CREATES, ALTERS, and DROPS tables
DQL (Data Query Language)
SELECTS data from table
(DML) Data Manipulation Language
INSERTS, UPDATES, and DELETES data in a table.
DCL (Data Control Language)
grants and revokes permissions to and from users.
DTL (manages database transactions)
commits data to a database, ROLLS BACK from a database, and creates savepoints.
Row
unnamed sequence of values
Cell
a single column of a single row.
Tables must follow these relational rules:
- Exactly one value per cell.
- No duplicate column names.
- No duplicate rows
- No row order.
TINYINT
-1 byte
- Signed range: -128 to 127
- Unsigned range: 0 to 255
SMALLINT
- 2 bytes
-Signed range: -32768 to 32767
-Unsigned range: 0 to 65535
MEDIUMINT
3 bytes