Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

MS SQL L1

1. What is DBA architecture


2. Physical and Logical architecture
3. Basic installation or instance installation
4. Post installation
5. What is MS SQL object - List of object
6. how to create data base, check Size of Data base. how to check the MySQL database size
7. User management - User creation and permission management
8. Basic DBA backup
9. What are different type of back up and commands (full, differential, and incremental)
10. DBA - Restoration
11. What is index in MS SQL
12. Create Table
13. Drop Table
14. Update states
15. MS SQL UPDATE Statement
16. How do I see active sessions in SQL database?
17. How to get serial numbers in SQL query?
18. How to get current session in SQL Server?
19. How to get current session in SQL Server?
20. how to check mysql version
21. How to check the performance of MySQL database?
22. How to analyze slow query MySQL?
23. How to check MySQL running process?
24. How to check long running in MySQL?
25. How do I fix a slow query in MySQL?
26. What is a slow query in MySQL?
27. How to speed up MySQL database?
28. SQL Database
29. SQL Create DB
30. SQL Drop DB
31. SQL Backup DB
32. SQL Create Table
33. SQL Drop Table
34. SQL Alter Table
35. SQL Constraints
36. SQL Not Null
37. SQL Unique
38. SQL Primary Key
39. SQL Foreign Key
40. SQL Check
41. SQL Default
42. SQL Index
43. SQL Auto Increment
44. SQL Dates
45. SQL Views
46. SQL Injection
47. SQL Hosting
48. SQL Data Types
1. What is DBA Architecture?
Ans. Client -> server -> storage.

2. Physical and logical architecture.


Ans. Logical:-logical layer take the data from the application layer.
Physical:-physical layer in which contains the storage engines.

3. Basic installation or instance installation.


Ans. 1 - yum install MySQL
2 - rpm –ivh file_name.rpm
3 –tar installation

4. Post installation.

5. What is MySQL object list of object?


Ans. Certain object in MySQL within including database , table ,index ,column ,
alias ,view ,stored,procedure,partition, tablespace,resources,group and other object.

6. How to create database, check of the size of databases.


Ans. Create database –
create database database_name;

Check size of database –


du –sh MySQL (directory);

7. User management - user creation and permission


Management .
Ans. 1. Create user :-
Create user ‘user_name’@’host_name’ identified by ‘password’;

Then check the create user show for:-


Select user from mysql.user;

2. Permission management:-
Grant all on *.* to ‘user_name’@’host_name’;

Then check the permission list show for:-


1. show grants for 'raviverma'@'localhost';
2. Select * from mysql.user\G;
8. Basic DBA backup.
Ans. Backup:-
Mysqldump uroot –p –-all–databases > file_name.sql (use to write the cmd command)

After backup then check:-


dir (cmd)
Ls –ltr (Linux)

9. What are different type of backup and commands (full,


differential, and incremental).
Ans. 1. mysqldump (logical backup).

2. MySQL enterprise backup (physical backup).

10. DBA Restoration.


Ans. 1. dump:-
mysql –uroot –p –all < file_name.sql;

2. source file_name.sql;

11. What is index in Mysql?


Ans. Index are used to find row with specific column values quickly.

12. Create table.


Ans. Create table table_name (colonm1, colonm2 …);

Example:-create table student(id int,name varchar(10),address varchar(20),contact(10));

13. Drop table.


Ans. Drop table table_name;

14. Update states.


Ans. update table_name set colonm_name1 = values, colonm_name2 = values….. where condition;

15. Ms Sql update statement.


Ans.

16. How do I see active sessions in sql database?


Ans. Show processlist;

17. How to get serial number in mysql quarry.


Ans. Select row_number() over (order by colonm_name) ,colonm_name2,…… from table_name;

18. How to get current session in sql server.


Ans. Show processlist;

19. How to check mysql version.


Ans. Mysql -V; (cmd command)

20. How to check the performance of mysql database.


Ans. Monitoring tools (MEM) – mysql enterprise monitoring.

21. How to analyse show quarry in mysql.


Ans. Explain select * from table_name;

22. How to check mysql running process.


Ans. Ps -ef|gref mysql;

23. How to check long running in mysql.


Ans:
24. How do I fix show quary in mysql.
Ans:

25. What is show quarry in mysql.


Ans: show create table table_name;

26. How to speed up mysql database.


Ans:

27.Sql batabase.
Ans: show databases;

28. sql create database.


Ans: create database database_name;

29.sql drop database.


Ans: drop database database_name;

30. sql backup database.


Ans: mysqldump –uroot –p –all –databases >file_name.sql;(cmd command)

31. sql create table.


Ans: create table table_name(colonm1,colonm2,…..);
32.sql drop table.
Ans:drop table table_name;

33. sql alter table.


Ans: 1. The ALTER TABLE statement is used to add, delete, or modify columns in an
existing table

2. The ALTER TABLE statement is also used to add and drop various
constraints on an existing table.

ALTER TABLE - ADD Column:-


ALTER TABLE table_name
ADD column_name datatype;

ALTER TABLE - DROP COLUMN:-


ALTER TABLE table_name
DROP COLUMN column_name;

ALTER TABLE - ALTER/MODIFY DATATYPE:-


ALTER TABLE table_name
ALTER COLUMN column_name datatype;

35. SQL Constraints.


Ans. After the table is create with the ALTER TABLE statement.

The following constraints are commonly used in SQL:


 NOT NULL - Ensures that a column cannot have a NULL value
 UNIQUE - Ensures that all values in a column are different
 PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely
identifies each row in a table
 FOREIGN KEY - Prevents actions that would destroy links between
tables
 CHECK - Ensures that the values in a column satisfies a specific
condition
 DEFAULT - Sets a default value for a column if no value is specified
 CREATE INDEX - Used to create and retrieve data from the database
very quickly

You might also like