0% found this document useful (0 votes)
5 views2 pages

Dbms Assignment 1 Mirsha

Uploaded by

Mirsha R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Dbms Assignment 1 Mirsha

Uploaded by

Mirsha R
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

REG

NO:RA2211053040054
NAME: R Mirsha
ECE-DS ‘B’
DBMS Assignment

1) CREATE A TABLE STUDENT WITH THE FOLLOWING ATTRIBUTES:

1. Student_number

2.name
3.department_number
ANS:
CREATE TABLE Student( Student_number
int, Name VARCHAR(100),
Department_number int);

2) CREATE A TABLE Supplies WITH THE FOLLOWING ATTRIBUTES

1.supplier_id
2.supplier_name
3.contact_number
ANS:
CREATE TABLE
Supplies( Supplier_id int Primary key,
Supplier_name varchar(100),
Contact_number varchar(15));
3) Command to give the structure of the table student

Ans: desc student;


4) Command to modify the field student_name to stud_name

Ans: ALTER TABLE your_table_name


CHANGE student_name stud_name datatype;
5) Command to view changes in student table

structure Ans: desc student;


6) Command to add a field called marks in the student table

Ans: ALTER TABLE student ADD marks INT;


7) Command to modify the data type of the field student_number if you want to change it to
another data type for example varchar(10)
Ans: ALTER TABLE student
MODIFY COLUMN student_number VARCHAR(10);
8) Command to rename a column for example department_number to dept_number

ALTER TABLE student


RENAME COLUMN department_number TO dept_number;
9) Command to drop table student

Ans:DROP TABLE STUDENT;

You might also like