Home / CSE / PHP - CS :: Databases Handling

CSE :: PHP - CS

  1. In PHP in order to access MySQL database you will use:

  2. A.

     mysqlconnect() function

    B.

     mysql-connect() function

    C.

     mysql_connect() function

    D.

     sql_connect() function

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Transactions are used to treat sets of SQL statements atomically.

  4. A.

     True

    B.

     False

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. SQL is not case sensitive. SELECT is the same as select.

  6. A.

     True

    B.

     False

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of the following is not an SQL aggregate function?

  8. A.

     AVG

    B.

     SUM

    C.

     MIN

    D.

     MAX

    E.

     CURRENT_DATE()

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. What does the DESC keyword do in the following query?

    SELECT *

    FROM MY_TABLE

    WHERE ID > 0

    ORDER BY ID, NAME DESC"

  10. A.

     It causes the dataset returned by the query to be sorted in descending order

    B.

     It causes rows with the same ID to be sorted by NAME in ascending order

    C.

     It causes rows with the same ID to be sorted by NAME in descending order

    D.

     It causes rows to be sorted by NAME first and then by ID

    E.

     It causes the result set to include a description of the NAME field

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. The ............. statement is used to delete a table.

  12. A.

     DROP TABLE

    B.

     DELETE TABLE

    C.

     DEL TABLE

    D.

     REMOVE TABLE

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. What will happen at the end of the following sequence of SQL commands?

    BEGIN TRANSACTION

    DELETE FROM MYTABLE WHERE ID=1

    DELETE FROM OTHERTABLE

    ROLLBACK TRANSACTION

  14. A.

     The contents of OTHERTABLE will be deleted

    B.

     The contents of both OTHERTABLE and MYTABLE will be deleted

    C.

     The contents of OTHERTABLE will be deleted, as will be all the contents of MYTABLE whose ID is 1

    D.

     The database will remain unchanged to all users except the one that executes these queries.

    E.

     The database will remain unchanged

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Use the .............. to delete the data inside the table, and not the table itself?

  16. A.

     DROP TABLE

    B.

     DELETE TABLE

    C.

     TRUNCATE TABLE

    D.

     REMOVE TABLE

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Can joins be nested?

  18. A.

     True

    B.

     False

    View Answer

    Workspace

    Discuss Discuss in Forum