DBMS
DBMS
2. What is MySQL
Ans: MySQL is an open Source Relational Database Mangement System(RDBMS) that uses structured Query
Language(SQL) for adding, accessing and managing content in a database. It is an open source RDBMS software.
It is available free of cost.
6. Differentiate between the Primary key and Alternate key of a table with the help of an example
[ Compt 13]
OR
Q What is an Alternate Key?[ D 06]
Ans:A primary key is a column (or columns) in a table that uniquely identifies the rows in that table.
The values placed in primary key columns must be unique for each row: no duplicates can be tolerated. In
addition, nulls are not allowed in primary key columns.
EMP table
empno Phone Name
1 9810189864 Rajan
2 8764321056 Aman
3 9899234221 Rajesh
4 9089422451 Aman
Here in Emp table you can choose either Empno or phone columns as primary key, Empno is preferable choice.
Candidate column other the Primary column is called alternate key, like if Empno is PK then Phone would be
the Alternate key.
7. What are candidate keys in a table? Give a suitable example of candidate keys in a table. [D 09,SP 21]
Ans : A column or a group of columns which can be serve as the primary key of relation is called a candidate
key.
for ex; EMP table
empno Phone Name
1 9810189864 Rajan
2 8764321056 Aman
3 9899234221 Rajesh
4 9089422451 Aman
Here in Emp table you can choose either Empno or phone columns as primary key, So empno and phone would
be the candidate keys.
8. Differentiate between Primary key and Candidate key. [SP 2019-20]
Ans. A Candidate Key can be any column or a combination of columns that can qualify as unique key in
database. There can be multiple Candidate Keys in one table where as a Primary Key is a column or a
combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.
9. Observe the following tables carefully and answer the questions that follow: 2[2019]
TABLE:FARMER
FNO NAME
101 Ramya Sarkar
102 Ram Dhyan
103 Gagan Hari
104 Ram Dhyan
Which attribute out of the two attributes FNO and NAME in table FARMER should be considered as Primary
Key? Give reason for your selection of the same.
Ans Primary Key: FNO
Reason: Unique values for identification of each tuple/record
10 Observe the following table carefully and write the names of the most appropriate columns, which can be
considered as (i) candidate keys and (ii) primary key. [2015 D]
11 Observe the following table carefully and write the names of the most appropriate columns, which can be
considered as [2015 OD]
(i) candidate keys and (ii) primary key.
12. Differentiate between DDL & DMLcommands. Identify DDL & DML commands from the following:-
(UPDATE, SELECT, ALTER, DROP) [SP 18]
Ans DDL stands for Data Definition language and comprises of commands which will change the structure of
database object. DML stands for Data Manipulation Language and comprises of commands which are used to
insert, edit, view & delete the data stored in a database object.
DDL Commands: ALTER, DROP DML Commands: UPDATE, SELECT
13. Write the full forms of DDL and DML. Write any two commands of DML in SQL [comptt 2020]
Ans :DDL – Data Definition Language
DML – Data Manipulation Language
Any two out of INSERT, DELETE, UPDATE
14 What is the difference between degree and cardinality of a table ? What is the degree and cardinality of the
following table ? [D 13]
Table: Department
DNO DNAME
D1 ACCOUNTS
D2 HR
D3 ADMIN
What is the Degree of table EMPLOYEE? What is the cardinality of table Department?
17. Consider the table, MOVIEDETAILS given below: [SP 2021-22 Term2]
Table: MOVIEDETAILS
MOVIEID TITLE LANGUAGE RATING PLATFORM
M001 Minari Korean 5 Netflix
M004 MGR Magan Tamil 4 Hotstar
M010 Kaagaz Hindi 3 Zee5
M011 Harry Potter and the Chamber of Secrets English 4 Prime Video
M015 Uri Hindi 5 Zee5
M020 Avengers: Endgame English 4 Hotstar
(a) Identify the degree and cardinality of the table.
(b) Which field should be made the primary key? Justify your answer.
(c) Identify the candidate key(s) from the table MOVIEDETAILS.
(d) Consider the table SCHEDULE given below:
Table: SCHEDULE
SLOTID MOVIEID TIMESLOT
S001 M010 10 AM to 12 PM
S002 M020 2 PM to 5 PM
S003 M010 6 PM to 8 PM
S004 M011 9 PM to 11 PM
Which field will be considered as the foreign key if the tables MOVIEDETAILS and SCHEDULE are related in
a database?
18. Categorize following commands into DDL and DML commands? [SP 2021-22 Term2]
INSERT INTO, DROP TABLE, ALTER TABLE, UPDATE...SET
19.Observe the following table and answer the parts (i) and (ii): [2014 compt]
Table : STORE
ITEM CODE ITEM QTY. RATE
10 Get pen classic 1150 25
11 Sharpener 1500 10
12 Ball pen 0.5 1600 12
13 Eraser 1600 5
14 Ball pen 0.25 800 20
(i) In the above table , can we have qty as primary key. Justify your answer.
(ii) What is the cardinality and degree of the above table?
20. Observe the following table STOCK carefully and answer the questions that follow : 2[comptt 2019]
Table : STOCK
SNO NAME PRICE
101 PEN 50
102 PENCIL 5
103 PENCIL 10
104 NOTEBOOK 50
105 ERASER 5
Which attribute out of SNO, NAME and PRICE is the ideal one for being considered as the Primary Key and
why ?
21.Which of the following clauses in SQL is most appropriate to use to select matching tuples in a specific
range of values ? 1[comptt 21]
(A) IN (B) LIKE (C) BETWEEN (D) IS
24. Which of the following commands in SQL is used to add a new record into a table ? 1
(A) ADD (B) INSERT (C) UPDATE (D) NEW
25. Which of the following is the correct expansion of DML in context of SQL ? 1
(A) Direct Machine Language (B) Data Mixing Language
(C) Distributed Machine Language (D) Data Manipulation Language
26.What are Tuples in a SQL Table ? Write a suitable example with a SQL Table to illustrate your answer.
[comptt 21]
27.Write the names of any two constraints and their respective uses in SQL. 2[comptt 21]
28. Observe the following table FOOD carefully and answer the questions that follow : 2[Comptt 21]
TABLE:FOOD
AVGPRICE FNAME FNO ORIGIN
75 DOSA F01 SOUTH INDIA
100 BURGER F03 AMERICAN
45 VADA PAV F04 MAHARASHTRA
70 CHOW MEIN F09 CHINA
70 CHOLE BHATURE F15 PUNJAB
80 SARSON KA SAAG F12 RAJASTHAN
25 MAKKI KI ROTI F 11 RAJASTHAN
(i) What is the Degree and Cardinality of table FOOD ?
(ii) Which attribute out of AVGPRICE, FNAME, FNO and ORIGIN of table FOOD is the ideal one for being
considered as the Primary Key and why ?