Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL Creating a Table to Store Date and Time

-- creating a table with different date fields
CREATE TABLE Users (
  id INT,
  username VARCHAR(50),
  full_name VARCHAR(50),
  date_of_birth DATE,
  last_login DATETIME,
  registered_at TIMESTAMP
);

-- inserting values into the Users table.
INSERT INTO Users
VALUES
(1, 'harry', 'Harry Potter', '1999-04-14', '2022-04-22 10:34:53.44', '2020-03-15 07:31:42.23');
 
PREVIOUS NEXT
Tagged: #SQL #Creating #Table #Store #Date #Time
ADD COMMENT
Topic
Name
1+6 =