Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
21.0k views
in Information Technology by (71.3k points)

Ms. Archana, a class XI student has just started learning MySQL. Help her in understanding the basic difference between Alter and Update command with suitable example.

Also suggest her suitable command for the following purpose:

(i) To display the list of the databases already existing in MySQL.

(ii) To use the database named City.

(iii) To remove the pre-existing database named Clients.

(iv) To remove all the records of the table named “Club” at one go along with its structure permanently.

1 Answer

+2 votes
by (76.5k points)
selected by
 
Best answer
ALTER UPDATE
It‟s a DDL command. It‟s a DML command.
  • It can be used for the following purpose:
  • To add a new column.
  • To remove an existing column.
  • To modify a column.
  • To add/remove a constraint.
It‟s used to modify the records of the table.

Example:
If a table named emp already exists with 
following columns:

Empno Name Dept

To add an address column, we may use following command:

Alter Table emp add address varchar(20);

Example:
To modify the address to Noida from “New Delhi”, we may use the following command :
Update emp set address= “Noida” where city= “New Delhi”;

suitable command:

(i) Show Databases

(ii) Use City

(iii) Drop Database Clients

(iv) Drop table Club

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...