Data Base Basic Worksheet
Data Base Basic Worksheet
Q.2
How would you display all those rows from a table named "Empl" where the value of the column "desig" is
"SALESMAN" ?
A. Select all from empl where desig is ' salesman '; B. Select * from empl where desig =' salesman ';
C. Select * from empl where desig = ' salesman " ; D. Select all from empl where desig ' salesman ' ;
Q.3
Which SQL keyword(s) is/are used to sort the rows in the output?
A. Sorted order B. Sort C. Sort by D. Order by
Q.4
Which keyword is used to return only different values in a column?
A. Different B. Exclusive C. Distinct D. Unique
87 | P a g e
True or False
Q.1
DBMS is not used for sharing of data.
Q.2 RDBMS organizes data in the form of a tree.
Q.3 Update is an example of DML command.
Q.4 Sorting in a database can be done by using Group by clause.
Answer the queries given below
Q.1 While creating the table, Mr Ram forgot to add a column ‘marks’ in the table ‘student’. Give the name of a
command to a column in a table ‘student’.
Q.2 Write the command to create the table ‘book’ with the following specification.
Bookno integer,
Bookname varchar(10),
Price decimal(5,2)
Q.3 While entering the salary of the employees in the table ‘EMP’ , Mr. Laxman made a mistake in the salary of
employee no 1122.It should be 1300 instead of 1500.What command should he write to rectify the mistake.
Q.4 Study the given tables and answer the queries given below
Table: HOSPITAL
PNo Name Age Department DateofAdm Charges Sex
a) To list the names of female patients who are either in the orthopedic or surgery department.
b) To list the name of all the patients with their date of admission in ascending order.
c) To count the number of patients with age > 20.
d) To display various departments in the hospital .
e) To display the number of patients in each department.
88 | P a g e
Q.5 Study the given tables and answer the queries given below.
Table: ACTIVITY
Acode ActivityName Stadium ParticipantsNum PrizeMoney ScheduleDate
Table: COACH
a) Display the coach’s name and Acodes in ascending order of Acode from the table COACH.
b) Display the content of Activity table whose ScheduleDate is earlier than 01/01/2004 in ascending order
of ParticipantsNum.
c) Display the names of coaches who are not associated with any activity at all.
89 | P a g e