Xi Class MySQL

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Myhemant72
M
Myhemant72
Community Contributor
Quizzes Created: 4 | Total Attempts: 8,628
Questions: 40 | Attempts: 4,614

SettingsSettingsSettings
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 this quiz and find out how vast your knowledge is.


Questions and Answers
  • 1. 

    A database can be best described as a ?

    • A.

      Collection of data

    • B.

      Collection of related tables

    • C.

      Collection of tables

    • D.

      Collection of views

    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.

    Rate this question:

  • 2. 

    A new Database is created by ?

    • A.

      Use database command

    • B.

      Create table command

    • C.

      Create database command

    • D.

      Crete store cammnd

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

    Rate this question:

  • 3. 

    A table can be best described as a ?

    • A.

      Collection of data

    • B.

      Collection of related tables

    • C.

      Collection of tables

    • D.

      Collection of rows and columns

    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.

    Rate this question:

  • 4. 

    A table can be created with out using a database?

    • A.

      True

    • B.

      False

    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.

    Rate this question:

  • 5. 

    A table can have more than 1 primary key?

    • A.

      True

    • B.

      False

    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.

    Rate this question:

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

    Rate this question:

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

    Rate this question:

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

    Rate this question:

  • 9. 

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

    • A.

      True

    • B.

      False

    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.

    Rate this question:

  • 10. 

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

    • A.

      True

    • B.

      False

    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.

    Rate this question:

  • 11. 

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

    • A.

      19

    • B.

      1

    • C.

      2012

    • D.

      '2012-1-19'

    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.

    Rate this question:

  • 12. 

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

    • A.

      19

    • B.

      1

    • C.

      2012

    • D.

      '2012-1-19'

    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.

    Rate this question:

  • 13. 

    If today is '2012-1-19' what will be the output of select month(sysdate());

    • A.

      19

    • B.

      1

    • C.

      2012

    • D.

      '2012-1-19'

    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.

    Rate this question:

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

    Rate this question:

  • 15. 

    MySql is open source technology?

    • A.

      True

    • B.

      False

    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.

    Rate this question:

  • 16. 

    Select ascii('100'); will return?

    • A.

      49

    • B.

      50

    • C.

      51

    • D.

      52

    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.

    Rate this question:

  • 17. 

    Select ascii('citrus'); will return;

    • A.

      98

    • B.

      99

    • C.

      100

    • D.

      101

    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.

    Rate this question:

  • 18. 

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

    • A.

      1

    • B.

      2

    • C.

      3

    • D.

      4

    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.

    Rate this question:

  • 19. 

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

    • A.

      Jac

    • B.

      JAC

    • C.

      Kal

    • D.

      KAL

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

    Rate this question:

  • 20. 

    Which command is used to add delete columns to an existing table?

    • A.

      Desc

    • B.

      Alter table

    • C.

      Drop table

    • D.

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

    Rate this question:

  • 21. 

    Which command is used to add remove tablefrom a database?

    • A.

      Delete

    • B.

      Alter table

    • C.

      Drop table

    • D.

      Create table

    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.

    Rate this question:

  • 22. 

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

    • A.

      Drop

    • B.

      Delete

    • C.

      Remove

    • D.

      Flush

    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.

    Rate this question:

  • 23. 

    Which command shows the rows of the table emp?

    • A.

      Select * from emp;

    • B.

      Show all from emp;

    • C.

      Desc emp;

    • D.

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

    Rate this question:

  • 24. 

    Which command shows the table structure of table emp?

    • A.

      Select * from emp;

    • B.

      Show all from emp;

    • C.

      Desc emp;

    • D.

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

    Rate this question:

  • 25. 

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

    • A.

      Create table

    • B.

      Insert

    • C.

      Update

    • D.

      Delete

    • E.

      Drop table

    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.

    Rate this question:

  • 26. 

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

    • A.

      Create table

    • B.

      Insert

    • C.

      Update

    • D.

      Delete

    • E.

      Drop table

    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.

    Rate this question:

  • 27. 

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

    • A.

      UCase

    • B.

      Lcase

    • C.

      Round

    • D.

      Pow

    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.

    Rate this question:

  • 28. 

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

    • A.

      UCase

    • B.

      Lcase

    • C.

      Round

    • D.

      Pow

    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.

    Rate this question:

  • 29. 

    Which of the following is both Unique and not NULL?

    • A.

      Primary Key

    • B.

      Foreign Key

    • C.

      Not Null Column

    • D.

      Default Column

    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.

    Rate this question:

  • 30. 

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

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    statement should be
    eno is null
    not eno=null;

    Rate this question:

  • 31. 

    A table can contain any number of databases.

    • A.

      True

    • B.

      False

    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.

    Rate this question:

  • 32. 

    A database can contain any number of tables.

    • A.

      True

    • B.

      False

    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.

    Rate this question:

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

    Rate this question:

  • 34. 

    Select round(5.189,0);

    • A.

      5

    • B.

      5.2

    • C.

      5.1

    • D.

      6

    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.

    Rate this question:

  • 35. 

    Select round(5.189,2);

    • A.

      5

    • B.

      5.2

    • C.

      5.19

    • D.

      6

    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.

    Rate this question:

  • 36. 

    Select round(14.189,-1);

    • A.

      20

    • B.

      10

    • C.

      14.5

    • D.

      15

    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.

    Rate this question:

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

    Rate this question:

  • 38. 

    Which two are true regarding MYSql ?

    • A.

      It is a DBMS

    • B.

      IT is a RDBMS

    • C.

      It is open source

    • D.

      It is propritary

    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.

    Rate this question:

  • 39. 

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

    • A.

      Trim

    • B.

      Ascii

    • C.

      Date

    • D.

      Ltrim

    • E.

      Rtrim

    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.

    Rate this question:

  • 40. 

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

    • A.

      True

    • B.

      False

    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.

    Rate this question:

Quiz Review Timeline +

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

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.