Xi Class MySQL

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Myhemant72
M
Myhemant72
Community Contributor
Quizzes Created: 4 | Total Attempts: 9,321
| Attempts: 5,120 | Questions: 40
Please wait...
Question 1 / 40
0 %
0/100
Score 0/100
1. If today is '2012-1-19' what will be the output of select month(sysdate());

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.

Submit
Please wait...
About This Quiz
MySQL Quizzes & Trivia

This is a quiz for all the programmers and nerds out there. If you want to test your knowledge on this particular bunch of programming language facts take... see morethis quiz and find out how vast your knowledge is. see less

2. MySql is open source technology?

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.

Submit
3. A database can contain any number of tables.

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.

Submit
4. Which of the following functions are Numerical Functions?( Select Two )

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.

Submit
5. Which command shows the rows of the table 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.

Submit
6. First letter D in DDL stands for?

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.

Submit
7. A table has three rows and 5 columns the degree is?

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.

Submit
8. A new Database is created by ?

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."

Submit
9. A table can be created with out using a database?

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.

Submit
10. Which of the following functions are Character Functions?( Select Two )

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.

Submit
11. Which of the following is both Unique and not NULL?

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.

Submit
12. R in RDBMS stands for?

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.

Submit
13. A table can be best described as a ?

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.

Submit
14. A table can have more than 1 primary key?

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.

Submit
15. If today is '2012-1-19' what will be the output of select dayofyear(sysdate());

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.

Submit
16. Which of the following are DML commands? ( Select three)

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.

Submit
17. Which command is used to add delete columns to an existing 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.

Submit
18. In DML M stands for?

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.

Submit
19. S in MySQL stands for?

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.

Submit
20. If a column which is a primary key is dropped the data and constraint are dropped too.

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.

Submit
21. Which command is used to delete all rows from a table?

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.

Submit
22. Which command is used to add remove tablefrom a database?

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.

Submit
23. Select round(5.189,0);

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.

Submit
24. A table can contain any number of databases.

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.

Submit
25. If the primary key constraint is dropped the column and the data is lost too.

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.

Submit
26. Which of the following functions are related by virtue of their function?(Select Three)

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.

Submit
27. A table has three rows and 5 columns the cardinality is?

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.

Submit
28. If today is '2012-1-19' what will be the output of select year(sysdate());

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.

Submit
29. Which command shows the table structure of table 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.

Submit
30. Which two are true regarding MYSql ?

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.

Submit
31. What will be the output of the following? select right('JACKAL',3);

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'.

Submit
32. A database can be best described as a ?

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.

Submit
33. Which of the following are DDL commands?( Select Two)

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.

Submit
34. The following statement has no syntax error. select * from emp where eno=null;

Explanation

statement should be
eno is null
not eno=null;

Submit
35. Select ascii('citrus'); will return;

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.

Submit
36. Select round(5.189,2);

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.

Submit
37. Select now(), sleep(20),now(); will return same time.

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.

Submit
38. Select ascii('100'); will return?

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.

Submit
39. Select round(14.189,-1);

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.

Submit
40. What will be the output of the following? select instr('JACKAL',"KAL");

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.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 12, 2012
    Quiz Created by
    Myhemant72
Cancel
  • All
    All (40)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
If today is '2012-1-19'...
MySql is open source technology?
A database can contain any number of tables.
Which of the following functions are Numerical Functions?( Select Two...
Which command shows the rows of the table emp?
First letter D in DDL stands for?
A table has three rows and 5 columns the degree is?
A new Database is created by ?
A table can be created with out using a database?
Which of the following functions are Character Functions?( Select Two...
Which of the following is both Unique and not NULL?
R in RDBMS stands for?
A table can be best described as a ?
A table can have more than 1 primary key?
If today is '2012-1-19'...
Which of the following are DML commands? ( Select three)
Which command is used to add delete columns to an existing table?
In DML M stands for?
S in MySQL stands for?
If a column which is a primary key is dropped the data and constraint...
Which command is used to delete all rows from a table?
Which command is used to add remove tablefrom a database?
Select round(5.189,0);
A table can contain any number of databases.
If the primary key constraint is dropped the column and the data is...
Which of the following functions are related by virtue of their...
A table has three rows and 5 columns the cardinality is?
If today is '2012-1-19'...
Which command shows the table structure of table emp?
Which two are true regarding MYSql ?
What will be the output of the following?...
A database can be best described as a ?
Which of the following are DDL commands?( Select Two)
The following statement has no syntax error....
Select ascii('citrus'); will return;
Select round(5.189,2);
Select now(), sleep(20),now(); will return same time.
Select ascii('100'); will return?
Select round(14.189,-1);
What will be the output of the following?...
Alert!

Advertisement