0% found this document useful (0 votes)
12 views4 pages

SQL 1

SQL is a programming language used to interact with relational database management systems. A database is a structured storage space where data is kept in an organized format in tables. Common SQL commands include those for data definition, data manipulation, data control, and transaction control. SQL is used to create, update, and delete records from database tables.

Uploaded by

neokushal17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

SQL 1

SQL is a programming language used to interact with relational database management systems. A database is a structured storage space where data is kept in an organized format in tables. Common SQL commands include those for data definition, data manipulation, data control, and transaction control. SQL is used to create, update, and delete records from database tables.

Uploaded by

neokushal17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Database VIVA Questions

1. What is SQL

It stands for Structured Query Language. A programming language used for interaction with
relational database management systems (RDBMS).

2. What is a database?

A structured storage space where the data is kept in organized format in the form of many
tables .

3. What is the full form of RDBMS. Give some examples ? Which one you are using .

It stands for relational database Management system . Some examples of RDBMS are MySQL,
PostgreSQL, SQLserver Oracle etc. we used oracle 10g in our lab.

4. What are the main applications of SQL?

Using SQL, we can:


 create, delete, and update tables in a database
 access, manipulate, and modify data in a table
 retrieve and summarize the necessary information from a table or several tables
 add or remove certain rows or columns from a table

5. What types of SQL commands (or SQL subsets) do you know?

 Data Definition Language (DDL) – to define and modify the structure of a database.
 Data Manipulation Language (DML) – to access, manipulate, and modify data in a database.
 Data Control Language (DCL) – to control user access to the data in the database and give or
revoke privileges to a specific user or a group of users.
 Transaction Control Language (TCL) – to control transactions in a database.
 Data Query Language (DQL) – to perform queries on the data in a database to retrieve the
necessary information from it.
6. Give some examples of common SQL commands of each type.

 DDL: CREATE, ALTER TABLE, DROP, TRUNCATE, and ADD COLUMN


 DML: UPDATE, DELETE, and INSERT
 DCL: GRANT and REVOKE
 TCL: COMMIT, SET TRANSACTION, ROLLBACK, and SAVEPOINT
 DQL: – SELECT

7.What is DBMS, and what types of DBMS do you know?

It stands for Database Management System, a software package used to perform various
operations on the data stored in a database, such as accessing, updating, wrangling, inserting,
and removing data.
There are various types of DBMS, such as
relational,
hierarchical,
object-oriented.

8.What types of SQL operators do you know?

 Arithmetic (+, -, *, /, etc.)


 Comparison (>, <, =, >=, etc.)
 Compound (+=, -=, *=, /=, etc.)
 Logical (AND, OR, NOT, BETWEEN, etc.)

9.How to create a table?

CREATE TABLE table_name (col_1 datatype,


col_2 datatype,
col_3 datatype);

10. How to update a table?

UPDATE table_name
SET col_1 = value_1, column_2 = value_2
WHERE condition;
11. How to delete a table from a database?

DROP Table table_name;.

12. How to select all columns from a table?

SELECT * FROM table_name;.

13.What are entities?

An entity is a real-world object, creature, place, or phenomenon for which the data can be
gathered and stored in a database table.

14. What are character manipulation functions? Give some examples.


 CONCAT()

 SUBSTR()
 LENGTH()
 REPLACE()

15. What types of SQL relationships do you know?


 One-to-one – each record in one table corresponds to only one record in another table

 One-to-many – each record in one table corresponds to several records in another table

 Many-to-many – each record in both tables corresponds to several records in another table

16. How do you add a record to a table?

INSERT INTO table_name


VALUES (value_1, value_2, ...);

17. How to delete a record from a table?

DELETE FROM table_name


WHERE condition;

18. How to delete a column from a table?

ALTER TABLE table_name


DROP COLUMN column_name;
19. What are table and Field?
Table: A table has a combination of rows and columns. Rows are called records and columns
are called fields.

21. What is a tuple


Each record in the table is called a tuple.

20. What is the primary key?


The primary key uniquely identifies each record of the table.

21. What is a Constraint?


Constraints are the rules that we can apply to the type of data in a table.

22. What is Data Integrity?


Data integrity is defined as the data contained in the database being both correct and
consistent.

23. What are the functions of commit and rollback


COMMIT permanently saves the changes made by the current transaction
ROLLBACKS undo the changes made by the current transaction.

24. What are aggregate functions?


Aggregate functions: These functions are used to do operations from the values of the
column and a single value is returned.
 AVG() – returns the average value
 SUM() – returns the sum of values
 MIN() – returns the minimum value
 MAX() – returns the maximum value
 COUNT() – returns the number of rows, including those with null values

25.What is a data warehouse?

A data warehouse is a large store of accumulated data, from a wide range of sources, within an
organization.

You might also like