Translate

Friday 17 September 2021

MySQL query to get column names in telugu 09

https://youtu.be/gsTHB8JhDXM 

---------------------------------------------
DROP TABLE <tablename>;

--
The SQL INSERT INTO Statement
The INSERT INTO statement is used to insert new records in a table.

INSERT INTO Syntax
It is possible to write the INSERT INTO statement in two ways.

The first way specifies both the column names and the values to be inserted:

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

+---------+-------------+------+-----+---------+-------+
| Field   | Type        | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| fid     | int(11)     | YES  |     | NULL    |       |
| fname   | varchar(10) | YES  |     | NULL    |       |
| fmobile | int(12)     | YES  |     | NULL    |       |
| floc    | varchar(20) | YES  |     | NULL    |       |
| fma     | char(1)     | YES  |     | NULL    |       |
+---------+-------------+------+-----+---------+-------+
insert into faculty (fname,fid,fmobile,fma,floc) values ('venkat1',5,9059868766,'y','hyd');
insert into faculty (fname,fid,fma,floc) values ('venkat1',5,'y','hyd');
-------------------------------
If you are adding values for all the columns of the table, you do not need to specify the column 
names in the SQL query. However, make sure the order of the values is in the same order as
 the columns in the table. The INSERT INTO syntax would be as follows:

INSERT INTO table_name
VALUES (value1, value2, value3, ...);
insert into faculty values(33,'ramesh',59868766,"munipeda",'y');

INSERT INTO table_name(column_name) VALUES (data);

INSERT INTO table_name 
            (column_name, column_name) 
VALUES      (value, value), 
            (value, value), 
            (value, value);

---------------
CREATE TABLE people
  (
    first_name VARCHAR(20),
    last_name VARCHAR(20),
    age INT
  );
INSERT INTO people(first_name, last_name, age)
VALUES ('Tina', 'Belcher', 13);
INSERT INTO people(age, last_name, first_name)
VALUES (42, 'Belcher', 'Bob');
INSERT INTO people(first_name, last_name, age)
VALUES('Linda', 'Belcher', 45)
  ,('Phillip', 'Frond', 38)
  ,('Calvin', 'Fischoeder', 70);
DROP TABLE people;

SELECT * FROM people;

show tables;

No comments:

Post a Comment

Note: only a member of this blog may post a comment.