...

Database Managment - MySql

Back to Course

Lesson Description


Lession - #1292 SQL InsertInto


The INSERT INTO Statement in SQL permits you to insert one or more columns into a current(existing>
table, either from another existing table, or by indicating the VALUES you need to insert.

Syntax



INSERT INTO table_name (column1, column2, column3, ...>
VALUES (value1, value2, value3, ...>
; INSERT INTO table_name VALUES (value1, value2, value3, ...>
;


Let's see an example


CREATE TABLE EMPLOYEE (
  empId INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  dept TEXT NOT NULL
>
; -- insert INSERT INTO EMPLOYEE VALUES (0001, 'Clark', 'Sales'>
; INSERT INTO EMPLOYEE VALUES (0002, 'Dave', 'Accounting'>
; INSERT INTO EMPLOYEE VALUES (0003, 'Ava', 'Sales'>
; INSERT INTO EMPLOYEE VALUES (0004, 'Abhay', 'Marketing'>
; INSERT INTO EMPLOYEE(empId,name,dept>
VALUES (0005, 'ziya', 'Sales'>
; -- fetch SELECT * FROM EMPLOYEE order By name ;

Output


Try it here
The MYSQL DATE_FORMAT(>
work arranges a date as determined.
MYSQL vs MariaDB MariaDB has 12 new storage engines that you won’t find in MySQL.It has fewer options for storage compared to MariaDB.
MySQL Stored Procedure. A strategy (frequently called a put away system>
is an assortment of pre-aggregated SQL proclamations put away inside the data set.