Take the test > Grade Test > Computer Level 2 Test > MySQL & gt Simulation Test > Text
20 16 computer secondary MySQL exercises and answers (1)
Exam bar 2016-01-15:17: 03 comments (0)
Click to view: 20 16 computer secondary MySQL exercise and answer summary.
1 [Fill in the blank] The three-level mode structure of the database system means that the database system consists of _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Citation analysis: out-of-mode mode and in-mode mode
2 [short answer] What kind of language is PHP?
Reference analysis: PHP is the abbreviation of English hypertext preprocessor. PHP is an embedded HTML language, and it is a scripting language that embeds HTML documents on the server side. Language style is similar to C language, and it is widely used. Another meaning of PHP is: the standard symbol of Philippine peso.
3 [Short answer] Please write a PHP program, which requires that a line of data describing the following message information can be inserted into the table content of database db_test: the message ID number is automatically generated by the system; The message title is "MySQL Question Consultation"; The message content is "What are the basic operations on table data in MySQL?" ; The caller's name is "MySQL Beginner"; The file name of Facebook icon is "face.jpg"; The email address is "Tom @ gmail.com"; The message creation date and time is the current system time.
Reference analysis:
Write the following PHP program in a text editor and name it insert_content.php
$ con = MySQL-connect(" localhost:3306 "," root "," 123456 ")
Or die ("database server connection failed!
):
Mysql_select_db("db_test ",$con) or die ("Database selection failed!
"):
mysql_query("set names'gbk .' ); //Set Chinese character set
$ SQL 2 " INSERT INTO content(content _ id,subject,words,username,face,email,create time)n;
$sql=$sql。 "VALUES(NULL,' MySQL Q&A',' What are the basic operations on table data in MySQL?' ,
MySQL beginner',' face. JP9 ',' tom@gmail.corn ',NOW()); ";
if(mysql_query($sql,$con))
Ech0 "message information added successfully!
":
other
Ech0 "message information addition failed!
":
& gt
4 [Fill in the blank] The 3NF of relation R means that none of them () pass any candidate keys that depend on it.
Reference parsing: non-primary attributes
5 [Short answer] There is a student list as follows.
Query the information of all students in the table.
All students' English scores will be plus 10.
Check the grades of the student named Wu Wang.
Inquire about students whose English scores are greater than 90.
Inquire about students whose English scores are between 80 and 90.
Inquire about students with math scores of 89, 90, 965, 438+0.
After sorting the math scores, output the names and math scores.
Reference analysis:
Query the information of all students in the table.
Choose id, name, Chinese, English and math from the students;
select * from student
All students' English scores will be plus 10.
Choose names from students, English+10;
Check the grades of the student named Wu Wang.
select * from student where name = ' Wang Wu ';
Inquire about students whose English scores are greater than 90.
select * from student where English & gt; 90;
Inquire about students whose English scores are between 80 and 90.
select * from student where English & gt; 80 and English & lt90;
Choose * English from students is between 80 and 90;
Inquire about students with math scores of 89, 90, 965, 438+0.
Select * from student where math=80 or math=90 or math = 91;
select * from student where math in(80,90,9 1);
After sorting the math scores, output the names and math scores.
Choose names and mathematics from students, and sort them by mathematics;
6 】 【 multiple choice 】 index can improve the efficiency of which operation ()
A. Insert B. Update C. Delete D. Select
Reference answer: D.
7 [Fill in the blank] Because the database system provides the mapping function between () and (), it ensures that the database system has high data independence.
8 【 multiple-choice questions 】 In database design, the process of transforming an E-R diagram into a relational data model belongs to ().
A. Requirements analysis stage B. Logical design stage C. Conceptual design stage D. Physical design stage
Reference answer: b
9 [Multiple-choice] E-R diagram is one of the tools for database design, which is generally suitable for _ _ _ _ _ _ to establish a database.
A. conceptual model B. structural model C. physical model D. logical model
Reference answer: a
10 [short answer] Please briefly describe the basic steps of programming MySQL database with PHP.
Reference analysis:
The basic steps of programming MySQL database with PHP are as follows:
(1) First, establish a connection with the MySQL database server.
(2) Then select the database to operate.
(3) Perform corresponding database operations, including adding, deleting, modifying and querying data.
1 1 [short answer] Create a stored procedure in the database db_test, which is used to change the e-mail address of a commentator in a given table to a given value.
Reference analysis:
Enter the following SQL statement in MySQL command-line client:
Mysql & gt uses db _ test.
The database has changed.
Mysql & gt delimiter $ $
Mysql & gt creation process sp_update email (in user name VARCHAR(50) and email VARCHAR(50))
I > start
I > update content setting email = email, where user name = user name;
I > end $ $
The query is normal, and 0 lines are affected (0.06 seconds).
12 [Fill in the blank] bool data is used to store logical values, and it has only two states, namely "()" and "()".
Quote analysis: true or false
The keyword 13[ fill in the blank] () can connect the results of two or more SELECT statements.
Reference analysis: union
14 [multiple-choice questions] The only keyword indexed in mysql is ()
A. Full-text index B. Unique index C. Unique index D. Index
Reference answer: C.
15 [Fill in the blanks] When creating a unique index, the commonly used keyword is _ _ _ _ _ _.
Reference analysis: unique
16[ Fill in the blanks] If the keyword "()" is used, the update statement will not be interrupted even if an error occurs during the update process.
Reference analysis: "Ignore"
17 [Multiple-choice question] The instruction to modify only the data type of the column is ().
A. change the table … change the column
B. change the table … modify the column …
C. Change the form ... Update ...
D. change the table … update the column …
Reference answer: b
18 [short answer] View the table structure
Reference solution: desc employees;
Expand the full text
content
Please enter a keyword.
Comment (0) has been published.
Post a new comment
Take the exam.
If you want to take the exam, you have to take the exam!
examination
Touch screen computer edition
Copyright? 2004-20 19
Kaoba (m.566.com) Beijing Xiong Ying Education Technology Co., Ltd.
Social unified credit code: 9111kloc-0/0877 95089 232.
help center