0% found this document useful (0 votes)
44 views

Vivekananda School of Information Technology Database Management System Practical Lab Assignment 1

This document contains instructions for a database management systems assignment. It asks the student to create a database called BCA2 containing three tables (STUDENT, DEPT, FACULTY) according to the given structures, then modify the tables by adding and changing columns. The student is asked to display the original and modified table structures and point out the differences.

Uploaded by

nishant
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)
44 views

Vivekananda School of Information Technology Database Management System Practical Lab Assignment 1

This document contains instructions for a database management systems assignment. It asks the student to create a database called BCA2 containing three tables (STUDENT, DEPT, FACULTY) according to the given structures, then modify the tables by adding and changing columns. The student is asked to display the original and modified table structures and point out the differences.

Uploaded by

nishant
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/ 5

PRANSHU

35929802018

VIVEKANANDA SCHOOL OF INFORMATION TECHNOLOGY


DATABASE MANAGEMENT SYSTEM
PRACTICAL LAB ASSIGNMENT 1

Based on DDL (Data Definition Language) CREATE and ALTER Statement

Create a database named BCA2 which consists of the following 3 Relations


STUDENT, DEPT and FACULTY.

STUDENT
Name Data Type Constraint
ROLLNO NUMERIC (3) Primary key
SNAME VARCHAR (20) NOT NULL
AGE INT
CITY VARCHAR (20)

DEPT
Name Data Type Constraint
DEPTNO NUMERIC (2) Primary key
DNAME VARCHAR (20) NOT NULL

FACULTY
Name Data Type Constraint
ID INT Primary key Autoincrement
NAME VARCHAR (20)
DATE_OF_BIRTH DATETIME
ADDRESS VARCHAR (50)
GENDER CHAR (1) Single character Only ‘M’ or ‘F’

Q1. Create the above tables with the appropriate structure.


Q2. Display the structure of each of the above tables.
Q3. Modify the structure of the STUDENT table with adding 1 more column with the name
MOBILENO of integer data type.
Q4. Also ADD 1 more column named LOCATION varchar (20) to the table DEPT.
Q5. Modify size of the name field of table FACULTY from 20 to 50.
Q6. Display again the structure of the above 3 tables and point out the differences.
PRANSHU
35929802018

DATABASE MANAGEMENT SYSTEM


PRACTICAL LAB ASSIGNMENT 1

Ans 1.

CREATE database BCA2;


USE BCA2;
CREATE TABLE STUDENT
(
ROLLNO numeric(3) PRIMARY KEY,
SNAME varchar(20) NOT NULL,
AGE int,
CITY varchar(20)
);

CREATE TABLE DEPT


(
DEPTNO numeric(2) PRIMARY KEY,
DNAME varchar(20) NOT NULL
);

CREATE TABLE FACULTY


(
ID int PRIMARY KEY IDENTITY(1,1),
NAME varchar(20),
DATE_OF_BIRTH datetime,
ADDRESS varchar(50),
GENDER char(1) CHECK(GENDER='M' OR GENDER='F')
);
PRANSHU
35929802018

Ans 2.

 sp_help STUDENT;

 sp_help DEPT;

 sp_help FACULTY;
PRANSHU
35929802018

Ans 3.

ALTER TABLE STUDENT


ADD MOBILENO int;

Ans 4.

ALTER TABLE DEPT


ADD LOCATION varchar(20);

Ans 5.

ALTER TABLE FACULTY


ALTER COLUMN NAME varchar(50);

Ans 6.

 sp_help STUDENT;
PRANSHU
35929802018

 sp_help DEPT;

 sp_help FACULTY;

You might also like