You are on page 1of 5

SET -II

SCMS SCHOOL OF TECHNOLOGY & MANAGEMENT


PRATHAP NAGAR, MUTTOM, COCHIN
IMCA –B8
SEMESTR-III - MODEL EXAMINATION
March 2023 Time: 3 Hours
Max. Marks:75
DBMS Lab
I. Create the following tables:
TABLE : STUDENT
COLUMN NAME DATA TYPE CONSTRAINTS
Roll_no Number(5) Primary Key
Name Varchar(20) Not null
Dept_id Number(5) Foreign Key
Gender Varchar(2)
Contact_no Number(10)

TABLE : DEPARTMENT
COLUMN NAME DATA TYPE CONSTRAINTS
Dept_id Number(5) Primary Key
Dept_name Varchar(10) Not null

Write SQL queries for the following


1. a. Insert 5 records in each table
b. Update the contact number of student with department name is Maths.
2. a. Display the data of female students in alphabetical order.
b. Find the number of students in each department and display the details in descending
order.
3.
a. Display the names and contact numbers. Dept_name of all students
b. Display names of Departments have more than 5 students..
SET -II
SCMS SCHOOL OF TECHNOLOGY & MANAGEMENT
PRATHAP NAGAR, MUTTOM, COCHIN
IMCA –B8
SEMESTR-III - MODEL EXAMINATION
March 2023 Time: 3 Hours
Max. Marks:75
DBMS Lab
II. Create the following tables:
TABLE: CUSTOMER
Column name Data type Size Constraints
Cust_id Varchar 10 Primary Key
Fname Varchar 25 Not Null
Lname Varchar 25
Area Varchar 10 Kottayam ,Kollam, Kochi
Phone_number Numeric 15
TABLE : INVOICE
Column Name Data type Size Constraints

Inv_no Varchar 20 Primary Key

Cust_id Varchar 10 Foreign Key

Issue_date Date

Write SQL queries for the following:


1. a. Insert 5 records in each table
b. Change the issue date to 24/7/08 of customer name ‘John’;
2. a. Find area where total number of customers greater than 3
b. List the customer name and invoice number of all customers
3.
a. Find the number of customers in each area.
b. List the customer details who has no invoice.
SET -II
SCMS SCHOOL OF TECHNOLOGY & MANAGEMENT
PRATHAP NAGAR, MUTTOM, COCHIN
IMCA –B8
SEMESTR-III - MODEL EXAMINATION
March 2023 Time: 3 Hours
Max. Marks:75
DBMS Lab
III. Create the following tables:
TABLE NAME: CUSTOMER
Column Name Data Type Constraint
Cno Varchar(6) Primary Key
Cname Varchar(20) Not Null
Address Varchar(20)
City Varchar(20)
TABLE NAME :SALES
Column name Data type Constraint
orderno Varchar(6) Primary key
Orderdate Date __
cno Varchar(6) Foreign key

Write SQL queries for the following


1. a. Insert 5 records in each table
a. Update the orderdate of Customer “John” as 20/7/2022
2. a. Count the orders placed after 03-march-2012.
b. Find the details of customers who has no sales.
3.
a. Delete customer details where orderdate is 20/7/2022.
b. Find the city where the total number of customers greater than 3.
SET -II
SCMS SCHOOL OF TECHNOLOGY & MANAGEMENT
PRATHAP NAGAR, MUTTOM, COCHIN
IMCA –B8
SEMESTR-III - MODEL EXAMINATION
March 2023 Time: 3 Hours
Max. Marks:75
DBMS Lab
IV. Create the following tables:
TABLE NAME: EMPLOYEE
COLUMNNAME DATATYPE CONSTRAINT
eno Varchar(5) Primary key
name Varchar(30) Not null
designation Varchar(30) Trainee,Team Member, Team
Head,Manager
salary Number(7,2) __

TABLE NAME: PROJECT


COLUMN NAME DATATYPE CONSTRAINT
PID Varchar(5) Primary key
ProjName Varchar(25)
eno Varchar(5) Foreign key

Write SQL queries for the following


1. a. Insert 5 record in each tables
c. Update the project name of the employee named “Albert”
2. a. delete the details of employee those who are not handling any projects.
c. List the employee name those who are handling more than 1 project.
3.
a. List all those who are getting salary less than the average salary.
b. Find the maximum, minimum and average salary of each category of employees

You might also like