0% found this document useful (0 votes)
13 views6 pages

Assignment DBMS

The document provides instructions for answering questions related to SQL queries on database tables. It includes 13 questions asking to create tables, insert data, update records, and write queries to retrieve and manipulate data from the EMPLOYEE and FLIGHT tables. The questions cover skills like creating and populating tables, updating records, adding columns, sorting data, and filtering queries.

Uploaded by

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

Assignment DBMS

The document provides instructions for answering questions related to SQL queries on database tables. It includes 13 questions asking to create tables, insert data, update records, and write queries to retrieve and manipulate data from the EMPLOYEE and FLIGHT tables. The questions cover skills like creating and populating tables, updating records, adding columns, sorting data, and filtering queries.

Uploaded by

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

ASSIGNMENT 2 DBMS :

Date : 19/07/2023
For all the questions solve it in your system, take screenshot in Mysql and
attach it here.

1. a. Create the following table in MYSQL with no as primary key and insert the given values.
13 MARKS
TABLE : EMPLOYEE
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10

2 Kritika 35000 Centre 30 A 10

3 Naveen 32000 West 40 B 20

4 Uday 38000 North 38 C 30

5 Nupur 32000 East 26 B 20

b. For the given table insert a new row with Name Sanjay and salary 20000.
c. Write query to display all the employees whose grade is A or C.
d. Write query to display those employees whose name is of 5 letters.
e. Display those employee names and their salary whose age is above
35. f. Write query to change name of Uday to Udayan.
g. Update the name of Kritika to Ritika and Salary to 20000.
h.Display employees in ascending order of salary.
i. Add a primary key No to the above table.
j. Display those employees whose age is between 30 and 40.
k. Arrange employees in increasing order of age.
l. Add a new column DOB of date type.
m. Display those employees whose name starts with K or ends with e.
n. Insert values in the column DOB.

Ans1:
(a)
(b)

(c)

(d)

(e)
(f)

(g)

(h)

(i). Already done while creating table

(j)
(k)

(l)

(m)

(n)

3. Consider the table FLIGHT given below. Write commands in SQL for (i) to (iv) and
output for (v) to (vi). 6 MARKS
Table : FLIGHT

FLCODE START DESTINATION NO_STOPS NO_FLIGHTS

IC101 DELHI AGARTALA 1 5

IC102 MUMBAI SIMMIM 1 3


IC103 DELHI JAIPUR 0 7

IC105 KANPUR CHENNAI 2 2

IC107 MUMBAI KANPUR 0 4

IC431 INDORE CHENNAI 3 2

IC121 DELHI AHMEDABA 2 6


D

(i) Display details of all flights starting from Delhi.


(ii) Display details of flights that have more than 4 number of flights
operating.
(iii) Display flight codes, starting place, destination, number of flights in
descending order of number of flights.
(iv) Add on column “Remarks” in given table FLIGHT .
(v) SELECT NO_FLIGHTS,DESTINATION FROM FLIGHT WHERE
NO_STOPS>=2;
(vi) SELECT START, DESTINATION FROM FLIGHT WHERE
START=’DELHI’ OR DESTINATION=’CHENNAI’;

Ans3.
(i)

(ii)
(iii)

(iv)

(v)

(vi)

You might also like