Computer Science – MY SQL, Exams of Computer science

Computer Science – MY SQL – 24 Viva Questions with Answers - 4 Pages – Helpful for Students and Teachers

Typology: Exams

2024/2025

Available from 09/09/2024

kbzone1973
kbzone1973 🇮🇳

244 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MySQL | Vineeta Garg
1
MY SQL
VIVA QUESTIONS
1. What is DDL and DML?
DDL (Data Definition Language): All the commands which are used to create,
destroy, or restructure databases and tables come under this category. Examples
of DDL commands are - CREATE, DROP, ALTER.
DML (Data Manipulation Language): All the commands which are used to
manipulate data within tables come under this category. Examples of DML
commands are - INSERT, UPDATE, DELETE.
2. What is RDBMS?
RDBMS: A DBMS used to manage Relational Databases is called an RDBMS
(Relational Data Base Management System). Some popular RDBMS software
available are: Oracle, MySQL, Sybase, Ingress.
3. What is data inconsistency?
Data inconsistency occurs when same data present in two different tables does not
match.
4. What is a relation?
Relation/Table: A table refers to a two-dimensional representation of data
arranged in columns (also called fields or attributes) and rows (also called records
or tuples).
5. What is cardinality and degree?
Cardinality: Total number of rows in a table is called the cardinality of the table.
Arity/Degree: Total number of columns of a table is called the Degree of the
table.
6. What is the difference between primary key, candidate key and
alternate key?
Primary Key: The group of one or more columns used to uniquely identify each
row of a relation is called its Primary Key.
Candidate Key: A column or a group of columns which can be used as the
primary key of a relation is called a candidate key because it is one of the candidates
available to be the primary key of the relation.
Alternate Key: A candidate key of a table which is not made its primary key is
called its Alternate Key.
7. What is selection and projection?
pf3
pf4

Partial preview of the text

Download Computer Science – MY SQL and more Exams Computer science in PDF only on Docsity!

MY SQL

VIVA QUESTIONS

1. What is DDL and DML? DDL (Data Definition Language): All the commands which are used to create, destroy, or restructure databases and tables come under this category. Examples of DDL commands are - CREATE, DROP, ALTER. DML (Data Manipulation Language): All the commands which are used to manipulate data within tables come under this category. Examples of DML commands are - INSERT, UPDATE, DELETE. 2. What is RDBMS? RDBMS: A DBMS used to manage Relational Databases is called an RDBMS (Relational Data Base Management System). Some popular RDBMS software available are: Oracle, MySQL, Sybase, Ingress. 3. What is data inconsistency? Data inconsistency occurs when same data present in two different tables does not match. 4. What is a relation? Relation/Table: A table refers to a two-dimensional representation of data arranged in columns (also called fields or attributes) and rows (also called records or tuples). 5. What is cardinality and degree? Cardinality : Total number of rows in a table is called the cardinality of the table. Arity/Degree : Total number of columns of a table is called the Degree of the table. 6. What is the difference between primary key, candidate key and alternate key? Primary Key: The group of one or more columns used to uniquely identify each row of a relation is called its Primary Key. Candidate Key: A column or a group of columns which can be used as the primary key of a relation is called a candidate key because it is one of the candidates available to be the primary key of the relation. Alternate Key: A candidate key of a table which is not made its primary key is called its Alternate Key. 7. What is selection and projection?

The SELECTION operation is a horizontal subset of table/relation and is used to choose the tuples(rows) from a relation that satisfies a given condition. It is denoted by the symbol σ (sigma). The PROJECTION operation is a horizontal subset of table/relation and used to choose the attributes(columns) from a relation that are given in the attribute list. It is denoted by the symbol ∏ (pi).

8. What are the different types of clauses used in where command? CLAUSE/KEYWORD USAGE DISTINCT Used to display distinct values (removes duplicate values) from a column of a table. WHERE Used to specify the condition based on which rows of a table are displayed. BETWEEN Used to define the range of values within which the column values must fall to make a condition true. Range includes both the upper and the lower values. IN Used to select values that match any value in a list of specified values. LIKE Used for pattern matching of string data using wildcard characters % and _. % (percentage): It is used to represent any sequence of zero or more characters. _ (underscore): It is used to represent a single character. IS NULL Used to select rows in which the specified column is NULL (or is NOT NULL). ORDER BY Used to display the selected rows in ascending or in descending order of the specified column/expression. GROUP BY Group by clause is used when we need to group the data of the table based on certain type.

MIN() To find the minimum value under the specified column AVG() To find the average of values under the specified column SUM() To find the sum of values under the specified column COUNT() To count the values under the specified column

20. Difference between count() and count()* When the argument is a column name or an expression based on a column, COUNT() returns the number of non-NULL values in that column. If the argument is a *, then COUNT() counts the total number of rows satisfying the condition, if any, in the table. 21. What is the purpose of group by clause? Group by clause is used together with the SQL SELECT statement to group the data of the table based on certain type. It arranges identical data into groups. It returns only one single row for every grouped item. 22. What is the difference between where & having? WHERE is used to put a condition on individual row of a table whereas HAVING is used to put condition on individual group formed by GROUP BY clause in a SELECT statement. 23. What is equi join? When we extract data from two tables, they must have one column which is present in both the tables. An equi join of two tables is obtained by putting an equality condition on the Cartesian product of two tables. This equality condition is put on the common column of the tables and is called equi join condition. 24. What is a foreign key? Foreign key is a column in one table which is the primary key of another table. For eg. The column Deptno is the primary key of dept table and the foreign key of emp table. It is important that no entry should be made in the emp table in which deptno does not belong to dept table ie we cannot write deptno in emp table which does not exist in dept table.