INSERT UPDATE, DELETE & ALTER Table in SQL With Example | SQL Tutorial in Hindi 4

preview_player
Показать описание
SQL Full Course Playlist 👇

Timestamps:
00:00 Topics
00:04 Insert Into Concept
00:28 Insert Into Example
01:38 Update Table Concept
02:12 Update Table Example
02:55 Delete Values Concept
03:11 Delete Values Example
03:41 Alter Table Concept
04:37 Drop & Truncate Table Concept
05:01 Drop & Truncate Table Example

Like, Share, Subscribe :)

➖➖➖➖➖➖➖➖➖➖➖➖➖
Queries used:

👉 Customer Table
🔖 Create table

CREATE TABLE customer
(
CustID int PRIMARY KEY,
CustName varchar(50) NOT NULL,
Age int NOT NULL,
City char(50),
Salary numeric );

🔖 Insert values in table

INSERT INTO customer (CustID, CustName, Age, City, Salary)
VALUES
(1, 'sam', 26, 'Delhi', 9008),
(2, 'Ram', 19, 'Bangalore', 11000),
(3, 'Pam', 31, 'Mumbai', 6060),
(4, 'Sam', 42, 'Pune', 10000);

🔖 Update values in table

UPDATE customer
SET CustName = 'Xam' , Age = 32
WHERE CustID = 4

👉 Classroom Table

CREATE TABLE classroom (
rollno int8 PRIMARY KEY,
name varchar(50) NOT NULL,
house char(12) NOT NULL,
grade char(1) );

INSERT INTO classroom (rollno, name, house, grade)
VALUES
(1, 'Sam', 'Akash', 'B'),
(2, 'Ram', 'Agni', 'A'),
(3, 'Shyam', 'Jal', 'B'),
(4, 'Sundar', 'Agni', 'A'),
(5, 'Ram', 'Yayu', 'B');
➖➖➖➖➖➖➖➖➖➖➖➖➖

Related Videos
Introduction to SQL - What Is SQL + Database | SQL Tutorial In Hindi - 1

Data Types, Primary-Foreign Keys & Constraints in SQL | SQL Tutorial In Hindi - 2

Create Table In SQL & Create Database | SQL Tutorial In Hindi - 3

➖➖➖➖➖➖➖➖➖➖➖➖➖
Connect on other Social Media handles:

➖➖➖➖➖➖➖➖➖➖➖➖➖

If this is the first ever video you're watching allow me to introduce myself, Hey I'm Rishabh Mishra and currently working as Senior Data Analyst at Bangalore. On this channel I like to guide and help my juniors and data science aspirants regarding Data Science jobs and useful tips for college students.
Have a great day buddy!
Рекомендации по теме
Комментарии
Автор

Anyone facing issue in INSERT value query, below is updated query:

👉Customer Table
🔖Create table

CREATE TABLE customer
(
CustID int PRIMARY KEY,
CustName varchar(50) NOT NULL,
Age int NOT NULL,
City char(50),
Salary numeric );

🔖Insert values in table

INSERT INTO customer (CustID, CustName, Age, City, Salary)
VALUES
(1, 'sam', 26, 'Delhi', 9008),
(2, 'Ram', 19, 'Bangalore', 11000),
(3, 'Pam', 31, 'Mumbai', 6060),
(4, 'Sam', 42, 'Pune', 10000);

🔖Update values in table

UPDATE customer
SET CustName = 'Xam', Age = 32
WHERE CustID = 4

RishabhMishraOfficial
Автор

For alter method i noticed some changes may be due to new version .
1. for creating new column :- ALTER TABLE customer ADD COLUMN "NewColumn" char;
2.for changing data type:- -- ALTER TABLE customer ALTER COLUMN "NewColumn" TYPE numeric USING "NewColumn"::numeric;

Please check it Rishabh.

akshaymuktiramrodge
Автор

The way you replied to 95% of all comments is really appreciable..❤️❤️.

hemantkodiya
Автор

Sir try kro thoda or Details mai Btao kuch steps aap Explain hi nai Krte, please

gouravgourav
Автор

Amazing I am easily understand INSERT UPDATE, DELETE & ALTER Table in SQL

koioxkb
Автор

Good Evening bhai..
INSERT INTO me
ERROR: column "name" of relation "customer" does not exist
LINE 2: (id, Name, Age, City, Income)
^

SQL state: 42703
Character: 27
ye sb show ho raha ha but already exist ha ye sb column.
It will really🙏🙏 helpful if you can clear the doubts.

anilnegi
Автор

create table bond
(
"id" int8 primary key,
"name" varchar (50) not null,
"age" int not null,
"city" char(50),
"salary" numeric
);

select * from bond
limit 4

insert into bond
("id", "name", age, city, salary)
values
(1, 'sam', 26, 'delhi', 9000),
(2, 'ram', 19, 'bangalore', 12000),
(3, 'pam', 31, 'mumbai', 8500),
(4, 'jam', 42, 'pune', 10500);



update bond
set "name" = 'bomb', age = 25
where "id" = 4;

delete from bond
where "id" = 3;

alter table bond
add column navin integer;

alter table bond
alter column salary set data type integer;

alter table bond
drop column navin;

Footballmoment
Автор

In short time you covered many topics❤❤❤

sawaimalhi
Автор

Thanks Sir.
while trying to insert values, I was getting syntax error.
So i had to add double quetes and modfy the codes as shown below.
INSERT INTO customer1
("Custid", "Name", "Age", "City", "Salary")
VALUES
(1, 'Sam', 26, 'Delhi', 9000),
(2, 'Vim', 46, 'keral', 12000),
(3, 'Dam', 21, 'banglor', 8000),
(4, 'Fam', 24, 'katak', 70004);

nidhinnidhin
Автор

Great sir and teach easily i watch your all vedios and learning mush more from You ..God bless u

Sbk_Tech
Автор

bohot achhe tadhike ke samjh gaya. Thank You Bhaiya!

soumyajeetmitra
Автор

very nice teaching sir, and very helpful information in easy language .thank you so much😊

chavansarala
Автор

Nice Rishav such a good technic, everybody should be follow this

bsgbghf
Автор

Very Nice sir I have all the questions solved 😊😊

Thank you so much ❤️🥰

iisqkid
Автор

So Great full for this free course seriously am learning, happy.

icyyy
Автор

hi bro the way ur really very nice and ur patience really appreciating ur dedication. bro which ur main topics it is useful to data analytics role. can you tel me it will to useful to my course thank you

sukkaka
Автор

Sir my all confusion clear in one vedio ❤❤

vikramverma
Автор

You are doing a great job. Please upload all the videos ASAP.
Thanks

rajabhishek
Автор

Please explain how to do alter table, drop table because it is my first time learning SQL so please help me sir

pallablahiri
Автор

Hello, Thanks for your easy explanations. I have a few doubts:
1. Can I use Truncate to delete the values in a particular column? Or is there any particular command for that?
2. How to rearrange columns?
3. Also, is it suggested to write the drop command to delete the table - we can also right click and delete the table from the Tables section. Please suggest

koshtiuchit