CBSE Class 11 Informatics Practices
Question 40 of 40
Practice Paper — Question 5
Back to all questions 5
Question Mr. Malhotra is working on a MySQL table named Stud with the following table schema:
| Field | Type | Null | Key | Default | Extra |
|---|---|---|---|---|---|
| regno | int | NO | PRI | NULL | |
| name | varchar(30) | YES | NULL | ||
| marks | int | YES | 0 | ||
| dob | date | NO | NULL |
(i) Which command is used to get the given table schema as output?
(ii) Write the query to create table Stud.
(iii) Write a command to add a column address varchar(20) in table Stud.
(iv) Write a command to delete the column dob from the table Stud.
(v) Can Mr. Malhotra create more than one table in a database?
(i)
DESCRIBE Stud;(ii)
CREATE TABLE Stud (
regno int NOT NULL PRIMARY KEY,
name varchar(30) DEFAULT NULL,
marks int DEFAULT 0,
dob date NOT NULL
);(iii)
ALTER TABLE Stud
ADD address varchar(20);(iv)
ALTER TABLE Stud
DROP COLUMN dob;(v) Yes, Mr. Malhotra can create more than one table in a database. In fact, a database can have multiple tables, each with its own schema and data. There is no limit to the number of tables that can be created in a database.