Worksheet 01 Dbms
Worksheet 01 Dbms
DBMS
QUESTIONS-1 MARKS (MYSQL)
1. A relation can have only one ________ key and may have more than one _______ keys.
a) Primary, Candidate b) Candidate, Alternate
c) Candidate, Primary d) Alternate, Candidate
2. The vertical subset of a table is known as:
a) Tuple b) Row c) Attribute d) Relation
3. If software is released under open source, it means:
a) It is expensive. b) Its source code is available to the user.
c) It belongs to a company. d) It is a DBMS.
4. Which of the following columns in a Student table can be used as the primary key?
a) Class b) Section c) First_Name d) Admission_No
5. A tuple is also known as a ___________________________ .
a) table b) relation c) row d) field
6. An attribute is also known as a_________________________.
a) table b) relation c) row d) column
7. A field or a combination of fields in a table that has a unique value for each row is called:
a) Candidate key. b) Foreign key. c) Main key. d) Alternate key.
8. Number of rows in a table is called
a) Power b) Degree c) Cardinality d) Design
9. Number of columns in a table is called
a) Power b) Degree c) Cardinality d) Design
10. Which key provide link between two tables
a) Candidate key. b) Foreign key. c) Main key. d) Alternate key.
QUESTIONS-1 MARKS (MYSQL)
Q1. Which statement is used to retrieve data from a table?
A. SELECT B. DISPLAY C. READ D. EXTRACT
Q2. How do you select all the columns from a table named "Employee"?
A. SELECT [all] FROM Employee; B. SELECT Employee;
C. SELECT * BY Employee; D. SELECT * FROM Employee ;
Q3. How do you select a column named "Name" from a table named "Inventory"?
A. SELECT Inventory FROM name; B. DISPLAY name FROM Inventory;
C. SELECT name FROM Inventory; D. SELECT Name, Inventory FROM name;
Q4. Which of the following are invalid column names?
A. Marks_ Eng B. 66_Marks C. MarksEng D. _Eng_Marks
Q5. SELECT statement can be used to perform these functions.
A. Insert rows into a table. B. Choose and display columns from a table.
C. Modify data in a table. D. Select and display structure of a table.
Q6. Which statement is used to add new tuple in a table?
A. ADD RECORD B. INSERT RECORD C. INSERT INTO D. INSERT ROW
Q7. How would you display all those rows from a table named "Trends" where value of
the column "Hobbies" is "marketing" ?
A. SELECT ALL FROM Friends WHERE Hobbies IS 'marketing';
B. SELECT * FROM Friends WHERE Hobbies='marketing';
C. SELECT * FROM Friends WHERE Hobbies = 'marketing" ;
D. SELECT ALL FROM Friends WHERE Hobbies 'marketing' ;
Q8. Which statement is used to modify data in a table?
A. CHANGE B. MODIFY C. UPDATE D. SAVE AS
Q9. Which SQL statement is used to delete data from a table?
A. DELETE B. DROP C. TRUNCATE D. REMOVE
Q10. How do you select all the rows from a table named "Student" where the value of the
column "FName" starts with "S"?
A. SELECT * FROM Student WHERE FName LIKE 'S_' ;
B. SELECT * FROM Student WHERE FName='S';
C. SELECT * FROM Student WHERE FName LIKE 'S%' ;
D. SELECT * WHERE Student WHERE FName='%S%' ;
Q11. Which keyword is used to return only different values in a column?
A. DIFFERENT B. EXCLUSIVE C. DISTINCT D. UNIQUE
Q12. 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
Q13. How would you return all the rows from a table named "Item" sorted in descending
order on the column "IName"?
A. SELECT * FROM Item SORT 'IName' DESC;
B. SELECT * FROM Item ORDER BY IName DESC ;
C. SELECT * FROM Item ORDER IName DESC ;
D. SELECT * FROM Item SORT BY 'IName' DESC;
Q14. How can you insert a new row into the "Store" table?
A. INSERT (1,'Abc Rice') INTO Store; B. INSERT VALUES (1,'Abc Rice')
INTO Store ;
C. NSERT INTO Store VALUES(1,'Abc Rice'); D. ADD ROW Store values(1,'Abc
Rice');
Q15. Which statement is appropriate to change the first name "Madhur" to "Mridul" in
the "FName" column in the 'Student' table?
A. UPDATE Student SET FName='Mridul' WHERE FName='Madhur' ;
B. MODIFY Student SET FName='Madhur' INTO FName='Mridul ;
C. UPDATE Student SET FName='Madhur' INTO FName='Mridul' ;
D. UPDATE Student SET FName='Madhur' WHERE FName='Mridul' ;
Q16. How do you delete the rows with marks below 33 in the 'Student' Table?
A. DELETE FROM Student WHERE marks <=33; B. DELETE marks < 33 FROM Student ;
C. DELETE ROW marks <33; D. DELETE FROM Student WHERE
marks<33;
Q17. The OR operator displays a record if ANY of the conditions listed are true. The AND
operator displays a record if ALL of the conditions listed are true:
A. False B. True C. 0 D. None of These
Q18. SUM, AVG, COUNT are examples of ____________________functions.
(a) Date (b) String (c) Multiple Row (d) Single Row
Q19. MySQL is a /an
A. Relational Database B. Database C. RDBMS D. Table
Q20. USE <database name >command:
A. is not used in MySQL B. is given before quitting MySQL
C. opens a table D. opens a database
Q21. A database:
A. Contains tables B. Is a part of a table
C. Is same as a table D. Removes data from a table
Q22. ORDER BY clause is used to sort data
A. in ascending order B. in descending order
C. both (a) and (b) D. None of the above
Q23. Wild card characters are used
A. In LIKE clause B. In ORDER BY clause
C. In BETWEEN clause D. In IN clause
Q24. DDL is
A. a part of SQL B. a part of DML
C. a part of DCL D. None of these
Q25. LIKE clause is used
A. For pattern matching B. For table matching
C. For inserting similar data in a table D. For deleting data from a table
Q26. Which of the following will give the same answer irrespective of the NULL values in
the specified column:
A. MIN() B. MAX() C. SUM() D. None of the above
Q27. An aggregate function:
A. Takes a column name as its arguments B. May take an expression as its argument
C. Both (a) and (b) D. None of (a) and (b)
Q28. In the FROM clause of a SELECT statement
A. Multiple Column Names are specified. B. Multiple table names are specified.
C. Multiple Column Names may be specified. D. Multiple table names may be specified.
Q29. JOIN in RDBMS refers to
A. Combination of multiple columns B. Combination of multiple rows
C. Combination of multiple tables D. Combination of multiple databases
Q30. Equi-join is formed by equating
A. Foreign key with Primary key B. Each row with all other rows
C. Primary key with Primary key D. Two tables
Q31. A Primary key column
A. Can have NULL values B. Can have duplicate values
C. Both (a) and (b) D. Neither (a) nor (b)
Q32. Natural join is required
A. Only one table B. Two Tables
C. One attribute must be same D. (b) and (c)
Q33. Count(*) method count
A. NULL values only B. Empty Values
B. ALL the values D. None of these
Q34. Which multiple row method will give output except 0 for string data type?
A. AVG() B. COUNT() C. MIN() D. SUM()
Q35. Which command change structure of table?
A. ALTER TABLE B. INSERT INTO C. CHANGE TABLE D. UPDATE
Q36. Which clause will display NULL values in output?
A. NULL B. IS NULL C. IS NOT NULL D. NULL IS
Q37. Which relational operator not used in Equi-Join?
A. > B. < C. = D. Neither (a) nor (b)
Q38. To select all the attributes of the given relation
A. ALL B. * C. DISTINCT D. None of these
Q39. To display list of Tables
A. SHOW DATABASES B. DISPLAY TABLES C. SHOW TABLE
D.SHOW TABLES