Advertisements
Advertisements
Question
Consider the table Projects given below:
Table: Projects
P_Id |
Pname |
Language |
Startdate |
Enddate |
P001 |
School Management System |
Python |
2023-01-12 |
2023-04-03 |
P002 |
Hotel Management System |
C++ |
2022-12-01 |
2023-02-02 |
P003 |
Blood Bank |
Python |
2023-02-1 1 |
2023-03-02 |
P004 |
Payroll Management System |
Python |
2023-03-12 |
2023-06-02 |
Based on the given table, write SQL queries for the following:
- Add the constraint,
primary key
to columnP_id
in the existing tableProjects
. - To change the language to
Python
of the project whose id isP002
. - To delete the table
Projects
from MySQL database along with its data.
Short Answer
Solution
- Alter table Projects ADD Primary key(P_id);
- Update Projects set Language="Python" where P_id="P002";
- Drop table Projects;
shaalaa.com
Is there an error in this question or solution?