0% found this document useful (0 votes)
9 views3 pages

12 Viva

Uploaded by

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

12 Viva

Uploaded by

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

1. What is SQL?

Structured Query Language is a database tool which is used to create and access database to support
software application.

2. What are different types of statements supported by SQL?

Data Definition Language (DDL)


Data Manipulation Language (DML)
Data Control Language (DCL)
Transaction Control Language (TCL)
Data Query Language (DQL)

3. What is DBMS?
A Database Management System (DBMS) is a program that controls creation, maintenance and use of a
database.
DBMS can be termed as File Manager that manages data in a database rather than saving it in file systems.

4. What is RDBMS?
RDBMS stands for Relational Database Management System. RDBMS store the data into the collection of
tables, which is related by common fields between the columns of the table. It also provides relational
operators to manipulate the data stored into the tables.
Example: SQL Server.

5. Why do we use SQL constraints? Which constraints we can use while creating database in SQL?
There are 5 major constraints are used in SQL, such as
NOT NULL: That indicates that the column must have some value and cannot be left null
UNIQUE: This constraint is used to ensure that each row and column has unique value and no value is
being repeated in any other row or column
PRIMARY KEY: This constraint is used in association with NOT NULL and UNIQUE constraints such
as on one or the combination of more than one column to identify the particular record with a unique
identity.
FOREIGN KEY: It is used to ensure the referential integrity of data in the table and also matches the
value in one table with another using Primary Key
CHECK: It is used to ensure whether the value in columns fulfills the specified condition

6. How many Aggregate Functions are available there in SQL?


SQL Aggregate Functions calculates values from multiple columns in a table and returns a single value.
There are 7 aggregate functions we use in SQL
AVG(): Returns the average value from specified columns
COUNT(): Returns number of table rows
MAX(): Returns largest value among the records
MIN(): Returns smallest value among the records
SUM(): Returns the sum of specified column values
FIRST(): Returns the first value

7. What is the difference between “Primary Key” and “Unique Key”?


1.We can have only one Primary Key in a table whereas we can have more than one Unique Key in a table.
2. The Primary Key cannot have a NULL value whereas a Unique Key may have only one null value.
3. By default, a Primary Key is a Clustered Index whereas by default, a Unique Key is a unique non-
clustered index.
4. A Primary Key supports an Auto Increment value whereas a Unique Key doesn't support an Auto
Increment value.

8. What is ISNULL() operator?


ISNULL function is used to check whether value given is NULL or not NULL in sql server. This function
also provides to replace a value with the NULL

9. What do you mean by data integrity?


Data Integrity defines the accuracy as well as the consistency of the data stored in a database. It also
defines integrity constraints to enforce business rules on the data when it is entered into an application or a
database.

10. What are Entities and Relationships?


Entities: Entity can be a person, place, thing, or any identifiable object for which data can be stored in a
database.
Relationships: Relationships between entities can be referred to as the connection between two tables or
entities.

11. What do you understand by Self Join?


Self Join in SQL is used for joining a table with itself. Here, depending upon some conditions, each row of
the table is joined with itself and with other rows of the table.

12. What is the difference between list and tuple?


The difference between list and tuple is that list is mutable while tuple is not. Tuple can be hashed for e.g
as a key for dictionaries.

13. What are the built-in type does python provides?


There are mutable and Immutable types of Pythons built in types Mutable built-in types
• List
• Sets
• Dictionaries

Immutable built-in types


• Strings
• Tuples
• Numbers

14. How you can convert a number to a string?


In order to convert a number into a string, use the inbuilt function str(). If you want a octal or hexadecimal
representation, use the inbuilt function oct() or hex().

15. Mention what are the rules for local and global variables in Python?
Local variables: If a variable is assigned a new value anywhere within the function's body, it's assumed to
be local.
Global variables: Those variables that are only referenced inside a function are implicitly global.

16. Explain how to delete a file in Python?


By using a command os.remove (filename) or os.unlink(filename)

17. Difference between GRANT and REVOKE?


GRANT: Provides specific privileges to users or roles.
REVOKE: Removes privileges from users or roles.

18. What is Composite key is

A composite key is a primary key that is made up of more than one column to uniquely identify records in
a table. Unlike a single-column primary key, a composite key combines two or more columns to ensure
uniqueness. While any of the individual columns in a composite key might not be unique on their own,
together they form a unique combination that can uniquely identify each row in the table.

19. When to Use a Composite Key?


i. A single column cannot uniquely identify a row, but a combination of columns can.
ii. You need to enforce a relationship between two or more attributes.
iii. You want to maintain data integrity by ensuring that the combination of columns remains unique.

20. What is keywords in python ?


Python keywords are reserved words. They are used by python interpreters to understand the program.
Keywords define the structure of programs. We can’t use keywords to name program entities such as
variables, classes, and functions.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy