SET 1
Q.1 Create a table student in SQL as per the
following description (Assume suitable size and data types for the
attributes)
Use insert query
of SQL to add the data of at least 5students
in this table
TABLE
STUDENT
|
Attribute Name
|
Data
Type
|
Property
Applied
|
|
Admno
|
Number
|
Primary Key
|
|
Name
|
Varchar
|
NOT NULL
|
|
Class
|
Number
|
|
|
Marks
|
Number
|
|
1)
Design a form in NetBeans which
can view all the records of this table using a jTable Object
2)
Design a form to add a new
record in the above table (only valid data as per the specified constraints
should be entered)
Q.2 Write Sql Queries for the
following
b) To display a merit list of
names of students on the basis of marks
c) To display details of all
students who have not given the exam (Marks are NULL)
d) To display
the students who are in same class as that of admission no 123.
e)
To Delete the students of classes X and XII who have scored below 30.
SET 2
Q.1
Create a table LIBRARY in SQL as per the following description ( Assume
suitable size for the attributes)
Use insert query of SQL to add the data to at least 5 books in this table
TABLE
LIBRARY
|
Attribute Name
|
Data
Type
|
Property
Applied
|
|
Bookno
|
Number
|
Primary Key
|
|
Title
|
Varchar
|
NOT NULL
|
|
Location
|
Number
|
|
|
Price
|
Number
|
|
1)
Design a form in NETBEANS which
can delete records in this LIBRARY table based on the Bookno availablein a list box(List boxes should only have the
entries of the existing records of the table)
2)
Design a form in NETBEANS which
can search the data of desired book from this table on the basis of Bookno of the existing books , present in the
form of a list box on this form
Q.2 WriteSql Queries for the
following
a) To Count and display the
average price of books stored at each location
b) To display a book list on the basis of price in descending order
c) To display details of all
books who have not been given any location of storage (location is NULL)
d) To display
the title of books who are at
same location as that of book no 123.
e) To modify the price of all
books by 10 % of the current price
SET 3
Q.1 Create a table in SQL as per the following description (
Assume suitable size for the attributes)
Add at least 5 records in
this table using SQL query
TABLE
ELECTRIC_BILL
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
Consumer_no
|
Number
|
Primary Key
|
|
Consumer_name
|
Varchar
|
NOT NULL
|
|
Meter_Reading
|
Number
|
|
|
Connection_Type
|
Varchar
|
|
1)
Design a form in NETBEANS which
can modify the record of a consumer whose record is stored in
the table on the basis of consumer_noselected
from a list boxes available on the form ( List box should have entries for only
the records that are existing in the table )
2)
Design a form in NETBEANS which
can view all records using jTable object
Q.2 WriteSql Queries for the
following
a) To Count and display the
total connections of each type
b) To display a consumer list
on the basis of meter reading in descending order
c) To display details of all
consumers who have meter reading the
range of 100 to 300 units
d) To display
the details of consumers having same connection type as that of consumer
named as “Amit Bhatia”
e) To reduce the meter reading of all Residential type consumers by 10 % of the current price
SET 4
Q.1 Create a table LABWORK in SQL as per the
following description ( Assume suitable size for the attributes)
Use insert query of SQL to add
the data to at least 5 experiments in this table
TABLE
LABWORK
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
Exp_no
|
Number
|
Primary Key
|
|
Aim
|
Varchar
|
NOT NULL
|
|
Date_done
|
Date
|
NOT NULL
|
|
Status
|
Varchar
|
|
1)
Design a form in NETBEANS which
can insert new record in the above the
table (only valid data as per the applied constraints should be allowed
)
2)
Design a form to navigate delete records on the basis of experiment of
existing records available in a list box
Q.2 WriteSql Queries for the
following
a) To Count and display the
total No of experiments done on each date
b) To display a experiment list in descending order of dates on which
experiment is done
c) To display details of all
experiments which have status value
incomplete
d) To display
the details of experiments having
same status as that of experiment no 22
e) To change the status of all experiments done on 12th
Dec. 2010 as Completed
SET 5
Q.1
Create a table in SQL as per the following description ( Assume suitable
size for the attributes)
Use
insert query of SQL to add at least 5 records in the table
TABLE
PARK_COLLECTION
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
Swing_code
|
Number
|
Primary Key
|
|
Description
|
Varchar
|
NOT NULL
|
|
No_Of_Visitors
|
Number
|
|
|
Date_of_Visit
|
Date
|
|
|
Total_Collection
|
Number
|
|
1)
Design a form to modify a record in this table on the basis Swing_code
selected through a list box available on the form ( List box should have
entries for only the records that are existing in the table )
2)
Design a form in NETBEANS which
can delete a record in this table on the
basis description selected through a
list box available on the form ( List box should have entries for only the
records that are existing in the table )
Q.2 WriteSql Queries for the
following
a) To Count and display the
total collection from each Swing (identified by its code)
b) To display a list of swings in descending order of no of
visitors
c) To display details of all
swings where visitors are less than 100
d) To display
the details of swings having same
no of visitors as that of swing
code 24
e) To delete all swing records
where no of visitors are less than 30
SET 6
Q.1
Create a table in SQL as per the
following description ( Assume suitable size for the attributes)
Use insert query of SQL to add at
least 5records in the table
TABLE
ELECTORAL_ROLLS
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
Constituency_code
|
Number
|
Primary Key
|
|
Candidate_name
|
Varchar
|
NOT NULL
|
|
Party_Name
|
Varchar
|
NOT NULL
|
|
Date_of_Election
|
Date
|
|
1)
Design a form in NETBEANS which
add the record of a candidate(ensure that only valid data as per the applied
constraints is allowed to be stored ).
2)
Design a from which searches
the records on the basis of Constituency_code
available in the form of a list box ( List box should have entries for
only the records that are existing in the table )
Q.2 WriteSql Queries for the
following
a) To print the names of
different parties which are contesting in the elections
b) To display a list of candidates whose election is
scheduled on current system date
c) To display constituency
details whose candidate name starts with alphabet ‘A’ or ‘S’
d) To
display name of candidates whose
election is scheduled at same date as that
of a candidate named as
“Ali Murad”
e) To change date of election
for constituency code 05 as current
system date
SET 7
Q.1
Create a table in SQL as per the following description ( Assume suitable
size for the attributes)
Use
insert query of SQL to add at least 5
records in the table
TABLE
RAIL_MASTER
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
Train_no
|
Number
|
Primary Key
|
|
Train_Name
|
Varchar
|
NOT NULL
|
|
Source
|
Varchar
|
NOT NULL
|
|
Destination
|
Varchar
|
NOT NULL
|
|
Capacity
|
Number
|
|
1)
Design a form in NETBEANS which
can delete the records on the basis of Train_No selected from respective list
boxe which have the entries of all existing records in the table.
2)
Design a form which can add a
new record in the table (Only valid values as per the specified domain can be
inserted primary key value i.e. Train no
should be generated automatically)
Q.2 WriteSql Queries for the
following
a) To print the names of
different destinations for which the trains are available
b) To display a list of trains running between “Delhi” and
“Mumbai”
c) To display train details where
destination name starts or ends with an
alphabet ‘A’
d) To
display name of source name of
trains which have same destination as that of train number ‘2010’
e) To increase capacity of all
trains by 10 % of the current capacity
SET 8
Q.1
Create a table in SQL as per the
following description ( Assume suitable size for the attributes)
Use insert query of SQL to add at
least 5 records in the table
TABLE
VIDEO_LIBRARY
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
Cassette_no
|
Number
|
Primary Key
|
|
Title
|
Varchar
|
NOT NULL
|
|
Duration
|
Number
|
|
|
Price
|
Number
|
|
|
Stock
|
Number
|
|
1)
Design a form in NETBEANS which
can modify a recordon the basis of Cassette_no
selected from the list boxe (List box should have entries for only the records
that are existing in the table )
2)
Design a form in NETBEANS which
can searchand display details of the records of this table on the basis of cassette
no accepted from user
Q.2 WriteSql Queries for the
following
a) To print the total count of
movies of each duration.
b) To display a list of movies having price>20 in
descending order of their stock qty
c) To display details of movie
whose Title has an alphabet ‘A’ at second or second last position .
d) To
display Title of all movies
having same duration as that of a movie titled “TUM BIN”
e) To decrease stock value of
all movies having price more than 1000 rupees by 3 % of its current value
SET 9
Q.1
Create a table in SQL as per the
following description ( Assume suitable size for the attributes) and also insert at least 5 records in this table
using insert command of SQL
TABLE CANTEEN
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
ITEMCODE
|
Number
|
Primary Key
|
|
NAME
|
Varchar
|
NOT NULL
|
|
PRICE
|
Number
|
|
|
Brand
|
Varchar
|
Not Null
|
1)
Design a form in NETBEANS which
can view records of this CANTEEN table using jTable
swing control.
2)
Design a form to delete the record
of any item that is existing in the table on the basis of item code selected by
the user from the list of available items in
the table (use list box for showing existing item codes)
Q.2 WriteSql Queries for the
following
a) To print the various Brand
Names whose items are stored in the table
b) To display a list of Items having “BRITANIA” brand and
price > 100 in descending order of their price
c) To display Item details where
Name has an alphabet ‘A’ at third
position referred from the end of the Name.
d) To
displaydetails of items which
have same price as that of Item Named “BREAD” of “BRITANIA”
brand
brand
e) To increase price of all items
branded with “HINDUSTAN LEVER” by 10 % of the current value
SET 10
Q.1
Create a table FEECOLLECTION in
SQL as per he following description ( Assume suitable size for the attributes)
also add at least 5 records using
Insert Query of SQL
TABLE FEECOLLECTION
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
ADMNO
|
Number
|
Primary Key
|
|
FEEAMT
|
Number
|
NOT NULL
|
|
QUARTER
|
Number
|
|
|
NO_OF_DAYS_FINE
|
Number
|
|
|
FINEAMT
|
Number
|
|
1)
Design a form in NETBEANS which
can search the records on the basis of ADMNO. Selected from a list box that
contains only those ADMNO which are existing in the table
2)
Design a form which can modify
the details of any record of this table on the basis of admnoof existing
records that are available in the form of a list box tool on the form (accept
only valid entries to be stored in the table by checking the applied
constraints )
Q.2 WriteSql Queries for the
following
a) To print the admission no of
all students who have paid fine in Third Quarter
b) To display a list of
Admission no’s in descending order of fine amount paid in second quarter
c) To display a total amount of
fine collected in each quarter
d) To
display adm.no. of students who
have paid same amount of fine in second quarter as that paid by adm no 112 in
first quarter
e) To modify
the fine amount as Rs 10per day for all records in the table
SET 11
Q.1
Create a table TRANSPORT in SQL as per he following description also insert at least 5 record in it using
insert query of SQL ( Assume suitable size for the attributes)
TABLE
TRANSPORT
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
BUSNO
|
Number
|
Primary Key
|
|
MANUFACTURER
|
Varchar
|
NOT NULL
|
|
PURCHASE_DATE
|
Date
|
NOT NULL
|
|
DUE_DATE_SERVICE
|
Date
|
|
|
Capacity
|
Number
|
|
1)
Design a form in NETBEANS which
can view all records of the above table using jTable swing control
2)
Design a form that can delete
the record of any bus on the basis of busno of existing buses that are
available in the form of a list box object available on the form
Q.2 WriteSql Queries for the
following
a) To print names of various
manufacturers whose bus records are there in the table.
b) To display a list of all buses of
“Mahindra” make having capacity more than 35 seats in descending order
of their purchase date
c) To display list of buses
whose service is due in Oct. 2010 in ascending order of their busno’s.
d) To
displaydetails of all buses having same manufacturer as that of bus no
2341
e) To advance
thedue date of service for all buses of
TATA make by 10 days from current date of service
SET 12
Q.1
Create a table HOSPITAL in SQL as
per he following description also insert at
least 5 record in it using insert query of SQL ( Assume suitable size for
the attributes)
TABLE HOSPITAL
|
Attribute
Name
|
Data Type
|
Property Applied
|
|
DOCTORID
|
Number
|
Primary Key
|
|
DEPARTMENT
|
Varchar
|
NOT NULL
|
|
JOIN_DATE
|
Date
|
NOT NULL
|
|
SALARY
|
NUMBER
|
|
|
DOCTORNAME
|
Varchar
|
NOT NULL
|
1)
Design a form in NETBEANS which
can display names of all doctors (using a list box ) belonging to a department
whose name is selected from another list box that has the names of all the
departments present in the HOSPITAL
2)
Design a form that can view all records that are available in the table
using jTable Swing control
Q.2 WriteSql Queries for the
following
a) To print names of various departments
and sum of salary given to employees of
each department.
b) To display a list of all doctors alphabetically arranged in order of doctor
name and then on the basis of their salary in descending order.
c) To display doctor names starting with vowels .
d) To
display details of all doctors
serving in same department as that of
“Dr. Abdul Ansari” and esrning a salary more than 25000 rupees.
e) To increase the salary of all Doctors in
cardiology department by 25 % of their current salary