RDBMS

1. ________ are designed by database designers to facilitate communications between the database and the software.
A. Database Instances
B. Database Schemas
C. Database Roles
D. Database Structure
2. A ________ in a table represents a relationship among a set of values.
A. Row
B. Key
C. Column
D. Entry
3. A ________ is a query that retrieves rows from more than one table or view
A. Start
B. End
C. Join
D. All of the above
4. A SELECT statement can be used to perform these three functions: -Choose rows from a table. -Choose columns from a table. -Bring together data that is stored in different tables by creating a link between them. Which set of keywords describes these capabilities?
A. difference, projection, join
B. selection, projection, joining
C. selection, intersection, join
D. intersection, projection, join
5. ALTER command is a type of which SQL command?
A. DML (Data Manipulation Language)
B. DDL (Data Definition Language)
C. DCL (Data Control Language)
D. DQL (Data Query Language)
6. ALTER command is a type of which SQL command?
A. DML
B. DDL
C. DCL
D. DQL
7. By default, the result of an order by clause is always displayed in which order?
A. Ascending
B. Descending
C.
D.
8. Can we create a database named 01_test?
A. YES
B. NO
C.
D.
9. Count function in SQL returns the number of
A. values
B. distinct values
C. groups
D. columns
10. Database ________, which is the logical design of the database, and the database ________, which is a snapshot of the data in the database at a given instant in time.
A. Schema, Instance
B. Relation, Domain
C. Instance, Schema
D. Relation, Schema
11. Date when inserted into a database should be of the format?
A. DD-MM-YYYY
B. MM-DD-YYYY
C. DD-MMM'YY
D. YYYY-MM-DD
12. Determine the output of the below query: SELECT sal + NULL FROM emp WHERE empno=7369
A. sal+NULL
B. NULL
C. 0
D. 1250
13. Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79.
A. SELECT * FROM weather WHERE humidity IN (63 TO 79)
B. SELECT * FROM weather WHERE humidity NOT IN (63 TO 79)
C. SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
D. SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 80
14. Find all the tuples having temperature greater than 'Paris'
A. SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = 'Paris')
B. SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = 'Paris')
C. SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = 'Paris')
D. SELECT * FROM weather WHERE temperature > 'Paris' temperature
15. Find the name of those cities with temperature and condition is either sunny or cloudy but temperature must be greater than 70°F
A. SELECT city, temperature, condition FROM weather WHERE condition='sunny' AND condition='cloudy' OR temperature>70
B. SELECT city, temperature, condition FROM weather WHERE condition='sunny' OR condition='cloudy' OR temperature>70
C. SELECT city, temperature, condition FROM weather WHERE (condition='sunny' OR condition='cloudy') AND temperature>70
D. SELECT city, temperature, condition FROM weather WHERE condition='sunny' AND condition='cloudy' AND temperature>73
16. Find the names of the countries whose condition is sunny where country is in location table and city is in weather table.
A. SELECT country FROM location WHERE condition='sunny'
B. SELECT country FROM location WHERE city IN (SELECT city FROM weather WHERE condition='sunny')
C. SELECT country FROM location WHERE city NOT IN (SELECT city FROM weather WHERE condition='sunny')
D. SELECT country FROM location WHERE city UNION (SELECT city FROM weather WHERE condition='sunny')
17. For each attribute of a relation, there is a set of permitted values, called the ________ of that attribute.
A. Schema
B. Domain
C. Set
D. Relation
18. From all the clauses in MYSQL what task is performed by the DISTINCT clause?
A. It returns us the duplicate values
B. It returns us the all values
C. It returns us the unique values
D. It returns us the NULL values
19. How to select all data from student table starting the name from letter 'r'?
A. SELECT * FROM student WHERE name LIKE 'r%'
B. SELECT * FROM student WHERE name LIKE '%r%'
C. SELECT * FROM student WHERE name LIKE '%r'
D. SELECT * FROM student WHERE name LIKE '_r%'
20. If our database name is 'schooldb' and we want to drop this database will the query work if we will write our database name in capital letters?
A. YES
B. NO
C.
D.
21. In an ER Model, what are objects also known as?
A. Entity
B. Relationship
C. Bond
D. Joint
22. In an SQL SELECT statement querying a single table, according to the SQL the asterisk(*) means that:
A. all columns of the table are to be returned
B. all records meeting the full criteria are to be returned
C. all records with even partial criteria met are to be returned
D. None of the above is correct
23. In MYSQL, can you write multiple statements in a single line, separate them with a semicolon?
A. YES
B. NO
C.
D.
24. In which case would you use a FULL OUTER JOIN?
A. Both tables have NULL values
B. You want all unmatched data from one table
C. You want all matched data from both tables
D. You want all unmatched data from both tables
25. In which form MYSQL query results are displayed?
A. LIST
B. TUPLE
C. ROWS AND COLUMNS
D. LIST AND TUPLES BOTH
26. Instance and Schemas are part of the –
A. Data Definition
B. Data Manipulation
C. Data Models
D. Data Redundancy
27. Is a semicolon necessary after every query?
A. true
B. false
C.
D.
28. Minimal Super keys are also called?
A. Foreign Key
B. Primary Key
C. Candidate Key
D. None of above
29. Objects and relationships between ________ are shown through the visual diagrams
A. Tables
B. Rows
C. Columns
D. Databases
30. Predict the output of the below query SELECT 50 || 0001 FROM dual
A. 500001
B. 51
C. 501
D. 5001
31. SELECT student_name, ID FROM student_details WHERE EXISTS (SELECT * FROM attendance WHERE student_details.ID=attendance.ID); This Statement Shows:
A. This will give all the names and IDs of the attendance table.
B. This will give all the names and IDs which are there in the "student_details" table but do not exist in the attendance table.
C. This will give all the names and IDs which are there in the "student_details" table and attendance table also.
D. This will give all the names and IDs of the student_details table.
32. Select the right statement to insert values to the student table
A. INSERT student VALUES(.....)
B. INSERT VALUES(.....)
C. INSERT INTO student VALUES(....)
D. INSERT VALUES INTO student (.....)
33. Specify the column alias NEWSAL for the expression containing salary in the below SQL query: SELECT ename, job, sal + 100 FROM emp;
A. (sal + 100) AS NEWSAL
B. (sal + 100), NEWSAL
C. (sal + 100) IS NEWSAL
D. sal + 100 IS NEWSAL
34. Storing same data in many places is called
A. Iteration
B. Concurrency
C. Redundancy
D. Enumeration
35. Super key and candidate key can have NULL values?
A. true
B. false
C.
D.
36. Suppose you are asked to display all the names which have 'a' as their second character then which query pattern you will use?
A. _ _a%
B. _a_
C. _a%
D. _%a
37. Suppose you have a table named test and inside this table you have a column named CGPA. Now if you are asked to change the column named CGPA to total_percentage using alter command then which of the following statement you will write?
A. ALTER TABLE test CHANGE COLUMN 'cgpa' 'total_percentage' int;
B. ALTER test table CHANGE 'cgpa' 'total_percentage' int;
C. ALTER TABLE test CHANGE 'cgpa' 'total_percentage' int;
D. None of above
38. Suppose you have two columns named student_name and student_department inside table student_details and you are asked to update the value of these two columns where ID=4. What statement will you write?
A. UPDATE student_details SET Student_name="ram", Student_department='Chemical' WHERE ID='4';
B. UPDATE table student_details SET column_name Student_name="ram", Student_department='Chemical' WHERE ID='4';
C. UPDATE student_details SET Student_name="ram" and Student_department='Chemical' WHERE ID='4';
D. UPDATE table student_details SET Student_name="ram", Student_department='Chemical' WHERE column_name ID='4';
39. TCL is used for ________?
A. Manage the changes made by DML statements
B. Defining database schema
C. Control access to data stored in a database
D. None of the above
40. The __________ operation performs a set union of two "similarly structured tables".
A. Product
B. Union
C. Join
D. Intersect
41. The attribute which is the primary key should have its values never?
A. Independent
B. Dependent
C. Changed
D. None of above
42. The command to remove rows from a table 'CUSTOMER' is:
A. DROP FROM CUSTOMER...
B. UPDATE FROM CUSTOMER…
C. REMOVE FROM CUSTOMER…
D. DELETE FROM CUSTOMER WHERE…
43. The FROM SQL clause is used to…
A. specify what table we are selecting or deleting data FROM
B. specify range for search condition
C. specify search condition
D. None of these
44. The HAVING clause does which of the following?
A. Acts EXACTLY like a WHERE clause
B. Acts like a WHERE clause but is used for columns rather than groups
C. Acts like a WHERE clause but is used for groups rather than rows
D. Acts like a WHERE clause but is used for rows rather than columns
45. The referential integrity constraint of a relational database can be specified with the help of?
A. Candidate Key
B. Super Key
C. Primary Key
D. Foreign Key
46. The result of a SQL SELECT statement is a _______.
A. file
B. report
C. table
D. form
47. The SQL ALTER statement can be used to
A. change the table data
B. change the table structure
C. delete rows from the table
D. add rows to the table
48. The SQL keyword(s) ______ is used with wildcards.
A. NOT IN only
B. LIKE only
C. IN only
D. IN and NOT IN
49. The term __________ is used to refer to a row.
A. Tuple
B. Instance
C. Attribute
D. Field
50. The term attribute refers to a ________ of a table.
A. Key
B. Record
C. Tuple
D. Column
51. The value of Primary key
A. can be duplicated
B. can be null
C. can not be null and duplicate
D. none of these
52. The wildcard in a WHERE clause is useful when?
A. An exact match is necessary in a CREATE statement
B. An exact match is necessary in a SELECT statement
C. An exact match is not possible in a SELECT statement
D. An exact match is not possible in a CREATE statement
53. To know your MYSQL version and current date which of the following command you should use?
A. VERSION, CURRENT_DATE();
B. SELECT VERSION, CURRENTDATE();
C. SELECT VERSION(), CURRENT_DATE;
D. SELECT VERSON(), CURRENT_DATE();
54. To see all the databases which command is used?
A. Show database;
B. Show databases;
C. Show database();
D. Show_all database;
55. Using which language can a user request information from a database?
A. Compiler
B. Structural
C. Query
D. Relational
56. What do you mean by HOST in MYSQL?
A. HOST is the user name
B. HOST is the representation of where the MYSQL server is running
C. HOST is the administration's machine name
D. None of above
57. What does the following query find? (SELECT DISTINCT r.sid FROM boats b, reserves r WHERE b.bid=r.bid AND b.color='red') MINUS (SELECT DISTINCT r.sid FROM boats b, reserves r WHERE b.bid=r.bid AND b.color='green')
A. Find the sailor IDs of all sailors who have reserved red boats but not green boats
B. Find the sailor IDs of at least one sailor who have reserved red boats but not green boats
C. Find the sailor IDs of atmost one sailors who have reserved red boats but not green boats
D. None of these
58. What is the full form of SQL?
A. Structured Query Language
B. Structured Query List
C. Simple Query Language
D. None of these
59. What is the function of DESCRIBE statement?
A. This statement helps us to get the details of the entire row
B. This statement helps us to get the definition of a particular table at a time
C. This statement helps us to get the definition of all the tables in a Database
D. This statement helps us to get the definition of all the tables
60. What is the meaning of "GROUP BY" clause in Mysql?
A. Group data by column values
B. Group data by row values
C. Group data by column and row values
D. A column alias immediately follows the column or expression in the SELECT statement
61. What is the name of the query that is placed within a WHERE or HAVING clause of another query?
A. Multi Query
B. Super Query
C. Sub Query
D. None of above
62. What operator tests column for the absence of data?
A. EXISTS
B. NOT
C. IS NULL
D. None of these
63. What SQL command can be used to add columns to a table?
A. ALTER TABLE TableName ADD ColumnName Datatype
B. ALTER TABLE TableName DELETE COLUMN ColumnName Datatype
C. MODIFY TABLE TableName ADD ColumnName Datatype
D. MODIFY TABLE TableName ADD COLUMN ColumnName Datatype
64. What statement explains the Relational Data Model?
A. Within a table, rows and columns are used to arrange the data
B. As data, objects, and relationships among them are represented logically in this model
C. Functions, encapsulation, and object identity are also considered in addition to the ER model
D. These data models facilitate data specifications where different attributes are defined for the same data items of the same type
65. When using the SQL INSERT statement
A. rows cannot be copies in mass from one table to another only
B. rows can be modified according to criteria only
C. rows can either be inserted into table one at a time or in groups
D. rows can either be inserted into table one at a time only
66. Which are the join types in join condition:
A. Cross Join
B. Natural Join
C. Join with USING clause
D. All of the above
67. Which command is used to add data to SQL table?
A. INSERT
B. SELECT
C. DELETE
D. ADD
68. Which command is used to display the structure of a table?
A. LIST
B. SHOW
C. DESCRIBE
D. STRUCTURE
69. Which command is used to SELECT only one copy of each set of duplicate rows?
A. SELECT DISTINCT
B. SELECT UNIQUE
C. SELECT DIFFERENT
D. All of the above
70. Which join is equivalent to Cartesian Product?
A. INNER JOIN
B. OUTER JOIN
C. CROSS JOIN
D. NATURAL JOIN
71. Which key helps us to establish the relationship between two tables?
A. Candidate Key
B. Super Key
C. Primary Key
D. Foreign Key
72. Which key is commonly known as a subset of a super key?
A. Unique Key
B. Foreign Key
C. Primary Key
D. Candidate Key
73. Which level of Abstraction describes what data are stored in the Database?
A. Physical Level
B. View Level
C. Abstraction Level
D. Logical Level
74. Which MySQL function is used to get the current date and time?
A. DATETIME()
B. TODAY()
C. DATE()
D. NOW()
75. Which of the below alphanumeric characters are used to signify concatenation operator in SQL?
A. +
B. ||
C. .
D. ::
76. Which of the below alphanumeric characters are used to signify concatenation operator in SQL?
A. ||
B. |
C. +
D. &
77. Which of the below alphanumeric characters are used to signify concatenation operator in SQL?
A. *
B. ||
C. -
D. ::
78. Which of the below SQL query will display employee names, department, and annual salary?
A. SELECT ename, deptno, sal FROM emp;
B. SELECT ename, deptno, sal + comm FROM emp;
C. SELECT ename, deptno, (sal * 12) Annual_Sal FROM emp;
D. Annual salary cannot be queried since the column doesn't exists in the table
79. Which of the following command is used to delete a database?
A. DELETE DATABASE_NAME
B. DROP DATABASE DATABASE_NAME
C. DROP DATABASE_NAME
D. DELETE DATABASE DATABASE_NAME
80. Which of the following conditions has to be satisfied for INNER JOIN to work?
A. Columns used for joining must have same name
B. Columns used for joining can have same or different name
C. Columns used for joining must have different names
D. rows can either be inserted into table one at a time only
81. Which of the following data type is used when it comes to store images in your database?
A. BIG INT
B. BLOB
C. VARCHAR
D. INT
82. Which of the following is the correct syntax to add a field using alter command?
A. ALTER TABLE table_name ADD field_name data type;
B. ALTER TABLE table_name field_name data type;
C. ALTER TABLE field_name data type;
D. None of above
83. Which of the following is the original purpose of SQL?
A. To define the data structures
B. To specify the syntax and semantics of SQL data definition language
C. To specify the syntax and semantics of SQL manipulation language
D. All of the above
84. Which of the following query finds colors of boats reserved by "Dustin"?
A. SELECT DISTINCT b.color FROM boats b, sailors s where s.name='Dustin' AND s.sid=b.sid
B. SELECT DISTINCT b.color FROM boats b, reserves r, sailors s where s.name='Dustin' AND s.sid=r.sid AND r.sid=b.sid
C. SELECT DISTINCT b.color FROM boats b, reserves r, sailors s where s.name='Dustin' AND s.sid=b.sid
D. SELECT DISTINCT b.color FROM boats b, reserves r, sailors s where s.name='Dustin' AND r.sid=b.sid
85. Which of the following query finds the names of the sailors who have reserved at least one boat?
A. SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
B. SELECT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
C. SELECT DISTINCT s.sname FROM sailors, reserves WHERE s.sid = r.sid;
D. None of these
86. Which of the following SQL query is correct for selecting the name of staffs from 'staffinfo' table where salary is 10000 or 25000?
A. SELECT name FROM staffinfo WHERE salary BETWEEN 10000 AND 25000;
B. SELECT name FROM staffinfo WHERE salary IN (10000, 25000);
C. Both A and B
D. None of the above
87. Which of the following syntax you will use to rename the table name
A. ALTER TABLE table_name RENAME TO new_table_name;
B. RENAME new_table_name;
C. ALTER table_name RENAME new_table_name;
D. ALTER TABLE table_name TO new_table_name;
88. Which SQL command is used for granting or revoking the rights?
A. DML
B. DDL
C. DCL
D. DQL
89. Which type of join combines the result from both the tables and returns us the Cartesian product of the values?
A. Right Join
B. Left Join
C. Inner Join
D. Cross Join
90. You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?
A. SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id);
B. SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);
C. SELECT last_name, department_name FROM employees e FULL OUTER JOIN departments d ON (e.department_id = d.department_id);
D. SELECT last_name, department_name FROM employees e OUTER JOIN departments d ON (e.department_id = d.department_id);
$floatBtn Return to Home