Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
Questions For Late Bloomers:: CBSE Ques. No. Chapter / Topic Marks Distribution of Marks Question Wise
Q.2. What do you understand by the terms primary key and degree of a relation in relational data base?
Ans: Primary Key: A primary key is a set of one or more attributes that can uniquely identify tuples within the
relations. The number of attributes in a relation is called Degree of arelation in relational data base.
What do you understand by the candidate key and cardinality of a relation in relational data base?
Candidate Key: All attribute combinations inside a relation that can serve as primary key(uniquely identifies a row
in a relation) are Candidate Keys as they are candidates for the primary key position. The number of rows in a
relation is known as cardinality of a relation.
Q.3. What do you understand by the terms Cardinality and Degree of the table?
Ans Degree: The number of attributes in a relation determines the degree of a relation. A
relation having 3 attributes is said to be a relation of degree 3.
Cardinality: The number of rows in a relation is known as Cardinality.
Ans: The DBA must be a manager, more than a technician-seeking to meet the needs of people who
use the data. Since many user may share the same data resource, the DBA must be prepared to meet the
need and objective.
The table in which this non-key attribute i.e. foreign key attribute exists, is called a foreign table.
Q.6. What is the main function of DBA.
Ans: The DBA must be a manager, more than a technician-seeking to meet the needs of people who
use the data. Since many user may share the same data resource, the DBA must be prepared to meet the
need and objective.
Q.7 Write a query on the customers table whose output will exclude all customers with a rating
<=100, unless they are located in Shimla.
Q.8. Write a query that selects all orders except those zeros or NULLs in the amount field.
Ans. SELECT * FROM Orders WHERE amt <>0 AND (amt IS NOT NULL) ;
Output the rating field first, followed by the customer’s name and number.
Ans. SELECT rating, cust-name, cust-num FROM customers ORDER BY rating DESC ;
Q.10. Write a command that puts the following values, in their given order, into the salesman table:
VALUES(‘Manisha’,NULL,1901) ;
The DML provides statements to enter, update, delete data and perform complex queries on
these tables.
Ans: Constraints are used to enforce rules at table level when ever row is inserted, updated/deleted
from table.
Column Level: Reference to a single column. can be defined any type of integrity.
Table Level: References one or more columns and is defined separately from definition of the columns in
the table.
Consider the following tables Product and Client. Write SQL commands for the statement (i) to (iv) and
give outputs for SQL queries (v) to (viii)
Table: PRODUCT
Product
P_ID Manufacturer Price
Name
TP01 TalcomPowder LAK 40
FW05 Face Wash ABC 45
BS01 Bath Soap ABC 55
SH06 Shampoo XYZ 120
FW12 Face Wash XYZ 95
Table: CLIENT
(ii) To display the details of Products whose Price is in the range of 50 to 100(Both values included).
Ans: Select all from product where Price between 50 and 100
(iii) To display the ClientName, City from table Client, and ProductName and Price from table Product,
with their corresponding matching P_ID.
Ans: ( The above question may consist DISTINCT City. If it is DISTINCT City, the following is the answer)
City
-----
Delhi
Mumbai
Bangalore
(vi) SELECT Manufacturer, MAX(Price), Min(Price), Count(*) FROM Product GROUP BY Manufacturer;
Ans:
Ans:
ClientName ManufacturerName
Cosmetic Shop ABC
Total Health ABC
Live Life XYZ
Pretty Woman XYZ
Dreams LAK
ProductName Price*4
TalcomPoweder 160
Face Wash 180
Bath Soap 220
Shampoo 480
Face Wash 380
QUESTIONS FOR BRIGHT LEARNERS
1. . What is Cartesian Product.
2. Write the SQL query commands based on following table
Table : Book
Book_id Book name Author_name Publisher Price Type Quantity
William
F0001 The Tears Hopkins First Publi. 650 Fiction 20
Table : issued
Book_Id Quantity Issued
T0001 4
C0001 5
F0001 2
(a) To show book name, Author name and price of books of First Pub. Publisher
(b) To list the names from books of text type
(c) To Display the names and price from books in ascending order of their prices.
(d) To increase the price of all books of EPB publishers by 50.
(e) To display the Book_Id, Book_name and quantity issued for all books which have been issued
(f) To insert a new row in the table issued having the following data. ‘F0003’, 1
(g) Give the output of the following
i. Select Count(*) from Books
ii. Select Max(Price) from books where quantity >=15
iii. Select book_name, author_name from books where publishers=’first publ.’
iv. Select count(distinct publishers) from books where Price>=400
Ans:
(a) Select book_name, author_name , price from books where publisher=’First Publ’
(b) Select book_name from books where type=’Text’
(c) Select book_name, price from books Order by Price;
(d) Update books set price=price+50 where publishers=’EPB’
(e) Select a.book_id,a.book_name,b.quantity_issued from books a, issued b where
a.book_id=b.book_id
(f) Insert into issued Values (‘F0003’,1);
(g)
i. 5
ii. 750
iii. Fast Cook LataKappor
My First c++ Brain & Brooke
iv. 1
Q.18.
TABLE: GRADUATE
S.NO NAME STIPEND SUBJECT AVERAGE DIV.
1 KARAN 400 PHYSICS 68 I
2 DIWAKAR 450 COMP. Sc. 68 I
3 DIVYA 300 CHEMISTRY 62 I
4 REKHA 350 PHYSICS 63 I
5 ARJUN 500 MATHS 70 I
6 SABINA 400 CEHMISTRY 55 II
7 JOHN 250 PHYSICS 64 I
8 ROBERT 450 MATHS 68 I
9 RUBINA 500 COMP. Sc. 62 I
10 VIKAS 400 MATHS 57 II
(a) List the names of those students who have obtained DIV I sorted by NAME.
(b) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend received in a year
assuming that the STIPEND is paid every month.
(c.) To count the number of students who are either PHYSICS or COMPUTER SC graduates.
(d) To insert a new row in the GRADUATE table:
11,”KAJOL”, 300, “COMP. SC.”, 75, 1
(e) Give the output of following sql statement based on table GRADUATE:
(i) Select MIN(AVERAGE) from GRADUATE where SUBJECT=”PHYSICS”;
(ii) Select SUM(STIPEND) from GRADUATE WHERE div=2;
(iii) Select AVG(STIPEND) from GRADUATE where AVERAGE>=65;
(iv) Select COUNT(distinct SUBDJECT) from GRADUATE;
Assume that there is one more table GUIDE in the database as shown below:
Table: GUIDE
MAINAREA ADVISOR
PHYSICS VINOD
COMPUTER SC ALOK
CHEMISTRY RAJAN
MATHEMATICS MAHESH
(c) SELECT SUBJECT, COUNT(NAME) FROM GRADUATE GROUPBY (SUBJECT) HAVING SUBJECT='PHYSICS' OR
SUBJECT='COMP. Sc.';
(iv) COUNT(DISTINCTSUBJECT) 4
NAME ADVISOR
DIVYA RAJAN
SABINA RAJAN
KARAN VINOD
REKHA VINOD
JOHN VINOD
(v) (i) select firstname, salary from employees, empsalary where designation='Salesman' and
employees.empid=empsalary.empid
FIRSTNAMESALARY
Rachel 32000
Peter 28000
COUNT(DISTINCTDESIGNATION)
DESIGNATIONSUM(SALARY)
Clerk 135000
Manager 215000
SUM(BENEFITS)
32000
Consider the following tables Item and Customer. Write SQL commands for the statement (i) to (iv) and
give outputs for SQL queries (v) to (viii)
Table: ITEM
Table: CUSTOMER
(ii) To display the details of Item whose Price is in the range of 35000 to 55000 (Both values included).
Ans: Select all from Item Where Price>=35000 and Price <=55000
(iii) To display the CustomerName, City from table Customer, and ItemName and Price from table Item,
with their corresponding matching I_ID.
(iv) To increase the Price of all Items by 1000 in the table Item.
Ans: City
Delhi
Mumbai
Bangalore
Ans:
Ans:
(viii) SELECT ItemName, Price * 100 FROM Item WHERE Manufacturer = ‘ABC’;
Ans:
ItemName Price*100
Personal Computer 3500000
Laptop 5500000