Database and monitoring security

Source: Internet
Author: User

Surface
Try
Problem

(Database and monitoring _ security chapter)
Selection (1 points per question)
1.SQL Server Database Super Admin for ()
A:admin B:sa
C:sys D:root

2. In the SQL language, the condition "between and 30" means that the age is between 20 and 30,
and ()
A) includes 20 and 30 years old B) excluding 20 and 30 years old
c) including 20 years not including 30 years old D) excluding 20 years old including 30 years old

3. To make the value of the index key unique in the base table, the reserved word () should be used in the index statement
a) UNIQUE b) COUNT
c) disdinct D) UNION

The command to modify the table structure in a 4.SQL statement is ()
A, MODIFY TABLE
B, MODIFY STRUCTURE
C, ALTER TABLE STRUCTURE

5. Which of the following is not the physical component of the database ()
A) Table space B) data file
C) log file D) control text

6. Please obtain the data from the order form, including three column customer name, order time and order fee. Which of the following where clauses can be used to poll the Orders table for orders with more than 2700 customer a? ()
A) where client name = <k,/
B) where Client name = 4 A ' and order fee < 2700;
C) where client name = ' A, or order fee > 2700;
D) where client name = ' A ' and order fee >2700;

7. Which of the following SQL statements change the name of the user table to UserInfo? ()
A) ALTER TABLE USER RENAME as USERINFO;
B) RENAME to USERINFO from USER;
C) RENAME USER to USERINFO;
D) RENAME USER as USERINFO;

8. Assuming that the primary KEY constraint for the user table is named USERJD_PK, which of the following statements will be deleted
This constraint? ()
A) DROP CONSTRAINT user"d_pk;
B) ALTER TABLE USER DROP userjd_pk;
C) ALTER TABLE USER DROP CONSTRAINT userjd_pk;
D) ALTER TABLE USER DROP PRIMARY KEY;

9. To obtain data from the Orders table, including three columns customer, order_date, and Order_amt? You can use one of the following where clauses to poll the Orders table to get orders from customers Leslie more than 2700? ()
A) where customer = ' LESLIE ';
B) where customer = ' LESLIE ' and Order_amt < 2700;
C) where customer = ' LESLIE ' or Order_amt > 2700;
D) where customer = ' LESLIE ' and Order__amt > 2700;

10.SQL language not included ()
A) Data Definition language B) Data manipulation language
C) Data Translation language D) Data Control language

The command to delete a table in a 11.SQL statement is ()
A) Delete table B) Erase table
C) Delete dbf D) drop table

12.SQL statement is not a query calculation function is ()
A) ABS B) sum
C) Max D) Avg

13. The main difference between a database system and a file system is ()
A) The database system is complex, and the file system is simple
B) file systems do not address data redundancy and data independence, and database systems can address
C) The file system can only manage program files, and the database system can manage all types of files
D) Less data is managed by the file system, and the database system can manage a large amount of data

14. The operation to filter the data table, the result is ()
A) only records that meet the criteria are displayed, and the records that are not satisfied are removed from the table
B) display records that meet the criteria and save them to a new table
C) only records that meet the criteria are displayed, and records that do not meet the criteria are hidden
D) display of records that meet the criteria and records that do not meet the criteria are divided into two tables

15. The query command is as follows: Select study number, Grade *0.8 as final result from grade order by grade DESC, school number; correct saying is ()
A) Check the student score and multiply the score by the factor of 0.8, and the results are sorted in descending order of grade
B) Check the student score and multiply the score by a factor of 0.8, and the results are sorted in descending order of grade and number
C) View student scores and multiply the results by a factor of 0.8, in ascending order of grades
D) View student scores and multiply the results by a factor of 0.8, resulting in descending order of grades and number of studies

16. Which of the following is not used to query, add, modify, and delete data statements in a database ()
A) Select B) insert
(C) Update D) drop

17. Use the SQL command to increase the value of the Payroll Salary field in teacher table teacher by 500, and the command you should use is ()
A) Replace salary with salary+500
B) Update teacher salary with salary+500
C) Update set salary with salary+500
D) Update teacher set salary=salary+500

18. The two related constraints of the table are ()
A) foreign keys and indexes for primary key and index B)
C) key and foreign key in primary and foreign key D)

19.
Fill in the blanks (1 points per question)
List four types of data you know:

In the SQL language, the command to delete a table is
Create a database with a command named Skylar

Jiang (5 points per question):

Table structure is as follows, write the table statement
Table Name: Ra_person_info
Field: RA_SN numeric (serial number)
CommonName character length 256 (name)
Uporgname character length 256 (competent unit)
Create Table Ra_person_info (
RA_SN Int (2),
CommonName varchar (256),
Uporgname varchar (256)
);

Insert the following information into the table created by the previous topic using SQL
Serial Number: 2
Name: Zhang San
Unit: BJCA

Insert into Ra_person_info values (2, "Zhang San", "Bjca");

Please list more than 10 SQL statements you know?
Insert Select Delete Update
Create show drop grant revoke load data create view

Create a Leak_download_url table with fields such as Id,url,md5,flag, set the ID as the primary key?
Create Table Leak_download_url (
Id Int (2) primary key auto_increment,
URL varchar (255),
MD5 char (255),
Flag enum ("0", "1")
);

How do you write SQL statements when you need to count the value of level 70 in the File data table?

Need to update the data for flag field 0 in the Leak_download_url table to flag 1?

What does a trigger do?
A trigger is a special kind of stored procedure that triggers execution when inserting, deleting, or modifying data in a particular table, which has finer and more complex data control than the standard functionality of the database itself. The main functions are as follows:
1. Security. The ability to have a database-based value gives the user some right to manipulate the database.
?? # ability to limit user actions based on time, such as not agreeing to change database data after work and holidays.
?? # Ability to restrict user actions based on data in a database, such as the price of a stock that is not agreed to increase by more than 10%.
2. Audit. Ability to track user actions on a database.???
?? # Audit the statements of the user operations database.
?? # writes the user's updates to the database to the audit table.
3. Implementing complex data integrity rules
?? # implements non-standard data integrity checks and constraints. Triggers can produce more complex restrictions than rules. Unlike rules, triggers can reference columns or database objects. For example, triggers can be rolled back regardless of what attempts to eat into futures that exceed their margin.

What is a stored procedure? Using what to invoke?
A stored procedure (Stored Procedure) is a set of SQL statements in a large database system that is designed to accomplish a specific function.
Called stored procedure call stored procedure name;

The role of the index? And what are the pros and cons of it?
In a relational database, an index is a single, physical storage structure that sorts the values of one or more columns in a database table, a collection of one or more column values in a table, and a logical pointer list corresponding to the data pages that physically identify those values in the table. The index acts as a catalog of books, and you can quickly find what you want based on the page numbers in the catalog.
Pros: Speed up your query history
Disadvantage: Take up physical storage space and slow down the recording speed.

What is a transaction?
A transaction is a rigorous set of operations in an application, and all operations must be completed successfully, or all changes made in each operation will be undone. A series of operations in a transaction are either all successful or not.
The end of a transaction has two types, and when all the steps in the transaction are executed successfully, the transaction commits. If one of the steps fails, a rollback operation occurs, and the undo action is undone until the start of the transaction.

What is a lock?
In simple terms, the database is designed to ensure the consistency of the data so that the various shared resources are made orderly by concurrent access. A corresponding locking mechanism is required for any kind of database. To ensure consistent data integrity, there is a locking mechanism for any database. The advantages and disadvantages of the locking mechanism should be directly thought of the concurrency processing capability and performance of a database system.

What is the difference between varchar and char in MySQL and what 50 means in varchar (50)?
Char fixed length character type max storage only 255 bytes
Varchar variable long character type maximum storage only 65532 bytes
varchar (50) 50 indicates a maximum of 50 bytes of data can be stored

MySQL database CPU soared to 500%, how to deal with it?
Check memory
View process
Show processlist

How do I log in to MySQL through the shell?
#Mysql-hip Address-u user name-p password

List all databases? show databases;

How do I switch to a database and work on it? Use library name;

List all tables in the database? Show tables;

How do I get the names and types of all field objects within a table? DESC table name;

How do I delete a table? drop table name;

How do I delete a database? drop database name;

How do I list all the data in the table ' XRT ' with the Name field value ' Tecmint ' and the web_address domain value ' tecmint.com '?

How do I list all data in the table ' XRT ' where the Name field value is not ' tecmint ' and the Web_address field value is ' tecmint.com '?

Suppose you have a table named XYZ, which has multiple fields, such as Createtime and engine. The field named engine consists of two values of Memoty and MyISAM, how to list only the Createtime and engine columns and the engine value is MyISAM?

What is the difference between drop, delete, and truncate in a database?
(1) The DELETE statement performs the deletion by deleting one row from the table at a time and saving the row's delete operation as a transaction record in the log for the rollback operation.
??? TRUNCATE? Table? Deleting all data from a table at one time does not keep a separate record of delete operations in the log, and deleting rows is not recoverable. Delete triggers related to the table are not activated during the removal process. Execution speed is fast.
(2) The space occupied by the table and index.
??? When the table is truncate, the space occupied by the table and index is restored to its original size.
??? The delete operation does not reduce the space occupied by the table or index.
??? The drop statement frees all the space occupied by the table.

Using NMAP command scanner a machine 192.168.0.1 to see how many ports it has open?
Nmap 192.168.0.1

What is the script to start and stop the MySQL service? Mysqld_safe

Say a program name that implements high availability under Linux? Keepalived

Use Tcpdump to monitor the host IP to 192.168.1.1,tcp port 80 data while saving the output to Tcpdump.log?
Tcpdump-a-W tcpdump.log 192.168.1.1-p TCP port 80

Describe the concept of load balancing and high availability?
LB: Multiple data average response to multiple connection requests from clients
HA: Primary Standby mode, the primary server is down and the backup server takes over.

Database and monitoring security

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.