TN Board 12th Computer Science Important Questions Chapter 12 Structured Query Language (SQL)

TN State Board 12th Computer Science Important Questions Chapter 12 Structured Query Language (SQL)

Question 1.
What is known as CRUD?
Answer:
RDBMS is a type of DBMS \yith a row based table structure that connects related data elements and includes functions related to create, Read, update and Delete operations, collectivity known as CRUD.

Question 2.
What is a Table?
Answer:

  1. A Table is a collection of related data entries and it consists of rows and columns.
  2.  The data in RDBMS is stored in database objects called tables.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 3.
What is a Record?
Answer:

  1. A Record is a row, which is a collection of related fields or columns that exist in Table.
  2. A record is a horizontal entity in a table which represents the details of a particular student in a student table.

Question 4.
What is data definition language?
Answer:

  1. The Data definition language (DDL) consists of SQL statements used to define the database structure or schema.
  2. The DDL provides a set of definitions to specify the storage structure and access method used by the database system.

Question 5.
What is Data Manipulation Language?
Answer:
A data manipulation language (DML) is a computer programming language used for adding, removing and modifying data in a database.

Question 6.
What are types of DML?
Answer:
The DML basically of two types

  • Procedural DML – Requires a user to specify what data is needed and how to get it.
  • Non – procedural DML – Requires a user to specify what data is needed without specifying how to get it.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 7.
What are SQL commands which comes under Data Definition Language?
Answer:

  1. Create
  2. Alter
  3. Drop
  4. Truncate

Question 8.
What are SQL commands which comes under Data Manipulation Language?
Answer:

  1. Insert
  2. Update
  3. Delete

Question 9.
What are the SQL commands which comes under Data Control Language?
Answer:

  • Grant – Grant permission to one or more users to perform specific tasks.
  • Revoke – Withdraws the access permission given by the GRANT statement.

Question 10.
What are SQL commands which comes under Control Language?
Answer:

  1. Commit
  2. Rollback
  3. Save point

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 11.
Write a update command, the age to 17 for those student whose place is MADURAI using SET keyword.
Answer:
UPDATE student SET Age = 17 WHERE Place = “MADURAI”;

Question 12.
What is difference between DROP and DELETE commands?
Answer:

  1. DROP command is to remove entire Table in a database. Once a table is dropped we cannot get it back.
  2. DELETE command deletes only the rows from the table based on the condition.

Question 13.
What is difference for DISTINCT and ALL keywords?
Answer:

  1. DISTINCT keyword to eliminate duplicate rows in the table. This helps to eliminate redundant data.
  2. ALL keyword retains duplicate rows.

Question 14.
Write syntax ORDER BY clause?
Answer:
SELECT <column Name> [, <column- Name>,…] FROM <table~name> ORDER BY <columnl>, <column2>,… ASC/DESC;
Eg: SELECT*FROM Student ORDER BY Name ASC:

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 15.
What is HAVING clause?
Answer:
The HAVING clause can be used along with GROUP BY clause in the SELECT Statement to place condition on groups and can include aggregate functions on them.

Question 16.
What is use of COMMIT command?
Answer:

  1. The COMMIT command is used to permanently save any transaction to the database.
  2. When any DML commands INSERT, UPDATE, DELETE commands are used, the changes made by using COMMIT command.

Question 17.
What is difference between DISTINCT keyword and ALL keyword?
Answer:

  1. The DISTINCT keyword is used along with the SELECT command to eliminate duplicate rows in the table.
  2. The All Keyword retains duplicate rows.
  3. It will display every row of the table without considering duplicate entries.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 18.
Write the difference between BETWEEN and NON-BETWEEN keywords.
Answer:

  1. The BETWEEN keyword defines a range the record must fall into to make the condition true.
  2. The NOT BETWEEN is reverse of the BETWEEN operator where the records not satisfying the condition are displayed.

Question 19.
Write the difference between In and NOT IN keyword.
Answer:

  1. The IN keyword is used to specify a list of values which must be matched with the record values. It is similar to OR condition.
  2. The NOT IN keyword displays only those records that do not match in the list.

Question 20.
What is the use of check constraint?
Answer:
The check constraint may use relational and logical operations for condition.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 21.
What is the use of ORDER BY clause?
Answer:
The ORDER BY clause in SQL is used to sort the data in either ascending or descending based on one or more columns.

Question 22.
What is the use of GROUP BY clause?
Answer:
The GROUP BY clause is used with the SELECT statement to group the students on rows or columns having identical values or divide the table in to groups.

Question 23.
What is the use of HAVING clause?
Answer:
The E1AVING clause can be used along with GROUP BY clause in the SELECT statement to place condition on groups and can include aggregate function on them.

Question 24.
What is the use of COMMIT command?
Answer:
The COMMIT command is used to permanently save any transaction to the database.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 25.
What is the use of ROLLBACK command?
Answer:
The ROLLBACK command is used to restores the database to the last committed state.

Question 26.
What is the use of SAVEPOINT command?
Answer:
The SAVEPOINT command is used to temporarily save a transaction.

Question 27.
How can you create a database?
Answer:
(i) To create a database
CREATE DATABASE database name;
Eg:
CREATE DATABASE student;

(ii) To work with the database
USE DATABASE;
Eg:
USE student;

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 28.
What is WAMP?
Answer:
(i) WAMP stands for “windows, Apache, MySQL and PHP”.
(ii) WAMP is a variation of LAMP for windows system and is installed as a software bundle (Apache, MySQL and PHP).
(iii) It is often used for web development and internal testing, but may also be used to serve live websites.

Question 29.
Write the function of DDL commends.
Answer:
A DDL performs the following functions:

  1. It should identify the type of data division such as data item, segment, record and database file.
  2. It gives a unique name to each data item type, record type, file type and data base.
  3. It should specify the proper data type.
  4. It should define the size of the data item.
  5. It may define the range of values that a data item may use.
  6. It may specify privacy locks for preventing unauthorized data entry.

Question 30.
What is mean by Data Manipulation?
Answer:

  1. Insertion of new information into the database.
  2. Retrieval of information stored in a database.
  3. Deletion of infonnation from the database.
  4. Modification of data stored in the database.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 31.
Write the SQL commands and their functions.
Answer:
Tables are the only way to store data, therefore all the information has to be arranged in the form of tables. The SQL provides a predetermined set of commands to work on databases.

Keywords:
They have a special meaning in SQL. They are understood as instructions. Commands: They are instructions given by the user to the database also known as statements.

Clauses:
They begin with a keyword and consist of keyword and argument.

Question 32.
Explain DELETE, TRUNCATE and DROP statement.
Answer:
(i) DELETE:
The DELETE command deletes only the rows from the table based on the condition given in the where clause or deletes all the row s from the table if no condition is specified. But it does not free the space containing the
table.

(ii) TRUNCATE:
The TRUNCATE command is used to delete all the row’s, the structure remains in the table and free the space containing the table.

(iii) DROP:
The DROP command is used to remove an object from the database. If you drop a table, all the rows in the table is deleted and the table structure is removed from the database. Once a table is dropped we cannot get it back.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 33.
List the different data types used in SQL
Answer:

  1. char (character)
  2. varchar
  3. dec (Decimal)
  4. numeric
  5. int (integer)
  6. small int
  7. float
  8. Real
  9. Double

Question 34.
Write the different types of SQL commands.
Answer:

  1. DDL – Data Definition Language
  2. DML – Data Manipulation Language
  3. DCL – Data Control Language
  4. TCL – Transaction Control Language
  5. DQL – Data Query Language

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 35.
What are the various processing skills of SQL?
Answer:
The various processing skills of SQL are :

(i) Data Definition Language (DDL):
Theb SQL DDL provides commands for defining relation schemas (structure), deleting relations, creating indexes and modifying relation schemas.

(ii) Data Manipulation Language (DML):
The SQL DML includes commands to insert.delete, and modify tuples in the database.

(iii) Embedded Data Manipulation Language:
The embedded form of SQL is used in high level programming languages.

(iv) View Definition:
The SQL also includes commands for defining views of tables.

(v) Authorization:
The SQL includes
commands for access rights to relations and views of tables.

(vi) Integrity:
The SQL provides forms for integrity checking using condition.

(vii) Transaction control:
The SQL includes commands for file transactions and control over transaction processing.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 36.
Explain Any 5 data types?
Answer:
(i) char(Character):
Fixed width string value. Values of this type is enclosed in single quotes. Eg:Anu’s will be written
as ‘Anu’ ‘s’.

(ii) varchar:
Variable width character string. This is similar to char except the size of the data entry vary considerably.

(iii) numeric:
It is same as decimal except that the maximum number of digits may not exceed the precision argument.

(iv) int(Integer):
It represents a number without a decimal point. Here the size argument is not used.

(v) float:
It represents a floating point number in base 10 exponential notation and may define a precision up to a maximum of 64.

Question 37.
What is the role of SQL in RDBMS?
Answer:
(i) RDBMS stands for Relational Data Base Management System. Oracle, MySQL, MS SQL server, IBMDB2 and Microsoft Access are RDBMS packages.
(ii) Database is a collection of tables that store set of data that can be queried for use in other applications.
(iii) A Database Management System supports the development, Administration and use of database platforms.
(iv) The data in RDBMS, is stored in data base objects, called tables. A Table is a collection of related data entries and it consist of row and columns.
(v) A field is a column in a table that is designed to maintain specific related information about every records in the table.
(vi) A Record is a row, which is a collection of related fields or columns that exist in a table.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 38.
Write a query that selects all students whose age is less than 18 in order wise.
Answer:
SELECT * Name, Age FROM Student WHERE Age < 18 ORDER BY Name ASC;
Where
Student – Name of the file name.
ASC – Ascending order (Name column)

Question 39.
Differentiate Unique and Primary Key constraint.
Answer:

Unique  Primary Key
Unique constraint ensures that no two rows have the same value in the specified columns. Primary key constraint declares a field as a primary key which helps to uniquely identify a record.
The unique constraint can be applied only to fields that have also been declared as NOT NULL. The primary key does not allow NULL values and therefore a field declared as primary key must have the NOT NULL constraint.

Question 40.
Write the difference between constraint and column constraint?
Answer:

Table constraint  Column constraint
When the constraint is applied to a group of fields of the table, it is known as Table constraint. The table constraint is normally given at the end of the table definition.
The table constraint is normally given at the end of the table definition. When we define a check constraint on a single column.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 41.
Which component of SQL lets insert values in tables and which lets to create a table?
Answer:
The INSERT command helps to add new data to the database or add new records to the table. The command is
INSERT INTO <table name> [column-list] VALUES (values);
The CREATE TABLE command to add values into the table. The order of values must match the order of columns in the command.

Question 42.
What is the difference between SQL and MySQL?
Answer:

SQL

 MySQL

SQL – Structured Query Language is a language used for accessing databases. MySQL is a database management system like SQL server.
SQL allows user to create, retrieve, alter and transfer information among databases. MySQL is a RDBMS, it is language designed for managing and accessing data in a Relational Database management svstem.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 43.
What is a constraint? Write short note on Primary key constraint.
Answer:

  1. Constraint is a limit to the data or type of data that can be inserted, updated, or deleted from a table.
  2. The whole purpose of constraints is to maintain the data integrity.
  3. A primary key constraint which helps to uniquely identify a record.
  4. It is similar to unique constraint except that only field of a table can be set as primary key.
  5. The primary key does not allow NULL values.

Question 44.
Write a SQL statement to modify the student table structure by adding a new field.
Answer:

  1. The ALTER command is used to modify the student table structure.
  2. The syntax is ALTER TABLE <table name> ADD <column namexdata type><size>;
  3. To add a new column ‘Address’ of type ‘char’ to the student table, the command is used as ALTER TABLE student ADD Address char;

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 45.
Write any three DDL commands.
Answer:
(i) CREATE TABLE:
When using this command a table is created, its columns are named, data types and sizes are to be specified.

(ii) ALTER:
This command is used to alter the table structure like adding a column, renaming the existing column, change the data type of any column or size of the column or delete the column from the table.

(iii) DRQP TABLE:
This DDL command is used to remove a table from the database. When we use DROP TABLE command carefully because we cannot get removed table back.

Question 46.
Write the use of Savepoint command with an example.
Answer:
(i) The SAVEPOINT command is used to temporarily save a transaction so that you can roll back to the point whenever required.
(ii) The different states of our table can be saved at any time using different names and the rollback to that state can be done using the ROLLBACK command.
SAVEPOINT savepoint_Name;
Eg:
INSERT INTO STUDENT VALUES (1001, ‘ARUN’, ‘M’, ‘46’, ‘OOTY’);
SAVEPOINT A;

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 47.
Write a SQL statement using DISTINCT keyword.
Answer:
The DISTINCT keyword is used along with the SELECT command to eliminate duplicate rows in the table. This command helps to eliminate redundant data.
Eg:
SELECT DISTINCT place FROM student;
In this example, the keyword DISTINCT is used, only one NULL value is returned, even if more NULL values occur.

Question 48.
Write the different types of constraints and their functions.
Answer:
Constraints ensure database integrity. The different types of constraints are unique constraint, primary key constraint, Default constraint and check constraint.

(i) Unique constraint:
This constraint ensures that no two rows have the same values in the specified columns. The UNIQUE constraint can be applied only to fields that have also been declared as NOT NULL.

(ii) Primary key constraint:
This constraint declares a field as a primary key which helps to unique identify a record. The primary key does not allow NULL values and therefore a field declared as primary key must have the NOT NULL constraint.

(iii) DEFAULT constraint:
The DEFAULT constraint is used to assign a default value for the field. When no value is given for the specified field having DEFAULT constraint, automatically the default value will be assigned to the field.

(iv) CHECK constraint:
This constraint helps to set a limit value placed for a field. When we define a check constraint on a single column, it allows only the restricted values on that field.

(v) TABLE constraint:
When the constraint is applied to a group of fields of the table, it is known as Table constraint. The Table constraint is normally given at the end of the table definition.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 49.
Consider the following employee table. Write SQL commands for the qtns.(i) to (v)
Answer:

TN State Board 12th Computer Science Important Questions Chapter 12 Structured Query Language (SQL) 1

TN State Board 12th Computer Science Important Questions Chapter 12 Structured Query Language (SQL) 2

(i) To display the details of all employees in descending order of pay.
(ii) To display all employees whose allowance is between 5000 and 7000.
(iii) To remove the employees who are mechanic.
(iv) To add a new row.
(v) To display the details of all employees who are operators.

(i) SELECT*FROM employee ORDER BY PAY DESC;
(ii) SELECT*FROM employee WHERE ‘ (Allowance > 5000 AND Allowance < 7000);
(iii) DELETE*FROM employee WHERE ’ DESIG – “Mechanic”;
(iv) INSERT INTO employee (EMP CODE, NAME, DESIG, PAY ALLOWANCE) VALDES (Ml006, TIARL, ‘Mechanic’, 22000, 7500);
(v) SELECT*FROM employee WHERE DESIG – “operator”;

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 50.
What are the components of SQL? Write the commands in each.
Answer:
Components of SQL are divided by Five categories. They are
(i) DML Data Manipulation Language.
INSERT command helps to add new data , to the database or add new records to the table.

(ii) DDL- Data Definition Language.
ALTER command is used to alter the structure like adding a column, renaming the existing column etc.

(iii) DCL- Data Control Language.
GRANT command give user’s access privileges to database.

(iv) TCL Transaction Control Language.
COMMIT command is usecko permanently save any transaction to the database.

(v) DQL- Data Query Language.
SELECT command is used to query or retrieve data from a table in the database.

Question 51.
Construct the following SQL statements in the student table.
Answer:
(i) SELECT statement using GROUP BY Clause.
The group by clause is used with the SELECT statement to group the students on rows or columns having identical values or divide the table into groups.
The syntax for the GROUP BY Clause is SELECT <column – names> FROM <Table – name> GROUP BY<column-Name> HAVING <condition>
To apply the above command on the student table.
SELECT Gender FROM Student GROUP By Gender.

(ii) SELECT statement using ORDER BY Gender.
The ORDER By clause is SQL is used to sort the data in either ascending or descending based on one or more columns.
The syntax for the ORDER By clause is
SELECT < column – name >[,< column – name >, …] FROM <table name > ORDER BY < column 1 >, < column 2 >,… ASC / DESC;
To apply the above command on the student table.
SELECT * FROM Student ORDER BY Gender.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 52.
Write a SQL statement to create a table for employee having any five fields and create a table constiaint for the employee table.
Answer:
CREATE TABLE Employee
(
Employee Number NOT NULL PRIMARY KEY,
Emp Name char (25) NOT NULL,
Gender char (1),
EmpDesig char (10),
Age integer DEFAULT = “18”,
Salary (CHECK < = 20000),
);

Question 53.
Create a query of the student table in the following order of fields name, age, place and adm no.
Answer:
#Create a database
CREATE TABLE student
( name varchar (20) NOT NULL
Age int NOT NULL
place char(20)
Adm No int NOT NULL
Primary key (Adm No)
);
#Using SELECT command
SELECT AdmNo, name FROM student;
This command will display All name and Admission Number from student database.
SELECT * FROM student;
This command will display all the fields and rows of the table from student database.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 54.
Create a query to display the student table with students of age more than 18 with unique city.
Answer:
SELECT Adm no, name, Age, place FROM student WHERE (Age > 18 AND Place = “CHENNAI”);

Question 55.
Create a employee table with the following fields employee number, employee name, designation, date of joining and basic pay.
Answer:
CREATE TABLE employee
(
Emp No int (5)
NOT NULL . PRIMARY KEY
EmpName char (20),
EmpDESIG char (10),
EmPDOJ char (8),
EmPBP int (10),
);

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 56.
In the above table set the employee number as primary key and check for NULL values in any field.
Answer:
Emp No int (5) PRIMARY KEY,
SELECT * FROM employee WHERE EmPBP IS NULL;
EmPBP field can be searched in a employee .table, list all the employees whose Basic pay (EmPBP); Contains no value.

Question 57.
Prepare a list of all employees who are of managers.
Answer:
SELECT * FROM employee WHERE EmPDESIG = “MANAGER”;

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Choose the correct answer:

Question 1.
The data in RDBMS, is stored in database objects, called:
(a) Tables
(b) Columns
(c) Rows
(d) Fields
Answer:
(a) Tables

Question 2.
Which skills the SQL provides forms for checking using condition?
(a) View
(b) Integrity
(c) Authorization
(d) Transaction control
Answer:
(b) Integrity

Question 3.
MySQL is a:
(a) SQL
(b) System software
(c) RDBMS
(d) High level language
Answer:
(c) RDBMS

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 4.
LAMP is a:
(a) Serve live website key
(b) Data Definition Language
(c) Data Manipulation Language
(d) Government website
Answer:
(a) Serve live website key

Question 5.
Which command is used to remove all records from a table, also release space occupied by those records? placed for a field?
(a) Create
(b) Alter
(c) Drop
(d) Truncate
Answer:
(d) Truncate

Question 6.
Which command is used delete all records from a table, but not the space occupied by them?
(a) Delete
(b) Alter
(c) Drop
(d) Truncate
Answer:
(a) Delete

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 7.
Which command is used to save anytransaction into the database permanently?
(a) Grant
(b) Commit
(c) Rollback
(d) Savepoint
Answer:
(b) Commit

Question 8.
Which command is used Restore the database to last commit state?
(a) Grant
(b) Commit
(c) Rollback
(d) Savepoint
Answer:
(c) Rollback

Question 9.
Which command is used temporarily save a
transaction?
(a) Grant
(b) Commit
(c) Rollback
(d) Savepoint
Answer:
(d) Savepoint

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 10.
How many types of constraints ensure database integrity?
(a) 2
(b) 3
(c) 4
(d) 5
Answer:
(c) 4

Question 11.
Which constraint can be applied only tofields?
(a) UNIQUE
(b) PRIMARY KEY
(c) DEFAULT
(d) CHECK
Answer:
(a) UNIQUE

Question 12.
Which constraint declares a field as a primary key?
(a) UNIQUE
(b) PRIMARY KEY
(c) DEFAULT
(d) CHECK
Answer:
(b) PRIMARY KEY

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 13.
Which constraint helps to set a limit value placed for a field?
(a) UNIQUE
(b) PRIMARY KEY
(c) DEFAULT
(d) CHECK
Answer:
(d) CHECK

Question 14.
Which constraint is applied to a group fields?
(a) UNIQUE
(b) TABLE
(c) DEFAULT
(d) CHECK
Answer:
(b) TABLE

Question 15.
Which DML command helps to add new data to the database?
(a) INSERT
(b) UPDATE
(c) ALTER
(d) DROP
Answer:
(a) INSERT

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 16.
Which keyword is used to update multiple fields?
(a) ALTER
(b) SET
(e) DROP
(d) INSERT
Answer:
(b) SET

Question 17.
Which DDL command can also be used to remove all columns?
(a) ALTER
(b) DROP
(e) DELETE
(d) TRUNCATE
Answer:
(a) ALTER

Question 18.
Which DDL command deletes only the rows, from the table?
(a) DELETE
(b) TRUNCATE
(c) DROP
(d) REMOVE
Answer:
(a) DELETE

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 19.
Which DDL command is used to delete all the rows, the structure remains in the table?
(a) DELETE
(b) TRUNCATE
(e) DROP
(d) REMOVE
Answer:
(b) TRUNCATE

Question 20.
Which DDL command is used to remove an object from the database?
(a) DELETE
(b) TRUNCATE
(c) DROP
(d) REMOVE
Answer:
(c) DROP

Question 21.
Which DQL command helps to eliminate duplicate rows in the Table?
(a) DISTINCT
(b) ALL
(c) BETWEEN
(d) IN
Answer:
(a) DISTINCT

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 22.
Which DQL keyword retains duplicate rows?
(a) DISTINCT
(b) ALL
(c) BETWEEN
(d) IN
Answer:
(b) ALL

Question 23.
Which DQL keyword defines a range of values?
(a) DISTINCT
(b) ALL
(c) BETWEEN
(d) IN
Answer:
(c) BETWEEN

Question 24.
Which DQL keyword is used to specify a list of values which must be matched with the record values?
(a) DISTINCT
(b) ALL
(c) BETWEEN
(d) IN
Answer:
(d) IN

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 25.
Which DQL clause in SQL is used to sort the data in either ascending or descending?
(a) DISTINCT
(b) ALL
(c) IN
(d) ORDER BY
Answer:
(d) ORDER BY

Question 26.
Which DQL clause is used to filter the records?
(a) WHERE
(b) ALL
(c) IN
(d) ORDER BY
Answer:
(a) WHERE

Question 27.
Match The Following:

(i) SQL  (A) RDBMS
(ii) IBMDB2  (B) Data Manipulation Language
(iii) DDL  (C) Database
(iv) DML  (D) Data Definition Language

(a) (i) – C, (ii) – A, (iii) – D , (iv) – B
(b) (i) – B, (ii) – C, (iii) – D, (iv) – A
(c) (i) – B, (ii) – D, (iii) – A, (iv) – C
(d) (i) – B, (ii) – A, (iii) – C, (iv) – D
Answer:
(a) (i) – C, (ii) – A, (iii) – D , (iv) – B

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 28.
Match the following:

(i) object  (A) Field
(ii) column  (B) Record
(iii) row  (C) Database
(iv) tables  (D) Tables

(a) (i) – D, (ii) – A, (iii) – B, (iv) – C
(b) (i) – D, (ii) – C, (iii) – B, (iv) – A
(c) (i) – C, (ii) – B, (iii) – D, (iv) – A
(d) (i) – C, (ii) – B, (iii) – A, (iv) – D
Answer:
(a) (i) – D, (ii) – A, (iii) – B, (iv) – C

Question 29.
Match the following:

(i) Alter  (A) DML command
(ii) Update  (B) DDL command
(iii) Commit  (C) DQL command
(iv) SELECT  (D) TCL command

(a) (i) – B, (ii) – D, (iii) – C, (iv) – A
(b) (i) – B, (ii) – A, (iii) – D, (iv) – C
(c) (i) – D, (ii) – C, (iii) – A, (iv) – B
(d) (i) – D, (ii) – A, (iii) – B, (iv) – C
Answer:
(b) (i) – B, (ii) – A, (iii) – D, (iv) – C

Question 30.
Match the following:

(i) ALTER  (A) Delete only Row
(ii) DELETE  (B) Delete Table
(iii) TRUNCATE  (C) Delete Column
(iv) DROP  (D) Delete All Row

(a) (i) – C, (ii) – B, (iii) – D, (iv) – A
(b) (i) – B, (ii) – C, (iii) – D, (iv) – A
(c) (i) – C, (ii) – A, (iii) – D, (iv) – B
(d) (i) – B, (ii) – D, (iii) – A, (iv) – C
Answer:
(c) (i) – C, (ii) – A, (iii) – D, (iv) – B

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 31.
Match the following:

(i) DISTINCT  (A) List of values
(ii) ALL  (B) range of values
(iii) IN  (C) retain duplicate row
(iv) BETWEEN  (D) eliminate duplicate row

(a) (i) – D, (ii) – A, (iii) – B, (iv) – C
(b) (i) – D, (ii) – C, (iii) – A, (iv) – B
(c) (i) – C, (ii) – A, (iii) – B, (iv) – D
(d) (i) – C, (ii) – B, (iii) – D, (iv) – A
Answer:
(b) (i) – D, (ii) – C, (iii) – A, (iv) – B

Question 32.
Choose the incorrect pair:
(a) HAVING – Group By
(b) COMMIT – Save
(c) ROLLBACK – Restore
(d) SAVEPOINT – Permanently save
Answer:
(d) SAVEPOINT – Permanently save

Question 33.
Choose the incorrect pair:
(a) DDL – Creation Tables
(b) DML – Insert data
(c) DCL – queries
(d) TCL – Transaction
Answer:
(c) DCL – queries

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 34.
Choose the incorrect pair:
(a) Object – Database
(b) RDBMS – DBMS
(c) Field – Column
(d) Record – Row
Answer:
(a) Object – Database

Question 35.
Choose the correct pair:
(a) char – Fixed width string
(b) int – with decimal
(c) small int – greater size
(d) varchar – Variable width Numeric
Answer:
(a) char – Fixed width string

Question 36.
Choose the correct pair:
(a) UNIQUE – NULL
(b) PRIMARY KEY – NOT NULL
(c) CHECK – default value
(d) TABLE – Single field
Answer:
(b) PRIMARY KEY – NOT NULL

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 37.
Choose the incorrect statement:
(a) The DML commands consists of inserting, deleting and updating rows into the table.
(b) The INSERT command helps to add new data to the database.
(c) Delete command temporarily delete single row in the table.
(d) The UPDATE command updates some or all data values in a database.
Answer:
(c) Delete command temporarily delete single row in the table.

Question 38.
Choose the incorrect statement:
(a) The Alter command is used to alter the table structure.
(b) The Truncate command is used to delete single column from the table.
(c) DROP command is used to remove a Table.
(d) Delete command is used to delete all Rows from the table.
Answer:
(b) The Truncate command is used to delete single column from the table.

Question 39.
Choose the incorrect statement:
(a) DISTINCT keyword is used retains . duplicate rows.
(b) BETWEEN keyword defines a range of values.
(c) IN keyword is used to specify a list of values.
(d) WHERE clause is used to filter the records.
Answer:
(a) DISTINCT keyword is used retains . duplicate rows.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 40.
Choose the correct statement:
(a) The HAVING clause can be used along with GROUP BY clause in the SELECT statement.
(b) COMMIT command is to temporarily save to the memory.
(c) Rollback command deletes the database to the last committed state
(d) The SAVE POINT command is used to permanently save to the memory.
Answer:
(a) The HAVING clause can be used along with GROUP BY clause in the SELECT statement.

Question 41.
Choose the correct statement:
(a) Create Table command to create new row.
(b) The DCL provides authorization commands to access data.
(c) The TCL commands are used creation or deletion Tables.
(d) The DQL commands are used to insert, update and delete data of a Table.
Answer:
(b) The DCL provides authorization commands to access data.

Question 42.
Assertion (A):
The structured Query Language (SQL) is a standard programming language to access and manipulate databases.
Reason (R):
SQL allows the user to create, retrieve, alter and transfer information among databases.
(a) Both A and R are True and R is the correct explanation for A.
(b) Both A and R are True, but R is not the correct explanation for A.
(c) A is True but R is False.
(d) A is False but R is True.
Answer:
(a) Both A and R are True and R is the correct explanation for A.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 43.
Assertion (A):
RDBMS is a type of High level language with a row based table structure.
Reason (R):
A field is a Row, which collection of related fields.
(a) Both A and R are True and R is the correct explanation for A.
(b) Both A and R are True, but R is not the correct explanation for A.
(c) A is True but R is False.
(d) A is False but R is True.
Answer:
(d) A is False but R is True.

Question 44.
Assertion (A):
SQL is a language used for accessing database.
Reason (R):
Database is a group of files, it cannot be used other application.
(a) Both A and R are True and R is the correct explanation for A.
(b) Both A and R are True, but R is not the correct explanation for A.
(c) A is True but R is False.
(d) A is False but R is True.
Answer:
(d) A is False but R is True.

Question 45.
Assertion (A):
TABLE constraint is applied to a single field.
Reason (R):
The Table constraint is normally given at the end of the Table definition.
(a) Both A and R are True and R is the correct explanation for A.
(b) Both A and R are True, but R is not the correct explanation for A.
(c) A is True but R is False.
(d) A is False but R is True.
Answer:
(d) A is False but R is True.

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 46.
Assertion (A):
The WHERE clause is used to filter the records.
Reason (R):
The ORDER BY sorts the data in either Ascending or Descending.
(a) Both A and R are True and R is the correct explanation for A.
(b) Both A and R are True, but R is not the correct explanation for A.
(c) A is True but R is False.
(d) A is False but R is True.
Answer:
(b) Both A and R are True, but R is not the correct explanation for A.

Question 47.
Pick the odd one out.
(a) Oracle
(b) MySQL
(c) IBMDB2
(d) dbase
Answer:
(d) dbase

Question 48.
Pick the odd one out.
(a) INSERT
(b) Create
(c) Alter
(d) DROP
Answer:
(a) INSERT

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 49.
Pick the odd one out.
(a) Commit
(b) Grant
(c) Rollback
(d) save point
Answer:
(b) Grant

Question 50.
Pick the odd one out.
(a) Unique
(b) Default
(c) Check
(d) Alter
Answer:
(d) Alter

Question 51.
Pick the odd one out.
(a) Delete
(b) Select
(c) Truncate
(d) Drop
Answer:
(b) Select

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 52.
DDL stands for:
(a) Data Definition Language
(b) Data Declared Language
(c) Defined Data Language
(d) Data Declared language
Answer:
(a) Data Definition Language

Question 53.
DML stands for:
(a) Data Manipulation Language
(b) Data Memory Language
(c) Data Main Language
(d) Data Machine Language
Answer:
(a) Data Manipulation Language

Question 54.
DCL stands for:
(a) Data Control Language
(b) Dynamic Control Language
(c) Dynamic Center Language
(d) Data Communication Language
Answer:
(a) Data Control Language

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 55.
TCL stands for:
(a) Transmission Control Language
(b) Transfer Communication Language
(c) Transaction Control Language
(d) Transmission Center Language
Answer:
(b) Transfer Communication Language

Question 56.
How many types of database integrity constraints are there?
(a) 2
(b) 3
(c) 4
(d) 5
Answer:
(c) 4

Question 57.
Which of the following separated by multiple constraints?
(a) Comma
(b) Semicolon
(c) Colon
(d) Space
Answer:
(d) Space

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 58.
Which of the following constraints does not allow NULL values?
(a) Primary key
(b) Identifier
(c) Variables
(d) Unique
Answer:
(a) Primary key

Question 59.
Which of the following keywords shows that the field value cannot be empty ?
(a) No VALUE
(b) NOT NULL
(c) NULL
(d) O
Answer:
(b) NOT NULL

Question 60.
Which of the following Constraint is used to a group of field of the table?
(a) Constraint
(b) Unique
(c) Row
(d) Table
Answer:
(d) Table

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 61.
Which of the following keyword used to sort the records in ascending order?
(a) ASC
(b) ASCE
(c) ACE
(d) ASCEN
Answer:
(a) ASC

Question 62.
Which of the following keyword used to sort . the records in descending order?
(a) DESEN
(b) DESC
(c) DESE
(d) DES
Answer:
(b) DESC

Question 63.
Which of the following begin with a keyword and consists of keyword and argument?
(a) Clauses
(b) Key
(c) Statement
(d) Argument
Answer:
(a) Clauses

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 64.
Which commands provide definitions for creating table structure, deleting relations, and modifying relation schemas?
(a) DDL
(b) DML
(c) DCL
(d) DQL
Answer:
(a) DDL

Question 65.
Which command lets to change the structure of the table?
(a) SELECT
(b) ORDER BY
(c) MODIFY
(d) ALTER
Answer:
(d) ALTER

Question 66.
The command to delete a table is:
(a) DROP
(b) DELETE
(c) DELETE ALL
(d) ALTER TABLE
Answer:
(a) DROP

Samacheer Kalvi TN State Board 12th Computer Applications Important Questions Chapter 12 Structured Query Language (SQL)

Question 67.
Queries can be generated using:
(a) SELECT
(b) ORDER BY
(c) MODIFY
(d) ALTER
Answer:
(a) SELECT

Question 68.
The clause used to sort data in a database:
(a) SORT BY
(b) ORDER BY
(c) GROUP BY
(d) SELECT
Answer:
(b) ORDER BY

TN Board 12th Computer Science Important Questions