Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(1 Mark)
Ans: Both will return same output.
Count () will return the no of rows of one column based on the conditions given using the
column given.
Eg. Select count (eid) from employee & Select count ( * ) from employee
Will return same output.
2.What is the basic difference between Foreign Key & Unique Key? (1 Mark).
Ans :
Foreign key : When we use primary key of 1 table in another table then we call that key as
Foreign key.
Unique key is a key or column in any table which contains unique values.
ie. Values in that column cannot be repeated.
4.State difference between DELETE & DROP command with example. (2 Marks)
Ans :
DROP TABLE command deletes a table along with all its data, associated views and indexes.
After this command has been issued, there is no turning back. The most common
use of the DROP TABLE statement is when you have created a table for temporary use.
Syntax : DROP TABLE employee ;
Delete : This command deletes data (row/s) from table. However table still remains there.
You can rollback the changes id those are not saved (not committed).
Syntax : DELETE FROM employee WHERE eID = 4;
1. How the left outer join is different from right outer join? (1 Mark)
Ans: Outer joins are usually come into significance when one of the table is deficient in data.
We use left outer join when the table in right is deficient in data and right outer join when the
left table is deficient in data.
3. What is the basic difference between Primary Key & Unique Key? (1 Mark)
a. Primary key: Unique & Null Not Allowed.
b. Unique Key : 1 Null is allowed
b. Self join
- When we join one table to itself then we call it as self join
- Eg. Select e1. name, e2.mgr_id from employee e1, employee e2
Where e1.eid = e2.eid.
c. Equi join
- When join is based on the conditions of equality then we call it Equi -join.
- Eg. Select e.Ename, d.Dname from employee e, dept d Where e.did = d.did.
d. Non euqi join
e. Outer join ( Left Outer, Right Outer)
f. Inner Join, etc.
5. What is RDBMS
- Relational Database management system, it is a type of DBMS based on
Relational database concepts.