SQL Part 1
SQL Part 1
questions
SQL stands for Structured Query
Language. It is the primary language to
interact with databases. With the help
of SQL, we can extract data from a
Question 1
database, modify this data and also
update it whenever there is a
What is requirement. This query language is
evergreen and is widely used across
SQL? industries. For example, if a company
has records of all the details of their
employees in the database. With the
help of SQL, all of this data can be
queried to find out valuable insights in a
short span of time.
SQL stands for Structured Query
Language. It is the primary language to
interact with databases. With the help
of SQL, we can extract data from a
Question 2
database, modify this data and also
update it whenever there is a
How to requirement. This query language is
evergreen and is widely used across
create a industries. For example, if a company
has records of all the details of their
table in employees in the database. With the
help of SQL, all of this data can be
SQL? queried to find out valuable insights in a
short span of time.
There are two ways to delete a table
from sql: DROP and TRUNCATE. The
DROP TABLE command is used to
completely delete the table from the
Question 3
database. This is the command:
DROP TABLE table_name;
How to The above command will completely
delete all the data present in the table
delete a along with the table itself.
But if we want to delete only the data
table in present in the table but not the table
itself, then we will use the truncate
SQL? command:
DROP TABLE table_name ;
Question 4
How to
change a
table name
in SQL?
Question 5
How to
delete a
row in
SQL?
A database is a repository in sql, which
can comprise of multiple tables.
create a
database in
SQL?
Normalization is used to decompose a
Question 7
larger, complex table into simple and
smaller ones. This helps us in removing
What is all the redundant data.
Normalizati
-on in SQL?
Question 8
What is join
in SQL?
Question 9
SQL Server comes under the
What is category of Relational database
management system.
SQL
server?
Question 10
How to
insert date
in SQL?
Question 11
What is
MYSQL?
Question 15
How can I
see all
tables in
SQL?
Question 16
How to
install
SQL?
Question 18
What is the
update
command in
SQL?
Question 19
What are
the types
of SQL
Queries?
Question 21
Write a Query
to display the SELECT region, COUNT(gender)
number of FROM employee GROUP BY region;
employees
working in each
region?
Question 22
What is an
alternative for
TOP clause in SQL?
Question 31
Will following
Error. Operand data type NULL is
statement give
invalid for Avg operator.
error or 0 as
output? SELECT
AVG (NULL)
Question 32
What is the
The output of Cross Join is called a
Cartesian product
Cartesian product. It returns rows
of the table?
combining each row from the first
table with each row of the second
table. For Example, if we join two
tables having 15 and 20 columns the
Cartesian product of two tables will
be 15×20=300 rows.
Question 33
What is a schema in
schema is blueprint for the database
SQL?
Question 34
How to delete a
To delete a column in SQL we will be
column in SQL?
using DROP COLUMN method:
ALTER TABLE employees
DROP COLUMN age;
Question 36
What is a unique
Unique Key is a constraint in SQL.
key in SQL?
Question 37
How to implement
We can implement multiple
multiple conditions
conditions using AND, OR operators:
using WHERE
SELECT * FROM employees WHERE
clause?
first_name = ‘Steven’ AND salary
<=10000;
Question 38 SQL injection is a hacking technique
which is widely used by black-hat
What is SQL hackers to steal data from your tables
injection? or databases. Let’s say, if you go to a
website and give in your user
information and password, the
hacker would add some malicious
code over there such that, he can get
the user information and password
directly from the database.
Question 39
How to insert
multiple rows in
SQL?
Question 41