sql / beginner
Snippet
Defining Date Columns using the DATE Data Type
The DATE data type is used in table definitions to store calendar date values containing a year, month, and day without any time component.
snippet.sql
sql
1
2
3
4
CREATE TABLE employees (employee_id INT,hire_date DATE);
Breakdown
1
CREATE TABLE employees (
Begins the creation of a new table named employees.
2
employee_id INT,
Defines an integer column to hold unique employee identification numbers.
3
hire_date DATE
Defines a date column to store year, month, and day without time information.
4
);
Closes the table definition block.