⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 潜龙勿用.txt

📁 SQL语句初级
💻 TXT
📖 第 1 页 / 共 2 页
字号:
 1. 
 An insertion operation will _____ if the insertion violates the uniqueness property of a key.  
 

  (a) succeed with warning
 (b) succeed without warning
 (c) crash the system
 (d) fail  

 Correct answer is  (d)  
 2. 
 An insertion operation will _____ if the inserted primary key has a NULL value.  
 

  (a) succeed without warning
 (b) crash the system
 (c) fail
 (d) succeed with warning  

 Correct answer is  (c)  
 3. 
 The result of a set difference operation r - s will be  
 

  (a) those tuples that are in r but not in s
 (b) those tuples that are in s but not in r
 (c) tuples in s after deducting their values by the corresponding values in the tuples in r
 (d) tuples in r after deducting their values by the corresponding values in the tuples in s  

 Correct answer is  (a)  
 4. 
 What does a projection operation do?  
 

  (a) It extends the number of rows in a table.
 (b) It extends the number of columns in a table.
 (c) It selects columns from a table.
 (d) It selects rows from a table.  

 Correct answer is  (c) 
 5. 
 Which of the following is true about the number of primary keys and alternate keys with respect to a table?  
 

  (a) There can be many primary keys and many alternate keys.
 (b) There can be many primary keys, but only one alternate key.
 (c) There can be only one primary key, but many alternate keys.
 (d) There can be only one primary key and only one alternate key.  

 Correct answer is  (c)  
 6. 
 What is an alternate key?  
 

  (a) A key that was added to the table after the table was designed
 (b) The key to use when the primary key does not work
 (c) A key that will become the primary key when the primary key is deleted
 (d) Any key that is not a primary key  

 Correct answer is  (d)  
 7. 
 With respect to a relational table, what is a key?  
 

  (a) The one column that uniquely identifies a row in the table
 (b) The ID and password needed to access the table
 (c) A minimal subset of columns that uniquely identifies a row in the table
 (d) The subset of all the rows and columns in the table that are visible to all users in the database system  

 Correct answer is  (c)  
 8. 
 Which of the following is true about primary keys and foreign keys holding NULL value?  
 

  (a) A primary key can hold a NULL value and a foreign key can hold a NULL value
 (b) A primary key cannot hold a NULL value and a foreign key cannot hold a NULL value
 (c) A primary key cannot hold a NULL value and a foreign key can hold a NULL value
 (d) A primary key can hold a NULL value and a foreign key cannot hold a NULL value  

 Correct answer is  (c)  
 9. 
 For two tables to be union compatible, corresponding columns from each table should have which of the following?  
 

  (a) the same domain
 (b) different names
 (c) different domains
 (d) the same name  

 Correct answer is  (a)  
 10. 
 In the relational model, which of the following is true about the data type of a column?  
 (a) It need not be atomic and it can be an abstract data type.
 (b) It must be atomic and it cannot be an abstract data type.
 (c) It need not be atomic and it cannot be an abstract data type.
 (d) It must be atomic and it can be an abstract data type.  

 Correct answer is  (b)  
 11. 
 In contrast to _____ tables, a view refers to _____.  
 (a) base, a virtual table
 (b) virtual, base tables
 (c) non-empty, empty tables
 (d) empty, non-empty tables  

 Correct answer is  (a)  
 12. 
 In SQL, which of the following operators are used to check for set membership in a SELECT statement?  
 

  (a) MEMBER and NOT MEMBER
 (b) IN and NOT IN
 (c) SUBSET and NOT SUBSET
 (d) COMPONENT and NOT COMPONENT  

 Correct answer is  (b)  
 13. 
 In a transaction, COMMIT specifies that  
 

  (a) only the inserts and deletes of a transaction are about to be made permanent in the database
 (b) only the inserts and deletes of a transaction are to be made permanent in the database
 (c) all updates (including inserts, deletes, modifications) of a transaction are about to be made permanent in the database
 (d) all updates (including inserts, deletes, modifications) of a transaction are to be made permanent in the database  

 Correct answer is  (d)  

 Your score on this question is: 5.00  
 

--------------------------------------------------------------------------------

 14. 
 Which of the following SQL commands can be used to change, add, or drop column definitions from a table?  
 

  (a) ALTER TABLE
 (b) CHANGE TABLE
 (c) UPDATE TABLE
 (d) MODIFY TABLE  

 Correct answer is  (a)  

 Your score on this question is: 5.00  
 

--------------------------------------------------------------------------------

 15. 
 In SQL, the results of a _____ statement can be used to process a _____ statement.  
 

  (a) SELECT, INSERT
 (b) INSERT, DELETE
 (c) INSERT, SELECT
 (d) DELETE, INSERT  

 Correct answer is  (a)  

 Your score on this question is: 5.00  
 

--------------------------------------------------------------------------------

 16. 
 Which of the following is true about the physical storage of tables defined by views?  
 

  (a) Extra physical storage is always needed to store tables that a view defines.
 (b) Extra physical storage is needed to store tables that a view defines, only when rows are inserted into the view.
 (c) Extra physical storage is needed for storing the tables defined by views, only if views define additional non-existing columns.
 (d) There is no extra physical storage needed to store tables that a view defines.  

 Correct answer is  (d)  

 Your score on this question is: 5.00  
 

--------------------------------------------------------------------------------

 17. 
 When a string whose length is strictly less than n is entered as the value of a field whose SQL data type is CHAR(n), the system responds by  
 

  (a) padding the end of the string with NULL characters to length n before storing it
 (b) re-prompting for the entry of a string whose length is exactly n
 (c) storing the string as is
 (d) padding the end of the string with spaces to length n before storing it  

 Correct answer is  (d)  

 Your score on this question is: 0.00  
 

--------------------------------------------------------------------------------

 18. 
 When removing a table from the schema, using the CASCADE option would  
 

  (a) remove the table and all other tables that the specified table refers to.
 (b) remove the table if there are no references to it
 (c) remove the table and all references to it
 (d) recursively remove the table and all other tables that the removed table refers to  

 Correct answer is  (c)  

 Your score on this question is: 0.00  
 

--------------------------------------------------------------------------------

 19. 
 In a transaction, a ROLLBACK is used to  
 

  (a) roll all the updates (including inserts, deletes, modifications) of an aborted transaction into the database
 (b) roll only the inserts and deletes of an aborted transaction into the database
 (c) discard all the updates (including inserts, deletes, modifications) of a transaction from the database
 (d) discard only the inserts and updates of a transaction from the database  

 Correct answer is  (c)  

 Your score on this question is: 5.00  
 

--------------------------------------------------------------------------------

 20. 
 Which of the following SQL commands can be used to destroy and remove a table from the schema?  
 

  (a) DESTROY TABLE
 (b) REMOVE TABLE
 (c) DELETE TABLE
 (d) DROP TABLE  

 Correct answer is  (d)  

 Your score on this question is: 5.00  
 

--------------------------------------------------------------------------------

 Go to top of assessment.  

 Total score: 85.00 

 ? Copyright 2004 iCarnegie, Inc. All rights reserved.  
View Assessment Result


   

 Family Name:  Huang  
 Given Name:  Chun  
 Login:  nwpu043869  
 E-mail: huangchunming@2000.com  
 Status:  Enrolled  

 Assessment Name: Multiple-Choice Quiz 4  
 Instance:  1   

 Section: NWPU-SSD7-10  
 During:  Spring 2007  
 Section Status:  Active  

 For course:  Database Systems  
  (SSD7)  

 Corresponding to:  SSD7  
 At:  Software College of Northwestern Polytechnical University  
 

--------------------------------------------------------------------------------
 

 Your performance was as follows: 

 You took 8 minutes on this assessment from Fri Apr 27 23:16:04 UTC+0800 2007 to Fri Apr 27 23:23:23 UTC+0800 2007. 

 Total score: 90.00 
 
 

 

 1. 
 Which of the following is true about updateability of views?  
 

  (a) A view is not updateable under any circumstance.
 (b) A view is not updateable if it involves aggregate functions and nested queries.
 (c) A view is updateable under all circumstances.
 (d) A view is not updateable if it involves one table and contains a key.  

 Correct answer is  (b)  

 Your score on this question is: 10.00  
 



--------------------------------------------------------------------------------

 2. 
 Which of the following is true about updateability of views?  
 

  (a) A view is updateable if it involves one table and contains a key.
 (b) A view is not updateable under any circumstance.
 (c) A view is updateable if it involves multiple tables and no keys.
 (d) A view is updateable if it involves one table and does not contain a key.  

 Correct answer is  (a)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 3. 
 A vertical view allows users access to  
 

  (a) only specific rows of the defining tables
 (b) only specific columns of the defining tables
 (c) only the user tables
 (d) only the system tables  

 Correct answer is  (b)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 4. 
 The SQL keyword _____ makes the modifications of the transaction permanent, while the SQL keyword _____ discards the modifications of the transaction.  
 

  (a) SAVE, CANCEL
 (b) COMMIT, ROLLBACK
 (c) WRITE, ABORT
 (d) UPDATE, SELECT  

 Correct answer is  (b)  

 Your score on this question is: 10.00  

 Feedback: 
   
See section 2.2.2, subsection "Transactions and Integrity Constraints," in the course notes.
 
 

--------------------------------------------------------------------------------

 5. 
 Which of the following referentially triggered actions are supported in SQL when a referential integrity constraint is violated? 
SET NULL 
REJECT 
CASCADE 
SET DEFAULT 
 
 

  (a) I and IV only
 (b) I, III, and IV only
 (c) II and III only
 (d) I, II, and III only  

 Correct answer is  (b)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 6. 
 Which of the following commands can be used to give access permissions to a table?  
 

  (a) PERMIT
 (b) ALLOW
 (c) AUTHORIZE
 (d) GRANT  

 Correct answer is  (d)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 7. 
 Who can always give access permissions to a table?  
 

  (a) only the super-user
 (b) only the database administrator (DBA)
 (c) the owner of the table
 (d) the user of the table  

 Correct answer is  (c)  

 Your score on this question is: 0.00  
 

--------------------------------------------------------------------------------

 8. 
 Which of the following commands can be used to remove access privileges associated with a table?  
 

  (a) RETRACT
 (b) DENY
 (c) REVOKE
 (d) REMOVE  

 Correct answer is  (c)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 9. 
 When is embedded SQL referred to as static SQL?  
 

  (a) when the embedded SQL always returns the same set of results
 (b) when the SQL statements can never be changed
 (c) when the embedded SQL operates on the static part of the database
 (d) when the embedded SQL is translated into DBMS calls at compile-time  

 Correct answer is  (d)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 10. 
 When is embedded SQL referred to as dynamic SQL?  
 

  (a) when the SQL statements are changed in every run
 (b) when the embedded SQL operates on the dynamic part of the database
 (c) when the embedded SQL always returns different sets of results
 (d) when the embedded SQL is translated into DBMS calls at run-time  

 Correct answer is  (d)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 Go to top of assessment.  

 Total score: 90.00 

 ? Copyright 2004 iCarnegie, Inc. All rights reserved.  
View Assessment Result


   

 Family Name:  Huang  
 Given Name:  Chun  
 Login:  nwpu043869  
 E-mail: huangchunming@2000.com  
 Status:  Enrolled  

 Assessment Name: Multiple-Choice Quiz 3  
 Instance:  1   

 Section: NWPU-SSD7-10  
 During:  Spring 2007  
 Section Status:  Active  

 For course:  Database Systems  
  (SSD7)  

 Corresponding to:  SSD7  
 At:  Software College of Northwestern Polytechnical University  
 

--------------------------------------------------------------------------------
 

 Your performance was as follows: 

 You took 6 minutes on this assessment from Fri Apr 27 23:09:12 UTC+0800 2007 to Fri Apr 27 23:15:05 UTC+0800 2007. 

 Total score: 90.00 
 
 

 

 1. 
 In SQL, when destroying a database, the CASCADE option removes  
 

  (a) the data but not the schema
 (b) everything in the specified database: the data, schema, etc.
 (c) the schema if the database has no data (empty tables)
 (d) the data and schema from the specified database, and from related databases  

 Correct answer is  (b)  

 Your score on this question is: 0.00  
 



--------------------------------------------------------------------------------

 2. 
 When a string whose length is strictly less than n is entered as the value of a field whose SQL data type is VARCHAR(n), the system responds by  
 

  (a) padding the end of the string with NULL characters to length n before storing it.
 (b) storing the string as is.
 (c) padding the end of the string with spaces to length n before storing it.
 (d) re-prompting for the entry of a string whose length is exactly n.  

 Correct answer is  (b)  

 Your score on this question is: 10.00  
 

--------------------------------------------------------------------------------

 3. 
 In SQL, one function of the AS operator is to  
 

  (a) define the domain of an attribute
 (b) limit the cardinality of a relation
 (c) customize the names of columns in a query’s result

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -