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

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

Rishabh Mishra

1 год назад

174,827 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Rishabh Mishra
Rishabh Mishra - 12.05.2023 08:51

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

Ответить
Navjot Singh
Navjot Singh - 22.10.2023 18:31

ERROR: column "custid" of relation "customer" does not exist
LINE 2: (CustID, CustName, AGE, CITY, SALARY)
^

SQL state: 42703
Character: 23

Ответить
harishankar gan
harishankar gan - 21.10.2023 18:51

INSERT INTO public.customer
(CustID, CustName, Age, City, Salary)
VALUES
(1, 'Sam', 26, 'Delhi', 9000),
(2, 'Ram', 19, 'Banglore', 110000),
(3, 'Pam', 32, 'Mumbai', 6000),
(4, 'Jam', 42, 'Pune', 10000);

ERROR: column "custid" of relation "customer" does not exist
LINE 2: (CustID, CustName, Age, City, Salary)
^

SQL state: 42703
Character: 30

Ответить
harishankar gan
harishankar gan - 21.10.2023 18:48

ERROR: column "custid" of relation "customer" does not exist
LINE 2: (CustID, CustName, Age, City, Salary)
^

SQL state: 42703
Character: 23

Ответить
ComicSansar
ComicSansar - 21.10.2023 16:36

I edit database with db browser and used on app . I thinks that is not working because data is not extracting . Is there chance of error or i am just thinking .

Ответить
Viraj Nagarkar
Viraj Nagarkar - 21.10.2023 12:18

If anyone is having trouble in finding the table and getting error as table not found then you can use the following statement as
INSERT INTO public."Table_name"
(column_1, column_2....,column_n)
VALUES
(value1, value2, value3);


note : - use public."table_name" for every sql query to mark the table in which you are implementing the query.

Ответить
үαsн кαησנιүα
үαsн кαησנιүα - 17.10.2023 19:33

Getting error again and again while using
ALTER TABLE "Customer"
ALTER COLUMN "Email" char(10);

Ответить
Vipul Negi
Vipul Negi - 17.10.2023 19:27

Its wrong for adding column- alter table table_name add column_name
For drop - alter table table_name drop column columm_name
For modify columnsyntax - alter table_name modify columnname

Ответить
MUHAMMAD HUNAID
MUHAMMAD HUNAID - 17.10.2023 11:35

How to update values from different row and different column in a single query

Ответить
Mansi
Mansi - 11.10.2023 17:53

Hello Rishabh Sir, when im inserting values why does it show error when im putting them in double quotes while its working fine with single quotes??

Ответить
desi science
desi science - 11.10.2023 08:53

Sir table space kese badate hai?

Ответить
Hemant Kodiya
Hemant Kodiya - 08.10.2023 23:43

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

Ответить
Shrestha Sharma
Shrestha Sharma - 08.10.2023 09:36

HELLO SIR, THE ISSUE I AM FACING IS ABOUT THE SYNTAX YOU ARE USING AND WHAT MY POSTGRE SQL IS ACCEPTING IS DIFFERENT IDK WHY.

FOR EG. i have to use double quotes for representing my column names instead you are not using it............

another syntax problem is when i am using ALTER COLUMN. i have to use TYPE command with it to work perfectly.

kindly check this.

Ответить
Swapnil Patel
Swapnil Patel - 04.10.2023 19:49

pls make videos on database also good explanation

Ответить
Mohammad Sadique
Mohammad Sadique - 03.10.2023 14:03

@RishabhMishraOfficial DATA TYPE alter me syntax error aarha hai : ALTER TABLE customer ALTER COLUMN city VARCHAR(50) {from char(50) to varchar(50)}

Ответить
DIVYA SOHNI
DIVYA SOHNI - 27.09.2023 16:33

When you use alter table for add column than you define the data type also in this slide that is not written so that you may got error

Ответить
Abhishek Dubey
Abhishek Dubey - 23.09.2023 18:25

Hi Rishabh, i understood the delete command, how do we write command if we have to delete multiple rows?

Ответить
Laxmi Nakka
Laxmi Nakka - 20.09.2023 11:27

Yeah I have doubt about alter table modify I can't able to change the data type in existing table

Ответить
Kapil Gautam
Kapil Gautam - 16.09.2023 16:01

Best videos for sql 🫡🫡🫡

Ответить
habib hk
habib hk - 16.09.2023 03:58

If by mistake we did not mention charecters how to edit that?

Ответить
Normal Lifestyle
Normal Lifestyle - 10.09.2023 16:34

What is the different between DELETE FROM table_name and TRUNCATE TABLE table_name?

Ответить
@lillu
@lillu - 08.09.2023 04:10

Worthfull video
Thanks

Ответить
Pranav Mehra
Pranav Mehra - 05.09.2023 09:17

Insert value m problem aari

Ответить
Shreshth Adlakha
Shreshth Adlakha - 04.09.2023 21:35

I cannot run alter column command.
It keeps showing error.

Ответить
Kajal Kumari
Kajal Kumari - 01.09.2023 09:25

I m getting error in update

Ответить
Sunil Lohar
Sunil Lohar - 31.08.2023 06:21

Very helpful content

Ответить
Vijaykumar Yadav
Vijaykumar Yadav - 28.08.2023 20:03

Column I'd relation doest not exist aa rha hai kaise resolve karu

Ответить
Rj spidy
Rj spidy - 28.08.2023 08:56

Mujhe alter column krne m error aa rha h

Ответить
Aniket Sonone vlogs
Aniket Sonone vlogs - 27.08.2023 13:55

After using the Alter/drop column, I am unable to add values in the new column which is created using the Alter/ add column. I put 1,1 single values using an update command in the table, how to do it in one go?

Ответить
debopom saha
debopom saha - 27.08.2023 02:10

there is no info about how to update records in a new column after adding in a exesting table???????

Ответить
Jainish Patel
Jainish Patel - 26.08.2023 05:01

Sir , Data type change karne ka syntax me error aa raha he?

Ответить
Sanskar Soni
Sanskar Soni - 24.08.2023 08:48

table m value insert krne k lye new table bana padegi kya sir...

Ответить
Psycho Status¹¹
Psycho Status¹¹ - 22.08.2023 20:08

Ответить
NEELAM V
NEELAM V - 21.08.2023 21:16

I have Questions i have created new colums name as City in Table, Now I put that City Column Next name how will I do it.

Ответить
ashish bharti
ashish bharti - 21.08.2023 11:51

Hi Rishab, I am facing an error: column "age " Of relation "customer" Does not exist
Line 2: (custid, custname, age salary)
SQL state: 42307
Character: 37 please clarify this as I am unable to insert values in tables

Ответить
Saurabh Rawat
Saurabh Rawat - 19.08.2023 15:19

Very easy way of your teaching Rishabh ji it would be more better if had included alter too....but thank you so much

Ответить
SAJAL GUPTA
SAJAL GUPTA - 15.08.2023 14:19

Bhai INSERT INTO Customer
(CusID, Name)
VALUES
(12, 'Sajal');
maine yan command run ki hai but i got a error

error was:- ERROR: column "cusid" of relation "customer" does not exist
LINE 2: (CusID, Name)
^

SQL state: 42703
Character: 23

please bhai batao kiya hai mujhe smj nh aa rh

Ответить
Khushboo Barai
Khushboo Barai - 12.08.2023 08:51

Not able to run ALTER TABLE command can you please help me with this.

Ответить
IKSHITA JAIN
IKSHITA JAIN - 08.08.2023 19:18

Alter table customer
ALTER COLUMN "CustName" varchar;
I have written this in query. I was trying to alter the column datatype from char to varchar but its not working. Can you help me in that. Although it's not required but i was experimenting with ALTER column. It's showing..

ERROR: syntax error at or near "table"
LINE 2: Alter table customer
^

SQL state: 42601
Character: 3

Ответить
Zaid Ahmad
Zaid Ahmad - 08.08.2023 02:20

My error showing
Column "age" of relation " customer" does not exist...and AGE column is already in table

Ответить
002_Aashish Rawat
002_Aashish Rawat - 30.07.2023 22:10

Sir ek question hai , is column field name is case sensitive while writing query ya as it is same style mai column field likhna hoga

Ответить
002_Aashish Rawat
002_Aashish Rawat - 30.07.2023 11:22

Sir I am facing a problem. When I am excuted error message appears
Error: column "custid" of relation "customer " does not exist

Ответить
Ashish Singh
Ashish Singh - 29.07.2023 13:11

sir why Alter table statement showing error ?
ALTER TABLE customer1
ADD COLUMN place
;
_____________________________________________________________
ERROR: syntax error at or near ";"
LINE 3: ;
^
SQL state: 42601
Character: 41

Ответить
Hemant Gautam
Hemant Gautam - 28.07.2023 10:30

show error in command but i also copy your also show error i am not understand how can fix this error plz help

Ответить
Helping Wallah NGO
Helping Wallah NGO - 25.07.2023 14:59

thanks brother :)

Ответить
Sayok Sanyal
Sayok Sanyal - 19.07.2023 18:36

Rishabh I am facing issues while using ALTER COLUMN could you please help me out for the correct syntax

Ответить
JAMSHED KHAN
JAMSHED KHAN - 18.07.2023 15:18

My table name is correct which is 'Customer' but still it is showing does not exist

Ответить
Haresh Sanitary Office
Haresh Sanitary Office - 12.07.2023 09:53

ERROR: syntax error at or near ")"
LINE 4: (1, 'Mahesh', 'Ambawadi', 2%),
^ I got this error while trying to insert data.

Ответить