SQL Training Jan13 - Quiz1

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 Snudurupati
S
Snudurupati
Community Contributor
Quizzes Created: 1 | Total Attempts: 295
| Attempts: 295 | Questions: 21
Please wait...
Question 1 / 21
0 %
0/100
Score 0/100
1. A Primary Key can be NULL.

Explanation

A primary key is a unique identifier for a record in a database table. It cannot be NULL because it is used to ensure the uniqueness of each record. If a primary key were allowed to be NULL, it would defeat the purpose of having a primary key as it would not be able to uniquely identify a record. Therefore, the correct answer is False.

Submit
Please wait...
About This Quiz
SQL Training Jan13 - Quiz1 - Quiz

Test your basic database skills, RDBMS, DDL, DML, Normalization etc.

2. What does SQL stand for?

Explanation

SQL stands for Structured Query Language. It is a programming language that is used for managing and manipulating relational databases. SQL allows users to create, modify, and retrieve data from databases using various commands and statements. It is a standardized language that is widely used in the field of database management systems.

Submit
3. How to select all columns from a table Employee

Explanation

The correct answer is "SELECT * FROM Employee". This is the correct syntax to select all columns from a table named "Employee". The asterisk (*) represents all columns, so when it is combined with the "SELECT" statement and the table name, it retrieves all the columns from that specific table. The other options provided in the question are incorrect syntax and do not follow the standard SQL format for selecting all columns.

Submit
4. Which SQL keyword is used to update data in a table.

Explanation

The correct answer is UPDATE. In SQL, the UPDATE keyword is used to modify or update existing data in a table. It allows you to change the values of one or more columns in a specific row or multiple rows of a table. By using the UPDATE keyword along with the SET clause, you can specify the new values for the columns that need to be updated. This statement is essential for making changes to the data stored in a table without having to delete and reinsert the entire row.

Submit
5. Which SQL keyword is used to insert new data in a table

Explanation

The correct answer is "INSERT INTO". This keyword is used in SQL to insert new data into a table. It is followed by the table name and the values that need to be inserted.

Submit
6. Which SQL statement will select all the rows and columns from the table "Employee" and sort them in descending order by "Salary" column.

Explanation

The given correct answer is "SELECT * FROM Employee ORDER BY Salary DESC". This statement will select all the rows and columns from the table "Employee" and sort them in descending order by the "Salary" column.

Submit
7. A table in 3NF is already in 1NF and 2NF

Explanation

A table in 3NF is already in 1NF and 2NF because 3NF (Third Normal Form) is a higher level of normalization that builds upon the previous normal forms. The first normal form (1NF) ensures that the table has a primary key and no repeating groups, while the second normal form (2NF) eliminates partial dependencies by ensuring that all non-key attributes are fully dependent on the primary key. Therefore, if a table is in 3NF, it has already met the requirements of 1NF and 2NF.

Submit
8. Which of the following SQL statements is correct and has no syntax errors?

Explanation

The correct answer is "INSERT INTO Employee (EmpID,Salary) VALUES (2321,25000.99)". This is the correct syntax for inserting a new record into the Employee table, specifying the columns (EmpID and Salary) and their corresponding values (2321 and 25000.99). The other options have syntax errors or are not valid SQL statements.

Submit
9. Which SQL clause is useful in limiting the number of rows displayed in the results?

Explanation

The WHERE clause is used in SQL to filter rows based on a specific condition. It is commonly used to limit the number of rows displayed in the results by specifying a condition that must be met for a row to be included. This allows for more precise control over the data that is returned, making the WHERE clause the correct answer for limiting the number of rows displayed in the results.

Submit
10. Which SQL keyword is used to extract data from a table

Explanation

The keyword "SELECT" is used in SQL to extract data from a table. It allows you to specify the columns you want to retrieve and any conditions or filters to apply to the data. By using the SELECT keyword, you can retrieve specific data from one or more tables in a database.

Submit
11. Which of the following statements is/are true for a Primary Key Constraint?

Explanation

A primary key constraint is a rule that ensures the uniqueness and integrity of a primary key in a database table. It prevents NULL values from being inserted into the primary key column, which helps maintain data integrity. Additionally, it also prevents the insertion of duplicate rows, ensuring that each row in the table has a unique primary key value. Therefore, the correct answer is option 4, which states that both statement 2 and statement 3 are true for a primary key constraint.

Submit
12. Which of the following is/are true for a Foreign Key Constraint?

Explanation

A Foreign Key Constraint is a rule in a relational database that ensures the integrity of the data by enforcing referential integrity, which means that it maintains the relationship between the parent and child tables. It prevents the deletion of the parent table while the child table still exists, ensuring that the relationship is maintained. Additionally, it prevents the insertion of foreign key values into the child table that do not exist in the parent table, ensuring that only valid data is inserted. Therefore, all of the statements mentioned in the options are true for a Foreign Key Constraint.

Submit
13. ALTER TABLE Persons ALTER COLUMN PersonName VARCHAR(50) What does the above SQL statement achieve ?

Explanation

The given SQL statement "ALTER TABLE Persons ALTER COLUMN PersonName VARCHAR(50)" changes the datatype of the column "PersonName" in the table "Persons" to VARCHAR(50). This means that the column will now store character string values with a maximum length of 50 characters.

Submit
14. ALTER TABLE Persons ALTER COLUMN PersonName VARCHAR(50) The above statement is a

Explanation

The given statement "ALTER TABLE Persons ALTER COLUMN PersonName VARCHAR(50)" is a DDL (Data Definition Language) statement. DDL statements are used to define or modify the structure of database objects such as tables, columns, indexes, etc. In this case, the statement is altering the column "PersonName" in the "Persons" table, changing its data type to VARCHAR with a maximum length of 50 characters.

Submit
15. SELECT EmpID, EmpName FROM Employee WHERE EmpID = 2321 The above SQL statement is a

Explanation

The above SQL statement is a DML (Data Manipulation Language) statement because it is used to retrieve data from the Employee table. It uses the SELECT keyword to specify the columns (EmpID and EmpName) that should be returned. The WHERE clause is used to filter the results based on the condition that the EmpID should be equal to 2321. DML statements are used to manipulate data in a database, such as retrieving, inserting, updating, or deleting records.

Submit
16. A Multidimensional Cube is a type of a relational database

Explanation

A multidimensional cube is not a type of a relational database. It is a data structure used in online analytical processing (OLAP) to organize and analyze data in multiple dimensions. Relational databases, on the other hand, store data in tables with rows and columns and use relationships between tables to query and manipulate data. Therefore, the statement is false.

Submit
17. Which SQL clause is useful in choosing the columns to be displayed in the results?

Explanation

The SELECT clause is used in SQL to choose the columns that will be displayed in the results of a query. It allows the user to specify which columns they want to retrieve from the database. The SELECT clause is essential in determining the specific information that is needed from the database, making it the correct answer to this question.

Submit
18. SQL statement to delete all rows from a table "Employee".

Explanation

The correct answer is TRUNCATE TABLE Employee. This SQL statement is used to delete all rows from a table in the database. It is a faster and more efficient method compared to using the DELETE statement, as it does not generate any log entries for each deleted row. Additionally, it also resets the identity column, if present, to its initial seed value.

Submit
19. The following table is in 1NF

Explanation

The given table is not in 1NF (First Normal Form) because it does not meet the requirement of having atomic values in each cell. The table should be organized in such a way that each attribute has a single value in each cell, and there should be no repeating groups or arrays. Without further information about the table's structure, it cannot be determined if it meets the requirements of higher normal forms.

Submit
20. Which SQL keyword is used to retrieve data from a database?

Explanation

The SELECT statement is used in SQL to retrieve data from a database. It allows you to choose specific columns from a table or all columns, depending on the query. The other options represent different SQL commands: INSERT is used to add new data, UPDATE modifies existing data, and DELETE removes data from a table.

Submit
21. What did you think of the Quiz? (Not graded)

Explanation

This question asks for the respondent's opinion on the quiz. The correct answer is subjective and will vary depending on the individual's experience and perception.

Submit
View My Results

Quiz Review Timeline (Updated): Sep 16, 2024 +

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

  • Current Version
  • Sep 16, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 10, 2013
    Quiz Created by
    Snudurupati
Cancel
  • All
    All (21)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
A Primary Key can be NULL.
What does SQL stand for?
How to select all columns from a table Employee
Which SQL keyword is used to update data in a table.
Which SQL keyword is used to insert new data in a table
Which SQL statement will select all the rows and columns from the...
A table in 3NF is already in 1NF and 2NF
Which of the following SQL statements is correct and has no syntax...
Which SQL clause is useful in limiting the number of rows displayed in...
Which SQL keyword is used to extract data from a table
Which of the following statements is/are true for a Primary Key...
Which of the following is/are true for a Foreign Key Constraint?
ALTER TABLE Persons...
ALTER TABLE Persons...
SELECT EmpID, EmpName...
A Multidimensional Cube is a type of a relational database
Which SQL clause is useful in choosing the columns to be displayed in...
SQL statement to delete all rows from a table "Employee".
The following table is in 1NF
Which SQL keyword is used to retrieve data from a database?
What did you think of the Quiz? (Not graded)
Alert!

Advertisement