DBMS Notes
DBMS Notes
Q14. What is the default data type of a field while creating table in design view?
Ans. Varchar
Q15. _______________ are the basic building blocks of a database.
Ans. Tables
Q16. Write the expanded form of SQL
Ans. SQL : Structured Query Language
Q17. A table has __________________ (horizontal / Vertical) row and ____________________
columns (horizontal / Vertical).
Ans. Horizontal , Vertical
Q18. OpenOffice Base is an open source _________________ (DBMS / RDBMS )
Ans. RDBMS
Q19. ________________ (Database / Table ) wizard helps you to create a new database.
Ans. Database
Q20. Multiple tables can be created in a database. (T / F)
Ans. True
Q11. Write the shortcut to execute query in “Create query in SQL view” of Base.
Ans. F5
Q12. What is the purpose of Where clause in Select Command?
Ans. Where Clause is used to retrieve specific record from the table.
Q13. What is the purpose of Order by clause in Select Command?
Ans. Order by clause is used to arrange the records in ascending or descending order.
Q14. Write the queries for the following table : Emp
Emp_id Ename Salary
1 Suman 20000
2 Sanjay 32000
3 Ravi 30000
a. Display the salary of all the employees after incrementing by Rs 1000.
Ans. Select Salary +1000 from Emp;
b. Display the Employee id and salary of all the employees after decreasing by Rs 500.
Ans. Select Emp_id, Salary – 500 from Emp;
c. Display the Name and salary of all the employees after incrementing it as thrice the amount
of present salary.
Ans. Select Ename, Salary * 3 from Emp;
d. Display the Employee id, Name and salary of all the employees after decrementing it as half
the amount of present salary.
Ans. Select Emp_id, Ename, Salary/2 from Emp;
e. Display the Employee id and Name of all the employees.
Ans. Select Emp_id, Ename from Emp;
Q15. Write the queries for the following table : Student
Admno Name Class House
1001 Sonam 9 Blue
1002 Ravi 10 Yellow
1003 Poonam 10 Green
a. Display the entire table
Ans. Select * from Student
b. Display the list of students whose house color is blue.
Ans. Select * from Student where House = “Blue”
c. Display the admission number of students whose house color is green.
Ans. Select Admno from Student where House = “Yellow”
d. To view records in ascending order of Admission Number.
Ans. Select * from Student order by Admno Asc;
e. Display the records of Class 10 Students.
Ans. Select * from students where Class = 10;
f. Display the class of ‘Ravi’
Ans. Select Class from Student where Name = ‘Ravi’
g. Insert the given record : 1004, “Aman”, 11, “Blue”
Ans. Insert into Student values( 1004, “Aman”, 11, “Blue”)
Q16. Which command is used for the following task in database?
1. To insert a new record
2. To modify the existing data.
3. To delete a record
4. To display record
Ans.
1. Insert
2. Update
3. Delete
4. Select
Q17. Write the queries for the following table : Item
Itemno Iname Price Qty
12 Pen 10 17
13 Eraser 5 15
14 Notebook 15 20
a. Write a query to insert a new record of following details
15, “Pencil”, 20, 10
Ans. Insert into Item values(15, “Pencil”, 20, 10)
b. Write a query to display detail of items whose quantity is more than 10.
Ans. Select * from Item where Qty > 10
c. Write a query to change the quantity of Item number 13 to 25.
Ans. Update Item set Qty = 25 where Itemno = 13
d. Display the total amount of each item. The amount must be calculated as the price
multiplied by quantity for each item
Ans. Select Price * Qty from Item.
e. Display the name of item whose price is 10.
Ans. Select Iname from Item where price = 10
f. Display all the records in ascending order of price.
Ans. Select * from Item order by Price asc.
g. Identify the Primary key from table Item.
Ans. Itemno
h. Write the suitable data type of field “Iname”.
Ans. Char or Varchar
i. Write a query to increase the price of all items by Rs2.
Ans. Update Item set Price = Price + 2;
j. Write a query to decrease the price of all items by Rs2 whose price is less than 20.
Ans. Update Item set Price = Price – 2 where Price < 20;
Q18. By default, data is arranged in _________ order using ORDER BY clause.
Ans. Ascending Order
Q19. Which clause is used for the following:
a. To display specific record.
b. To display records in a particular order.
Ans.
1. Where Clause
2. Order by Clause