Dbms Questions Addon
Dbms Questions Addon
Dbms Questions Addon
Ans: There are following differences between file system and DBMS:
File System Database Management System (DBMS)
2. File system does not support multi- 2. Database Management System supports
user access. multi-user access.
3. Data consistency is less in the file 3. Data consistency is more due to the use
system. of normalization.
5. File system is used for storing the 5. Database management system is used
unstructured data. for storing the structured data.
9. Cost of a file system is less than the 9. Cost of database management system is
DBMS. more than the file system.
10. If one application fails, it does not 10. If the database fails, it affects all
affect other application in a system. application which depends on it.
12. These system does not provide 12. This system provides concurrency
concurrency facility. facility.
Schema:
Schema is such that describes the structural read of a information that confirms the
tables that will be concerned in making a information, the table’s attributes and their
association.
Ans: Database users are categorized based up on their interaction with the data base.
These are seven types of data base users in DBMS.
1. Database Administrator (DBA) :
Database Administrator (DBA) is a person/team who defines the schema and also
controls the 3 levels of database.
The DBA will then create a new account id and password for the user if he/she need
to access the data base.
DBA is also responsible for providing security to the data base and he allows only
the authorized users to access/modify the data base.
DBA also monitors the recovery and back up and provide technical
support.
The DBA has a DBA account in the DBMS which called a system or
superuser account.
DBA repairs damage caused due to hardware and/or software failures.
2. Naive / Parametric End Users :
Parametric End Users are the unsophisticated who don’t have any DBMS
knowledge but they frequently use the data base applications in their daily life to
get the desired results.
For examples, Railway’s ticket booking users are naive users. Clerks in any bank is
a naive user because they don’t have any DBMS knowledge but they still use the
database and perform their given task.
3. System Analyst :
System Analyst is a user who analyzes the requirements of parametric end
users. They check whether all the requirements of end users are satisfied.
4. Sophisticated Users :
Sophisticated users can be engineers, scientists, business analyst, who are
familiar with the database. They can develop their own data base applications
according to their requirement. They don’t write the program code but they
interact the data base by writing SQL queries directly through the query
processor.
Ques9: There is a table where only one row is fully repeated. Write a Query to find
the Repeated row
Name Section
abc CS1
bcd CS2
abc CS1
In the above table, we can find duplicate row using below query.
Ans: In the above table, we can find duplicate row using below query
Name Section
abc CS1
bcd CS2
abc CS1
.
Ques10: Consider the following Employee table. How many rows are there in the
result of following query?
ID salary DeptName
1 10000 EC
2 40000 EC
3 30000 CS
4 40000 ME
5 50000 ME
6 60000 ME
7 70000 CS
How many rows are there in the result of following query?
Ans: The difference between the having and where clause in SQL is that the where
clause canNOT be used with aggregates, but the having clause can. Please note : It is
not a predefined rule but by and large you’ll see that in a good number of the SQL
queries, we use WHERE prior to GROUP BY and HAVING after GROUP BY.
The Where clause acts as a pre filter where as Having as a post filter.
The where clause works on row’s data, not on aggregated data.
Let us consider below table ‘Marks’.
Student Course Score
a c1 40
a c2 50
b c3 60
d c1 70
e c2 80
Consider the query
Ans:
CHAR and VARCHAR are both ASCII character data types and almost same but they
are different at the stage of storing and retrieving the data from the database. Following
are some important differences between CHAR and VARCHAR in SQL −
It stores values in fixed lengths and are VARCHAR stores values in variable length
padded with space characters to match along with 1-byte or 2-byte length prefix
the specified length and are not padded with any characters