lOMoAR cPSD| 62301842
WGU D427 STUDY NOTE: DATABASE MODELS, SQL COMMANDS, AND
RELATIONAL CONCEPTS | VERIFIED STUDY SET | 2026 STUDY UPDATES |
GUARANTEED PASS
D427 Study Notes for Exam Table 1.1.1: Example database models
Helpful Links : list of SQL commands and links to help understand them. Primary data Initial product Example
structure releases database system Strengths
Zybooks Lessons
1.1 Relational Model Fast queries
Hierarchical Tree 1960s IMS
Efficient storage
Relational databases were initially designed for transactional data, such as bank transactions and
airline reservations.
Q: What was the initial impediment to commercial adoption of relational databases in the early 1980s? Fast queries
Network Linked list 1970s IDMS
A: Processing Speed (Early relational products were not as fast as more established Efficient storage
nonrelational products. However, as relational databases matured, processing speed rapidly caught up
with non-relational databases.)
Oracle Productivity and simplicity
Relational Table 1980s
The relational data structure is based on set theory. A set is an unordered collection of elements Database Transactional applications
enclosed in braces. Ex: {a, b, c} and {c, b, a} are the same, since sets are not ordered. A tuple is an
ordered collection of elements enclosed in parentheses. Ex: (a, b, c) and (c, b, a) are different, since
tuples are ordered.
Object Class 1990s ObjectStore Integration with object-oriented programming languages
The data structure organizes data in tables:
• A table has a name, a fixed tuple of columns, and a varying set of rows. Graph
Vertex and
2000s Neo4j
Flexible schema Evolving
edge business requirements
• A column has a name and a
data type. Table 1.1.2: Databases (db Mathematics File systems
processing) (academic literature) (file processing)
Similar data structure terms
XML Flexible schema
Document 2010s MongoDB
• A row is an unnamed tuple of JSON Unstructured and semi-structured data
values. Each value corresponds Table Relation File
to a column and belongs to the column's data type. Since a table is a set of rows, the rows have no inherent order
Column Attribute Field
• A data type is a named set of values, from which column values are drawn.
Relational operations Inter sect
Relational operations are based on set theory. Diffe Record Each operation generates a result table from one or two input tables. These operations are collectively called relational algebra and
are the theoretical foundation of the SQL Row Tuple rence language. Since the result of relational operations is always a table, the result of an SQL query is also a table.
• Select selects a subset of rows of a Ren ame changes a table table. selects rows com
Data type Aggr n egateData type
• Project eliminates one or more Domain columns of a table. selects rows th
columns.
• Union selects all rows of two tables.
Relational rules
Rules are logical constraints that ensure data is valid. Relational rules are part of the relational model and govern data in every relational
database. Ex:
Business rules are based on business policy and specific to a particular database.
• Unique primary key. All tables have a PK column, or group of columns, where values may not repeat.
Ex: All rows of the Employee table must have a valid entry in the DepartCode
column. Ex: PassportNumber values may not repeat in different Employee rows.
• Unique column names. Different columns of the same table have different names. Relational rules are implemented as SQL constraints and enforced by the database
system. Business rules are discovered during database design and, like relational
• No duplicate rows. No two rows of the same table have identical values in all columns.
rules, often implemented as SQL constraints. However, some complex business
Questions rules must be enforced by applications running on the database.
• Product lists all combinations of rows of two tables.
• Join combines two tables by comparing related computes func
• Delete cascade is an example of a relational rule. o False (Delete cascade is a business rule. The delete cascade rule requires that, when a row of a particular table is deleted, all related rows are also deleted. Deleting related rows
depends on business policy and may apply to some tables but not others.) Data in a relational database can violate relational rules. o True (Depending on how tables are specified, some relational rules can be violated. Ex: A
table with no primary key can be created. However, rule
violations often create business problems and should normally be avoided or automatically prevented.) Table 1.2.1: Summary of SQL syntax features
Type Description Examples
1
, lOMoAR cPSD| 62301842
1.2 Structured Query Language 'String'
Explicit values that are string, numeric, or binary. "String"
Structured Query Language
Strings must be surrounded by single quotes or 123
Relational databases generally support most important elements of the SQL standard. However, most relational databases do not support Literals double quotes.
the entire standard and many support custom extensions. x'0fa2'
Binary values are represented with x'0' where the
Question: All database systems use identical SQL statements. 0 is any hex value.
Answer: False. (The SQL language has been standardized, but SQL implementations can vary between database systems in small ways.)
SQL Syntax
An SQL statement may be written on a single line, but good practice is to write each clause on a separate line. In MySQL, all SQL SELECT, FROM,
Keywords Words with special meaning.
statements end with a semicolon. SQL keywords like SELECT, FROM, WHERE, etc. are not case sensitive. Ex: SELECT and select are WHERE
equivalent. However, identifiers like column names and table names are case sensitive in many database systems. All database systems
recognize single quotes for string literals, but some also recognize double quotes.
Objects from the database like tables, columns, City, Name,
SQL Sublanguages Identifiers
etc. Population
The SQL language is divided into five sublanguages:
1. Data Definition Language (DDL) defines the structure of the database. It 3.Data Manipulation Language (DML) -- single line comment
manipulates creates, alters, and drops tables w/ the keywords CREATE, ALTER, DROP. data stored in a database. It /* multi-line
inserts, updates, and Statement intended only for humans and ignored Comment */
Comments
deletes data in a table w/ keywords INSERT INTO, 2.Data Query Language (DQL) retrieves data from the by the database when parsing an SQL statement.
UPDATE, DELETE.database. It selects data from a table w/ keyword SELECT.
5.Data Control Language (DCL) controls database 4.Data Transaction Language (DTL)
database transactions. It commits data to a db, rolls
user access. It grants and revokes permissions to and manages
back data from a db, and creates savepoints w/
from users w/ keywords GRANT and REVOKE.
1.3 Managing Databases keywords COMMIT, ROLLBACK, SAVEPOINT.
SHOW statement
The SHOW statement provides database users and administrators with information about databases, the database contents (tables, columns, etc.),
and server status information. Commonly used SHOW statements include: The USE statement selects a database and is required to show
• SHOW DATABASES lists databases available in the database system. information about tables within a specific database. Ex: USE World; SHOW Tables; SHOW COLUMNS FROM
• SHOW TABLES lists tables available in the currently selected database.
CountryLanguage; (the USE statements uses the db named World,
• SHOW COLUMNS lists columns available in a specific table named by a FROM clause. the SHOW Tables statements shows the tables within World, the
• SHOW CREATE TABLE shows the CREATE TABLE statement for a given table. SHOW COLUMNS FROM CountryLanguage statement shows thecolumns in the CountryLanguage table within the World db).
1.4 Tables
Rules Governing Tables
Tables must obey relational rules, including:
1. Exactly one value per cell. A cell may not contain multiple values. Unknown data is represented with a special NULL
value.
2. No duplicate column names. Duplicate column names are allowed in different tables, but not in the same table.
3. No duplicate rows. No two rows may have identical values in all columns.
4. No row order. Rows are not ordered. The organization of rows on a storage device, such as a disk drive, never affects query
results.
CREATE TABLE and DROP TABLE statements
Rules 3 and 4 follow directly from the definition of a table. A table is a set of rows. Since a set's elements may not repeat and are not
ordered, the same is true of a table's rows. Rule 4 is called data independence. Data independence allows database administrators to
improve query performance by changing the organization of data on storage devices, without affecting query results.
The CREATE TABLE statement creates a new table by specifying the table name, column names, and column data types. Example data types are:
• INT or INTEGER — integer values DATE — date values
• VARCHAR(N) — values with 0 to N characters DECIMAL(M, D) — numeric values with M digits,
of which D digits follow the decimal point The DROP TABLE statement deletes a table, along with all the table's rows, from a database.
ALTER Table 1.4.1: ALTER TABLE
ALTER TABLE statement TABLE statement
Description Example
The ALTER TABLE statement adds, deletes, or modifies columns on an existing table. The ALTER TABLE statement clause
Syntax
specifies the table name followed by a clause that indicates what should be altered. The table below summarizes the three
ALTER TABLE clauses. ALTER TABLE TableName
Adds a ADD ColumnName DataType; ALTER TABLE Employee
ADD
1.5 Data Types column ADD Salary DECIMAL (7,2);
Data Type Categories ALTER TABLE TableName
A data type is a named set of values from which column values are drawn. In relational databases, most data types fall into one CHANGE CurrentColumnName ALTER TABLE Employee
of the following categories: Modifies NewColumnName NewDataType;
CHANGE CHANGE Salary AnnualSalary
a column
INT;
• Integer data types represent positive and negative integers. Several integer data types exist, varying by the number
of bytes allocated for each value. Common integer data types include INT, implemented as 4 bytes of storage, and
SMALLINT, implemented as 2 bytes.
ALTER TABLE TableName
• Decimal data types represent numbers with fractional values. Decimal data types vary by number of digits after the DROP Deletes a DROP ColumnName;Value ALTER TABLE Employee
Category c olumnData Table 1.5.1: Example data
decimal point and maximum size. Common decimal data types include FLOAT and DECIMAL.
type typesDROP AnnualSalary;
• Character data types represent textual characters. Common character data types include CHAR, a fixed string of
Integer INT -9281344
characters, and VARCHAR, a string of variable length up to a specified maximum size.
• Date and time data types represent date, time, or both. Some date and time data types include a time zone or Decimal FLOAT 3.1415
specify a time interval. Some date and time data types represent an interval rather than a point in time. Common
date and time data types include DATE, TIME, DATETIME, and TIMESTAMP.
Character VARCHAR Chicago
2
, lOMoAR cPSD| 62301842
• Binary data types store data exactly as the data appears in memory or computer files, bit for bit. The database Date and
manages binary data as a series of zeros and ones. Common binary data types include BLOB, BINARY, DATETIME 12/25/2020 10:35:00
time
VARBINARY, and IMAGE.
• Spatial data types store geometric information, such as lines, polygons, and map coordinates. Examples include Binary BLOB 1001011101 . . .
POLYGON, POINT, and GEOMETRY. Spatial data types are relatively new and consequently vary greatly across
database systems.
Spatial POINT (2.5, 33.44)
• Document data types contain textual data in a structured format such as XML or JSON.
<menu>
Databases support additional data types for specialized uses. Ex: MONEY for currency values, BOOLEAN for true-false
<selection>
values, BIT for zeros and ones, and ENUM for a small, fixed set of alternative values. Data types vary in storage requirements. <name>Greek salad</name>
<price>$13.90</price>
Ex:
<text>Cucumbers, tomatoes, onions, and feta cheese</text>
</selection>
<selection>
• Character data types use one or two bytes per character. <name>Turkey sandwich</name>
<price>$9.00</price>
• Integer data types use a fixed number of bytes per number. <text>Turkey, lettuce, tomato on choice of bread</text>
Document XML
• Unsigned data types can store larger numbers than the signed version of the same data type. </selection>
</menu>
To minimize table size, the data type with the smallest storage requirements should be used. Ex: Any integer data type can store
integers that range from -100 to 100. However, TINYINT requires only one byte per number and is the best choice for this range.
Table 1.5.2: Common MySQL data types.
Category Example Data type Storage Notes
TINYINT 1 byte Signed range: -128 to 127 Unsigned range: 0 to 255
SMALLINT 2 bytes Signed range: -32,768 to 32,767 Unsigned range: 0 to 65,535
MEDIUMINT 3 bytes Signed range: -8,388,608 to 8,388,607 Unsigned range: 0 to 16,777,215
Integer 34 & -739448
INTEGER or
4 bytes Signed range: -2,147,483,648 to 2,147,483,647 Unsigned range: 0 to 4,294,967,295
INT
BIGINT 8 bytes Signed range: -263 to 263 -1 Unsigned range: 0 to 264 -1
DECIMAL(M,D) Varies depending on M and D Exact decimal number where M = number of significant digits, D = number of digits after decimal point
Decimal 123.4 & -54.29685 FLOAT 4 bytes Approximate decimal numbers with range: -3.4E+38 to 3.4E+38
DOUBLE 8 bytes Approximate decimal numbers with range: -1.8E+308 to 1.8E+308
DATE 3 bytes Format: YYYY-MM-DD. Range: '1000-01-01' to '9999-12-31'
Date and '1776-07-04
TIME 3 bytes Format: hh:mm:ss
time 13:45:22'
DATETIME 5 bytes Format: YYYY-MM-DD hh:mm:ss. Range: '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.
Category Example Data type Storage Notes
CHAR(N) N bytes Fixed-length string of length N; 0 ≤ N ≤ 255
Character 'string' VARCHAR(N) Length of characters + 1 bytes Variable-length string with maximum N characters; 0 ≤ N ≤ 65,535
TEXT Length of characters + 2 bytes Variable-length string with maximum 65,535 characters
Table 1.6.1: Common operators.
1.6 Selecting Rows
Operators
Precedence Operators
1 - (unary)
3
WGU D427 STUDY NOTE: DATABASE MODELS, SQL COMMANDS, AND
RELATIONAL CONCEPTS | VERIFIED STUDY SET | 2026 STUDY UPDATES |
GUARANTEED PASS
D427 Study Notes for Exam Table 1.1.1: Example database models
Helpful Links : list of SQL commands and links to help understand them. Primary data Initial product Example
structure releases database system Strengths
Zybooks Lessons
1.1 Relational Model Fast queries
Hierarchical Tree 1960s IMS
Efficient storage
Relational databases were initially designed for transactional data, such as bank transactions and
airline reservations.
Q: What was the initial impediment to commercial adoption of relational databases in the early 1980s? Fast queries
Network Linked list 1970s IDMS
A: Processing Speed (Early relational products were not as fast as more established Efficient storage
nonrelational products. However, as relational databases matured, processing speed rapidly caught up
with non-relational databases.)
Oracle Productivity and simplicity
Relational Table 1980s
The relational data structure is based on set theory. A set is an unordered collection of elements Database Transactional applications
enclosed in braces. Ex: {a, b, c} and {c, b, a} are the same, since sets are not ordered. A tuple is an
ordered collection of elements enclosed in parentheses. Ex: (a, b, c) and (c, b, a) are different, since
tuples are ordered.
Object Class 1990s ObjectStore Integration with object-oriented programming languages
The data structure organizes data in tables:
• A table has a name, a fixed tuple of columns, and a varying set of rows. Graph
Vertex and
2000s Neo4j
Flexible schema Evolving
edge business requirements
• A column has a name and a
data type. Table 1.1.2: Databases (db Mathematics File systems
processing) (academic literature) (file processing)
Similar data structure terms
XML Flexible schema
Document 2010s MongoDB
• A row is an unnamed tuple of JSON Unstructured and semi-structured data
values. Each value corresponds Table Relation File
to a column and belongs to the column's data type. Since a table is a set of rows, the rows have no inherent order
Column Attribute Field
• A data type is a named set of values, from which column values are drawn.
Relational operations Inter sect
Relational operations are based on set theory. Diffe Record Each operation generates a result table from one or two input tables. These operations are collectively called relational algebra and
are the theoretical foundation of the SQL Row Tuple rence language. Since the result of relational operations is always a table, the result of an SQL query is also a table.
• Select selects a subset of rows of a Ren ame changes a table table. selects rows com
Data type Aggr n egateData type
• Project eliminates one or more Domain columns of a table. selects rows th
columns.
• Union selects all rows of two tables.
Relational rules
Rules are logical constraints that ensure data is valid. Relational rules are part of the relational model and govern data in every relational
database. Ex:
Business rules are based on business policy and specific to a particular database.
• Unique primary key. All tables have a PK column, or group of columns, where values may not repeat.
Ex: All rows of the Employee table must have a valid entry in the DepartCode
column. Ex: PassportNumber values may not repeat in different Employee rows.
• Unique column names. Different columns of the same table have different names. Relational rules are implemented as SQL constraints and enforced by the database
system. Business rules are discovered during database design and, like relational
• No duplicate rows. No two rows of the same table have identical values in all columns.
rules, often implemented as SQL constraints. However, some complex business
Questions rules must be enforced by applications running on the database.
• Product lists all combinations of rows of two tables.
• Join combines two tables by comparing related computes func
• Delete cascade is an example of a relational rule. o False (Delete cascade is a business rule. The delete cascade rule requires that, when a row of a particular table is deleted, all related rows are also deleted. Deleting related rows
depends on business policy and may apply to some tables but not others.) Data in a relational database can violate relational rules. o True (Depending on how tables are specified, some relational rules can be violated. Ex: A
table with no primary key can be created. However, rule
violations often create business problems and should normally be avoided or automatically prevented.) Table 1.2.1: Summary of SQL syntax features
Type Description Examples
1
, lOMoAR cPSD| 62301842
1.2 Structured Query Language 'String'
Explicit values that are string, numeric, or binary. "String"
Structured Query Language
Strings must be surrounded by single quotes or 123
Relational databases generally support most important elements of the SQL standard. However, most relational databases do not support Literals double quotes.
the entire standard and many support custom extensions. x'0fa2'
Binary values are represented with x'0' where the
Question: All database systems use identical SQL statements. 0 is any hex value.
Answer: False. (The SQL language has been standardized, but SQL implementations can vary between database systems in small ways.)
SQL Syntax
An SQL statement may be written on a single line, but good practice is to write each clause on a separate line. In MySQL, all SQL SELECT, FROM,
Keywords Words with special meaning.
statements end with a semicolon. SQL keywords like SELECT, FROM, WHERE, etc. are not case sensitive. Ex: SELECT and select are WHERE
equivalent. However, identifiers like column names and table names are case sensitive in many database systems. All database systems
recognize single quotes for string literals, but some also recognize double quotes.
Objects from the database like tables, columns, City, Name,
SQL Sublanguages Identifiers
etc. Population
The SQL language is divided into five sublanguages:
1. Data Definition Language (DDL) defines the structure of the database. It 3.Data Manipulation Language (DML) -- single line comment
manipulates creates, alters, and drops tables w/ the keywords CREATE, ALTER, DROP. data stored in a database. It /* multi-line
inserts, updates, and Statement intended only for humans and ignored Comment */
Comments
deletes data in a table w/ keywords INSERT INTO, 2.Data Query Language (DQL) retrieves data from the by the database when parsing an SQL statement.
UPDATE, DELETE.database. It selects data from a table w/ keyword SELECT.
5.Data Control Language (DCL) controls database 4.Data Transaction Language (DTL)
database transactions. It commits data to a db, rolls
user access. It grants and revokes permissions to and manages
back data from a db, and creates savepoints w/
from users w/ keywords GRANT and REVOKE.
1.3 Managing Databases keywords COMMIT, ROLLBACK, SAVEPOINT.
SHOW statement
The SHOW statement provides database users and administrators with information about databases, the database contents (tables, columns, etc.),
and server status information. Commonly used SHOW statements include: The USE statement selects a database and is required to show
• SHOW DATABASES lists databases available in the database system. information about tables within a specific database. Ex: USE World; SHOW Tables; SHOW COLUMNS FROM
• SHOW TABLES lists tables available in the currently selected database.
CountryLanguage; (the USE statements uses the db named World,
• SHOW COLUMNS lists columns available in a specific table named by a FROM clause. the SHOW Tables statements shows the tables within World, the
• SHOW CREATE TABLE shows the CREATE TABLE statement for a given table. SHOW COLUMNS FROM CountryLanguage statement shows thecolumns in the CountryLanguage table within the World db).
1.4 Tables
Rules Governing Tables
Tables must obey relational rules, including:
1. Exactly one value per cell. A cell may not contain multiple values. Unknown data is represented with a special NULL
value.
2. No duplicate column names. Duplicate column names are allowed in different tables, but not in the same table.
3. No duplicate rows. No two rows may have identical values in all columns.
4. No row order. Rows are not ordered. The organization of rows on a storage device, such as a disk drive, never affects query
results.
CREATE TABLE and DROP TABLE statements
Rules 3 and 4 follow directly from the definition of a table. A table is a set of rows. Since a set's elements may not repeat and are not
ordered, the same is true of a table's rows. Rule 4 is called data independence. Data independence allows database administrators to
improve query performance by changing the organization of data on storage devices, without affecting query results.
The CREATE TABLE statement creates a new table by specifying the table name, column names, and column data types. Example data types are:
• INT or INTEGER — integer values DATE — date values
• VARCHAR(N) — values with 0 to N characters DECIMAL(M, D) — numeric values with M digits,
of which D digits follow the decimal point The DROP TABLE statement deletes a table, along with all the table's rows, from a database.
ALTER Table 1.4.1: ALTER TABLE
ALTER TABLE statement TABLE statement
Description Example
The ALTER TABLE statement adds, deletes, or modifies columns on an existing table. The ALTER TABLE statement clause
Syntax
specifies the table name followed by a clause that indicates what should be altered. The table below summarizes the three
ALTER TABLE clauses. ALTER TABLE TableName
Adds a ADD ColumnName DataType; ALTER TABLE Employee
ADD
1.5 Data Types column ADD Salary DECIMAL (7,2);
Data Type Categories ALTER TABLE TableName
A data type is a named set of values from which column values are drawn. In relational databases, most data types fall into one CHANGE CurrentColumnName ALTER TABLE Employee
of the following categories: Modifies NewColumnName NewDataType;
CHANGE CHANGE Salary AnnualSalary
a column
INT;
• Integer data types represent positive and negative integers. Several integer data types exist, varying by the number
of bytes allocated for each value. Common integer data types include INT, implemented as 4 bytes of storage, and
SMALLINT, implemented as 2 bytes.
ALTER TABLE TableName
• Decimal data types represent numbers with fractional values. Decimal data types vary by number of digits after the DROP Deletes a DROP ColumnName;Value ALTER TABLE Employee
Category c olumnData Table 1.5.1: Example data
decimal point and maximum size. Common decimal data types include FLOAT and DECIMAL.
type typesDROP AnnualSalary;
• Character data types represent textual characters. Common character data types include CHAR, a fixed string of
Integer INT -9281344
characters, and VARCHAR, a string of variable length up to a specified maximum size.
• Date and time data types represent date, time, or both. Some date and time data types include a time zone or Decimal FLOAT 3.1415
specify a time interval. Some date and time data types represent an interval rather than a point in time. Common
date and time data types include DATE, TIME, DATETIME, and TIMESTAMP.
Character VARCHAR Chicago
2
, lOMoAR cPSD| 62301842
• Binary data types store data exactly as the data appears in memory or computer files, bit for bit. The database Date and
manages binary data as a series of zeros and ones. Common binary data types include BLOB, BINARY, DATETIME 12/25/2020 10:35:00
time
VARBINARY, and IMAGE.
• Spatial data types store geometric information, such as lines, polygons, and map coordinates. Examples include Binary BLOB 1001011101 . . .
POLYGON, POINT, and GEOMETRY. Spatial data types are relatively new and consequently vary greatly across
database systems.
Spatial POINT (2.5, 33.44)
• Document data types contain textual data in a structured format such as XML or JSON.
<menu>
Databases support additional data types for specialized uses. Ex: MONEY for currency values, BOOLEAN for true-false
<selection>
values, BIT for zeros and ones, and ENUM for a small, fixed set of alternative values. Data types vary in storage requirements. <name>Greek salad</name>
<price>$13.90</price>
Ex:
<text>Cucumbers, tomatoes, onions, and feta cheese</text>
</selection>
<selection>
• Character data types use one or two bytes per character. <name>Turkey sandwich</name>
<price>$9.00</price>
• Integer data types use a fixed number of bytes per number. <text>Turkey, lettuce, tomato on choice of bread</text>
Document XML
• Unsigned data types can store larger numbers than the signed version of the same data type. </selection>
</menu>
To minimize table size, the data type with the smallest storage requirements should be used. Ex: Any integer data type can store
integers that range from -100 to 100. However, TINYINT requires only one byte per number and is the best choice for this range.
Table 1.5.2: Common MySQL data types.
Category Example Data type Storage Notes
TINYINT 1 byte Signed range: -128 to 127 Unsigned range: 0 to 255
SMALLINT 2 bytes Signed range: -32,768 to 32,767 Unsigned range: 0 to 65,535
MEDIUMINT 3 bytes Signed range: -8,388,608 to 8,388,607 Unsigned range: 0 to 16,777,215
Integer 34 & -739448
INTEGER or
4 bytes Signed range: -2,147,483,648 to 2,147,483,647 Unsigned range: 0 to 4,294,967,295
INT
BIGINT 8 bytes Signed range: -263 to 263 -1 Unsigned range: 0 to 264 -1
DECIMAL(M,D) Varies depending on M and D Exact decimal number where M = number of significant digits, D = number of digits after decimal point
Decimal 123.4 & -54.29685 FLOAT 4 bytes Approximate decimal numbers with range: -3.4E+38 to 3.4E+38
DOUBLE 8 bytes Approximate decimal numbers with range: -1.8E+308 to 1.8E+308
DATE 3 bytes Format: YYYY-MM-DD. Range: '1000-01-01' to '9999-12-31'
Date and '1776-07-04
TIME 3 bytes Format: hh:mm:ss
time 13:45:22'
DATETIME 5 bytes Format: YYYY-MM-DD hh:mm:ss. Range: '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.
Category Example Data type Storage Notes
CHAR(N) N bytes Fixed-length string of length N; 0 ≤ N ≤ 255
Character 'string' VARCHAR(N) Length of characters + 1 bytes Variable-length string with maximum N characters; 0 ≤ N ≤ 65,535
TEXT Length of characters + 2 bytes Variable-length string with maximum 65,535 characters
Table 1.6.1: Common operators.
1.6 Selecting Rows
Operators
Precedence Operators
1 - (unary)
3