1.
A database can be best described as a ?
Correct Answer
B. Collection of related tables
Explanation
A database can be best described as a collection of related tables because a database is a structured collection of data that is organized and stored in tables. These tables are related to each other through relationships and can be accessed and manipulated using database management systems. By organizing data into tables and establishing relationships between them, a database provides an efficient and organized way to store, manage, and retrieve large amounts of data.
2.
A new Database is created by ?
Correct Answer
C. Create database command
Explanation
A new database is created by using the "create database" command. This command is specifically designed to create a new database in a database management system. The other options mentioned, such as "use database command," "create table command," and "create store command," do not have the functionality to create a new database. Therefore, the correct answer is the "create database command."
3.
A table can be best described as a ?
Correct Answer
D. Collection of rows and columns
Explanation
A table can be best described as a collection of rows and columns because it is a structured way to organize and display data. Rows represent individual records or instances, while columns represent different attributes or variables. This format allows for easy retrieval and manipulation of data, making it a fundamental component in databases and spreadsheets.
4.
A table can be created with out using a database?
Correct Answer
B. False
Explanation
False. A table cannot be created without using a database. A table is a collection of data organized in rows and columns, and it requires a database to store and manage the data. Without a database, there is no infrastructure to support the creation and management of tables.
5.
A table can have more than 1 primary key?
Correct Answer
B. False
Explanation
A primary key is a unique identifier for each row in a table. It ensures that each row has a unique value for the primary key column. Therefore, by definition, a table can only have one primary key. Having multiple primary keys would violate the uniqueness constraint and defeat the purpose of a primary key.
6.
A table has three rows and 5 columns the cardinality is?
Correct Answer
3
Explanation
The cardinality refers to the number of elements or values in a set. In this case, the table has three rows and five columns. The cardinality is the number of rows, which is 3.
7.
A table has three rows and 5 columns the degree is?
Correct Answer
5
Explanation
The degree of a table refers to the number of columns it has. In this case, the table has 5 columns, so the degree is 5.
8.
First letter D in DDL stands for?
Correct Answer
data
Data
DATA
Explanation
The correct answer is "data, Data, DATA" because in computer science, DDL stands for Data Definition Language. It is a set of commands used to define and manage the structure of a database. The first letter "D" in DDL refers to "data" and can be written in lowercase or uppercase, hence all three options are correct.
9.
If a column which is a primary key is dropped the data and constraint are dropped too.
Correct Answer
A. True
Explanation
If a column is designated as a primary key in a database table and it is dropped, it means that the unique identifier for each record in that table is also being removed. As a result, not only will the data in that column be lost, but any constraints or rules associated with the primary key will also be dropped. This includes any references or dependencies on that primary key from other tables or entities in the database. Therefore, the statement that if a primary key column is dropped, the data and constraints are dropped too is true.
10.
If the primary key constraint is dropped the column and the data is lost too.
Correct Answer
B. False
Explanation
If the primary key constraint is dropped, the constraint itself is removed but the column and its data are not lost. The primary key constraint ensures that each value in the column is unique and not null, but dropping the constraint does not delete the actual data in the column. Therefore, the statement that the column and data are lost when the primary key constraint is dropped is false.
11.
If today is '2012-1-19'
what will be the output of
select year(sysdate());
Correct Answer
C. 2012
Explanation
The given query "select year(sysdate())" is used to extract the year from the current date. In this case, the current date is '2012-1-19', so the output of the query will be the year component of this date, which is 2012.
12.
If today is '2012-1-19'
what will be the output of
select dayofyear(sysdate());
Correct Answer
A. 19
Explanation
The query "select dayofyear(sysdate());" is asking for the day of the year for the current date. Since the current date is '2012-1-19', the day of the year will be 19.
13.
If today is '2012-1-19'
what will be the output of
select month(sysdate());
Correct Answer
B. 1
Explanation
The query "select month(sysdate());" will return the month value of the current date. In this case, the current date is '2012-1-19' and the month value is 1.
14.
In DML M stands for?
Correct Answer
manipulation
Manipulation
MANIPULATION
Explanation
The correct answer is "manipulation". In the context of DML, the "M" stands for manipulation. DML stands for Data Manipulation Language, which is a subset of SQL used to manipulate and retrieve data in a database. This includes operations such as inserting, updating, and deleting data. The answer options "manipulation", "Manipulation", and "MANIPULATION" all represent the same correct answer.
15.
MySql is open source technology?
Correct Answer
A. True
Explanation
MySql is indeed an open-source technology. It is a widely used relational database management system that is available for free under the GNU General Public License. Being open source means that the source code of MySql is freely available to the public, allowing users to modify and distribute it according to their needs. This openness encourages collaboration, innovation, and community-driven development, making MySql a popular choice for many developers and organizations.
16.
Select ascii('100');
will return?
Correct Answer
A. 49
Explanation
The function "ascii" in SQL returns the ASCII value of the given character. In this case, the character '100' is passed as a parameter to the function. However, only the first character of the string is considered. The ASCII value of '1' is 49, so that is the value that will be returned.
17.
Select ascii('citrus');
will return;
Correct Answer
B. 99
Explanation
The given SQL query uses the ASCII function to convert the character 'citrus' into its corresponding ASCII value. The ASCII value for the character 'c' is 99.
18.
What will be the output of the following?
select instr('JACKAL',"KAL");
Correct Answer
D. 4
Explanation
The function instr() is used to find the position of a substring within a string. In this case, it is searching for the substring "KAL" within the string "JACKAL". Since "KAL" is found starting at position 4 within the string "JACKAL", the output will be 4.
19.
What will be the output of the following?
select right('JACKAL',3);
Correct Answer
D. KAL
Explanation
The given SQL query uses the RIGHT() function to extract the rightmost 3 characters from the string 'JACKAL'. The rightmost 3 characters are 'KAL', so the output of the query will be 'KAL'.
20.
Which command is used to add delete columns to an existing table?
Correct Answer
B. Alter table
Explanation
The "alter table" command is used to make changes to an existing table in a database. This command allows you to add, delete, or modify columns in the table. Therefore, to add or delete columns to an existing table, the "alter table" command is used.
21.
Which command is used to add remove tablefrom a database?
Correct Answer
C. Drop table
Explanation
The correct answer is "drop table." This command is used to remove a table from a database. It permanently deletes the table and all of its data from the database.
22.
Which command is used to delete all rows from a table?
Correct Answer
B. Delete
Explanation
The correct answer is "delete". The delete command is used to remove all rows from a table. It allows you to delete specific rows based on certain conditions or delete all rows if no conditions are specified. The drop command is used to delete an entire table, not just the rows within it. The remove and flush commands are not valid commands for deleting rows from a table.
23.
Which command shows the rows of the table emp?
Correct Answer
A. Select * from emp;
Explanation
The correct answer is "select * from emp;". This command is used to retrieve all the rows from the table "emp". The "*" symbol is a wildcard that represents all columns in the table. By executing this command, the user can view the complete data present in the "emp" table.
24.
Which command shows the table structure of table emp?
Correct Answer
C. Desc emp;
Explanation
The command "desc emp;" is used to display the table structure of the table "emp". It provides information about the columns in the table, including the name, data type, and any constraints or indexes applied to them. This command is commonly used in database systems to retrieve metadata about tables.
25.
Which of the following are DDL commands?( Select Two)
Correct Answer(s)
A. Create table
E. Drop table
Explanation
The correct answer is "create table" and "drop table" because these are both Data Definition Language (DDL) commands. DDL commands are used to define and manage the structure of a database, including creating and dropping tables. The other options listed, such as "insert," "update," and "delete," are Data Manipulation Language (DML) commands, which are used to manipulate the data within the tables rather than the structure of the tables themselves.
26.
Which of the following are DML commands? ( Select three)
Correct Answer(s)
B. Insert
C. Update
D. Delete
Explanation
The correct answer is insert, update, and delete. These three commands are classified as Data Manipulation Language (DML) commands in SQL. The "insert" command is used to add new rows of data into a table, the "update" command is used to modify existing data in a table, and the "delete" command is used to remove specific rows of data from a table. The other options, "create table" and "drop table," are classified as Data Definition Language (DDL) commands, which are used to create and delete tables respectively.
27.
Which of the following functions are Character Functions?( Select Two )
Correct Answer(s)
A. UCase
B. Lcase
Explanation
UCase and Lcase are both character functions. UCase converts all the characters in a string to uppercase, while Lcase converts all the characters in a string to lowercase. These functions are used to manipulate and change the case of the characters in a string. Round and Pow, on the other hand, are not character functions. Round is used to round a number to a specified number of decimal places, while Pow is used to calculate the power of a number.
28.
Which of the following functions are Numerical Functions?( Select Two )
Correct Answer(s)
C. Round
D. Pow
Explanation
The functions "Round" and "Pow" are considered numerical functions because they operate on numerical values and perform calculations based on them. "Round" is used to round a number to a specified number of decimal places, while "Pow" is used to raise a number to a specified power. Both functions are commonly used in mathematical calculations and data analysis.
29.
Which of the following is both Unique and not NULL?
Correct Answer
A. Primary Key
Explanation
A primary key is a column or a set of columns that uniquely identifies each row in a table. It cannot have duplicate values and cannot be NULL. Therefore, it is both unique and not NULL. A foreign key is a column or a set of columns in one table that refers to the primary key in another table. A not null column is a column that must have a value and cannot be NULL, but it may not necessarily be unique. A default column is a column that is assigned a default value if no value is specified when inserting a new row, but it may not necessarily be unique or not NULL.
30.
The following statement has no syntax error.
select * from emp where eno=null;
Correct Answer
B. False
Explanation
statement should be
eno is null
not eno=null;
31.
A table can contain any number of databases.
Correct Answer
B. False
Explanation
A table cannot contain any number of databases. A table is a database object that stores data in rows and columns. It is a part of a single database and cannot hold multiple databases within it. Therefore, the statement is false.
32.
A database can contain any number of tables.
Correct Answer
A. True
Explanation
A database is a structured collection of data organized and stored in tables. Tables are used to store and organize related data. Therefore, a database can indeed contain any number of tables depending on the complexity and requirements of the data being stored.
33.
R in RDBMS stands for?
Correct Answer
Relational
RELATIONAL
relational
Explanation
The correct answer is "Relational". R in RDBMS stands for Relational, which refers to the concept of organizing data into tables with relationships between them. This allows for efficient storage, retrieval, and manipulation of data using relational algebra operations. The use of relationships in a relational database management system (RDBMS) helps to ensure data integrity and consistency.
34.
Select round(5.189,0);
Correct Answer
A. 5
Explanation
The round() function is used to round a number to a specified number of decimal places. In this case, the number 5.189 is rounded to 0 decimal places. Since the decimal part of the number is less than 0.5, the function rounds down to the nearest whole number, which is 5. Therefore, the correct answer is 5.
35.
Select round(5.189,2);
Correct Answer
C. 5.19
Explanation
The given SQL query is using the ROUND function to round the number 5.189 to 2 decimal places. The correct answer is 5.19 because when rounding a number, if the digit immediately to the right of the desired decimal place is 5 or greater, the digit at the desired decimal place is increased by 1. In this case, the digit at the second decimal place is 8, which is greater than 5, so the digit at the first decimal place (9) is increased by 1 to become 10. However, since we want to round to 2 decimal places, the extra digit (0) is dropped, resulting in 5.19.
36.
Select round(14.189,-1);
Correct Answer
B. 10
Explanation
The round() function is used to round a number to a specified number of decimal places. In this case, the number 14.189 is rounded to the nearest 10th place, which is 10.
37.
S in MySQL stands for?
Correct Answer
structured
STRUCTURED
Structured
Explanation
The correct answer for this question is "structured". MySQL is a relational database management system (RDBMS) that is used to manage structured data. It organizes data in tables with predefined columns and rows, allowing for efficient storage, retrieval, and manipulation of data. The "S" in MySQL stands for "Structured" because it is designed to handle structured data in a structured manner.
38.
Which two are true regarding MYSql ?
Correct Answer(s)
B. IT is a RDBMS
C. It is open source
Explanation
MySQL is a popular relational database management system (RDBMS) that is widely used for managing and organizing large amounts of data. It is known for its performance, scalability, and ease of use. Additionally, MySQL is an open-source software, which means that it is freely available for use and can be modified and distributed by anyone. Therefore, both statements "It is a RDBMS" and "It is open source" are true regarding MySQL.
39.
Which of the following functions are related by virtue of their function?(Select Three)
Correct Answer(s)
A. Trim
D. Ltrim
E. Rtrim
Explanation
The functions trim, ltrim, and rtrim are related by virtue of their function as they all involve manipulating strings. trim removes any leading or trailing whitespace from a string, ltrim removes leading whitespace, and rtrim removes trailing whitespace. These functions are commonly used in programming and database operations to clean up and format strings. The other functions listed, ascii and date, do not perform similar string manipulation tasks and therefore are not related to trim, ltrim, and rtrim.
40.
Select now(), sleep(20),now();
will return same time.
Correct Answer
A. True
Explanation
The statement "select now(), sleep(20), now();" will return the same time because the NOW() function is called before and after the SLEEP(20) function. The SLEEP(20) function pauses the execution of the query for 20 seconds, but it does not affect the value returned by the NOW() function. Therefore, the overall result will be the same time before and after the sleep period.